【发布时间】:2014-11-25 10:25:29
【问题描述】:
首先,我正在关注位于here 的弹性搜索教程。我正在尝试使用多个查询字符串执行搜索。
我的索引有几个字段,但我感兴趣的是“路径”。
我知道我至少有这条路
path: "ops/TopRelation/...."
在我的索引中。我已经确认了。
为什么这个查询什么也没返回。
{
"query":{
"match":{
"path":{
"query": "ops toprelation",
"operator": "and"
}
}
}
}
但是这个查询返回了我期望的结果。
{
"query": {
"bool": {
"must": [
{ "match": { "path": "ops" }},
{ "match": { "path": "toprelation" }}
]
}
}
}
我以为顶部查询基本上是在内部使用底部查询?的确,教程中的例子似乎表明this。
Because the match query has to look for two terms — ["brown","dog"] — internally it
has to execute two term queries and combine their individual results into the overall
result. To do this, it wraps the two term queries in a bool query, which we will
examine in detail in Combining queries below.
【问题讨论】:
标签: indexing elasticsearch full-text-search match multi-term