我的彈性搜索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