【发布时间】:2015-04-03 06:50:33
【问题描述】:
我有一个索引users 和user 类型。映射是动态的。现在 user 具有以下结构:
"user": {
"nested": {
"one":51
},
"other": {
"two":"hi!"
},
"three":false
}
我需要找到所有具有 other.two 字段且值为 hi 或具有 three 字段且值为 false 的用户。例如。具有other.two 的用户必须在其中具有hi 值或具有false 值的three 字段。如何从弹性搜索中选择这个?
我试过了:
GET /users/user/_search
{"query": {"match": {"other.two": "hi"}}}
为我返回一个用户,但是
GET /users/user/_search
{"query": {"match": {"other.two": "hi", "three":false}}}
给我一个SearchPhaseExecutionException。
如何组合多个字段和值进行搜索?
【问题讨论】:
标签: search elasticsearch