我的弹性搜索DSL存在问题,因为在使用方面导航时,当我应用我的方面过滤器时,下一组结果不包含任何其他方面,即使我已经询问他们。elasticsearch方面或过滤器
当我最初的搜索,我得到的结果,我想回去:
{
"sort": {
"_score": {},
"salesQuantity": {
"order": "asc"
}
},
"query": {
"filtered": {
"query": {
"match": {
"categoryTree": "D01"
}
},
"filter": {
"term": {
"publicwebEnabled": true,
"parentID": 0
}
}
}
},
"facets": {
"delivery_locations": {
"terms": {
"field": "delivery_locations",
"all_terms": true
}
},
"categories": {
"terms": {
"field": "categoryTree",
"all_terms": true
}
},
"collectable": {
"terms": {
"field": "collectable",
"all_terms": true
}
}
},
"from": 0,
"size": 12}
当我再申请一个过滤器像这样,结果我回来不包括方面:
{
"sort": {
"_score": {},
"salesQuantity": {
"order": "asc"
}
},
"query": {
"filtered": {
"query": {
"match": {
"categoryTree": "D01"
}
},
"filter": {
"term": {
"publicwebEnabled": true,
"parentID": 0
},
"or": [
{
"range": {
"Retail_Price": {
"to": "49.99",
"from": "0"
}
}
}
]
}
}
},
"facets": {
"delivery_locations": {
"terms": {
"field": "delivery_locations",
"all_terms": true
}
},
"categories": {
"terms": {
"field": "categoryTree",
"all_terms": true
}
},
"collectable": {
"terms": {
"field": "collectable",
"all_terms": true
}
}
},
"from": 0,
"size": 12}
注意,我在上面添加了OR过滤器 - 因为用户可以选择多个价格范围进行过滤。
我做错了什么?
我希望新的层面返回改变价格显然会改变其他方面的面数...
我看到完全一样的东西。当我的查询块包含“过滤”部分时,我不会在结果中返回任何方面 – svrist 2013-12-05 10:57:21