我不认为您可以直接通过多重匹配直接执行此操作,但是如果添加突出显示,您应该得到一个响应,显示匹配的字段:
http://www.elasticsearch.org/guide/zh-
CN/elasticsearch/guide/current/highlighting-
intro.html
在此页面的示例中:
GET /megacorp/employee/_search { "query" : { "match_phrase" : { "about" : "rock climbing" } }, "highlight": { "fields" : { "about" : {} } }}您可以将match_phrase更改为multi_match并添加字段列表:
GET /megacorp/employee/_search { "query" : { "multi_match" : { "query" : "rock climbing", "fields": ["about", "otherfield"] } }, "highlight": { "fields" : { "about" : {}, "otherfield": {} } }}这应该会给您一个突出显示的响应,其中包括匹配文本和匹配字段周围的突出显示。



