1 回答

TA貢獻(xiàn)1725條經(jīng)驗(yàn) 獲得超8個贊
在 elasticsearch 中,必須是 AND 并且應(yīng)該表現(xiàn)得像 OR 您的查詢轉(zhuǎn)換為 locationId is null AND locations.country_id In [set of ids]。must需要換成should。
詢問:
{
"query": {
"bool": {
"should": [
{
"bool": {
"must_not": [
{
"exists": {
"field": "location_id"
}
}
]
}
},
{
"terms": {
"locations.country_id": [
18
]
}
}
],
"minimum_should_match": 1
}
}
}
- 1 回答
- 0 關(guān)注
- 135 瀏覽
添加回答
舉報