你好Elasticsearch大師,我需要你的幫助! 我們使用Elasticsearch V5.4和 我有多個嵌套類型在elasticsearch的形式:Elasticsearch post_filter對嵌套類型沒有過濾聚合
"testLookup" : [
{
"id": 1001,
"name": "test1"
},
{
"id": 1002,
"name": "test2"
}
]
這我想顯示的名稱作爲過濾器複選框選項。
我試圖使用post_filter頂級元素,基本篩選聚合,所以我可以更新和顯示只有受影響的過濾選項,還挺喜歡它是如何被這個演示網站上使用:http://demo.searchkit.co
"post_filter": {
"bool":{
"must": [
{
"nested" : {
"path" : "testLookup",
"query": {
"bool": {
"filter":{
"bool":{
"should":[
{ "term": { "perTestLookup.name.keyword": "Adele"}}
]
}
}
}
}
}
},
{
"nested" : {
"path" : "testLookup2",
"query": {
"bool": {
"filter":{
"bool":{
"should":[
{ "term": { "perTestLookup2.name.keyword": "Gene" }}
]
}
}
}
}
}
}
]
}
}
如果我沒有弄錯,我認爲post_filter所做的是在發送搜索請求之前爲每個聚合應用過濾器,您可以通過查看搜索過濾器的請求有效負載後單擊其中一個過濾複選框。
但是,我無法獲得post_filter將過濾器應用於聚合,過濾器只是沒有被應用。爲什麼會這樣?是不支持嵌套類型的post_filter?
任何提示或指導將不勝感激。謝謝!