【发布时间】:2016-07-20 18:58:59
【问题描述】:
假设我在 elasticsearch 中对两个不同的索引字段进行 AND/MUST 运算符查询 如下:
"bool": {
"must": [
{
"match" : {
"query": "Will",
"fields": [ "first",],
"minimum_should_match": "100%" // assuming this is q1
}
},
{
"match" : {
"query": "Smith",
"fields": [ "last" ]
"minimum_should_match": "100%" //assuming this is q2
}
}
]
}
现在我想知道弹性搜索如何在后台获取文档。 它是否会获取索引与 q1 匹配的所有文档的 id,然后遍历所有也具有索引 q2 的文档。
或
两组的交集是怎么做的?
如何索引我的数据以优化和查询两个单独的字段?
【问题讨论】:
标签: elasticsearch indexing lucene query-optimization