我使用弹性搜索版本1.7.5如何实现弹性搜索而不是过滤?
我已经采取了一些想法,从这个帖子: Elastic search Not filter inside and filter
下面的查询似乎并没有被过滤掉了与item_category_id
17相关的项目。有没有可以看到的语法错误? not
以外的filters
阵列内定义的术语工作正常。
{
query: {
filtered: {
filter: {
and: {
filters: [
{ not: {
filter: {
terms: {item_category_ids: [17] }
}
}
},
{ term: { user_inactive: false } },
{ term: { kind: 1 } }
]
}
}
}
}
对不起,我应该指定我公司采用弹性搜索版本1.7.5 – matthewalexander
看样子,这查询不工作,ES 1.7.5 ... – matthewalexander
没有这对ES 2查询然后。我已经更新了我的答案 – Val