我有一個索引users
與user
類型。映射是動態的。現在user
HS一個結構如下:如何查找elasticsearch中與字段和值匹配的所有文檔?
"user": {
"nested": {
"one":51
},
"other": {
"two":"hi!"
},
"three":false
}
我需要找到具有other.two
字段值hi
或具有價值false
three
領域的所有用戶。例如。具有other.two
的用戶必須具有hi
值或three
字段值爲false
。如何從彈性搜索中選擇這個?
我曾嘗試:
GET /users/user/_search
{"query": {"match": {"other.two": "hi"}}}
返回用戶的我,但
GET /users/user/_search
{"query": {"match": {"other.two": "hi", "three":false}}}
返回我SearchPhaseExecutionException
。
如何結合幾個字段和值進行搜索?