这是我的配置
fos_elastica:
clients:
default: { host: localhost, port: 9200 }
indexes:
allstock:
types:
clip:
mappings:
clipInfo:
type: "nested"
properties:
title : { boost: 10 }
description : { boost: 2 }
filterCategories:
type: "nested"
properties:
tags:
type: "nested"
properties:
tag : { boost: 5 }
filterCategory:
type: "nested"
properties:
name: ~
persistence:
driver: orm
model: Application\myBundle\Entity\Clip
provider: ~
listener: ~
finder: ~
这是我的索引数据
{
"took": 1,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 4,
"max_score": 1.0,
"hits": [
{
"_index": "allstock",
"_type": "clip",
"_id": "11",
"_score": 1.0,
"_source": {
"clipInfo": {
"title": "title 1",
"description": "some desc"
},
"filterCategories": [
{
"tags": [
{
"tag": "Interior"
}
],
"filterCategory": {
"name": "Setting"
}
},
{
"tags": [
{
"tag": "Sunny"
}
],
"filterCategory": {
"name": "Season"
}
}
]
}
},
{
"_index": "allstock",
"_type": "clip",
"_id": "12",
"_score": 1.0,
"_source": {
"clipInfo": {
"title": "title 2",
"description": "desc 2"
},
"filterCategories": [
{
"tags": [
{
"tag": "Sunny"
},
{
"tag": "Rainy"
}
],
"filterCategory": {
"name": "Weather"
}
},
{
"tags": [
{
"tag": "Autumn"
},
{
"tag": "Winter"
}
],
"filterCategory": {
"name": "Season"
}
}
]
}
}
]
}
}
我正在尝试在filterCategories
嵌套集合
when tag in tags == 'sunny'
then name in filterCategory == 'Weather'
{p> tag
tags
和name
filterCategory
依赖于其他值。
我怎样才能做到这一点?