Elasticsearch DSL に問題があります。ファセット ナビゲーションを使用しているときに、ファセット フィルターを適用すると、要求したにもかかわらず、結果の次のセットにそれ以上のファセットが含まれません。
最初の検索を行うと、必要な結果が返されます。
{
"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 フィルターを追加しています。これは、ユーザーがフィルター処理する複数の価格帯を選択できるためです。
私は何か間違ったことをしていますか?
価格を変更すると明らかに他のファセットのファセット数が変更されるため、新しいファセットが返されることを望みます...