我使用彈性搜索版本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