我有一个索引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
。
如何结合几个字段和值进行搜索?