我想找到包含「鮑勃」,具有位置即在任一「帕迪尤卡」或'一名文檔士麥那」。Elasticsearch布爾查詢必須單場獨詞,而另一場或術語匹配
這是我現在有:
query: {
bool: {
must: [
{ match: { name: 'bob' } },
{ match: { location: ['paducah', 'smyrna'] } }
],
},
},
我知道這個問題是位置陣中,因爲如果我把它沒有陣列更改爲單元素的查詢工作就好了。
This is the closest answer i could find。
它沒有工作,我收到以下錯誤:
[term] malformed query, expected [END_OBJECT] but found [FIELD_NAME]