你好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?
任何提示或指导将不胜感激。谢谢!