说我质疑:
POST /story/story/_search
{
"query":{
"bool":{
"should":[
{
"match":{
"termVariations":{
"query":"not driving",
"type":"boolean",
"operator":"AND"
}
}
},
{
"match":{
"termVariations":{
"query":"driving",
"type":"boolean",
"operator":"AND"
}
}
}
]
}
}
}此查询由一个分析器或另三个文档返回。我如何判断哪个条款应该匹配?Elasticsearch可以返回匹配的短语和结果吗?
谢谢!
发布于 2015-11-12 15:52:03
这里最好的选择是命名查询。您可以将查询命名为每个文档将提供匹配的查询的名称。
{
"query": {
"bool": {
"should": [
{
"match": {
"name.first": {
"query": "qbox",
"_name": "first"
}
}
},
{
"match": {
"name.last": {
"query": "search",
"_name": "last"
}
}
}
]
}
}
}发布于 2015-11-12 15:50:02
谢谢你!重点正是我要找的!
https://stackoverflow.com/questions/33674787
复制相似问题