Elasticsearch - 如何知道特定匹配条件是否被命中

时间:2017-11-08 05:20:38

标签: elasticsearch

你好弹性专家!

我是elasticsearch的新手。我正在尝试使用多个or匹配来构建搜索查询。我正在提升不同匹配条件的查询。但在这里我需要更多信息。我需要知道哪些条件对搜索结果有贡献。有没有办法知道查询字符串遇到了哪些匹配条件?

{
"query": {
  "bool": {
    "should": [
    {
      "term": {
        "title.keyword": {
          "value": "Ski trip",
          "boost": 1
        }
      }
    },
    {
      "match_phrase_prefix": {
        "title": {
          "query": "Ski trip",
          "boost": 0.8
        }
      }
    },
    {
      "match": {
        "title": {
          "query": "Ski trip",
          "operator": "and",
          "boost": 0.6
        }
      }
    },
    {
      "match": {
        "description": {
          "query": "Ski trip",
          "boost": 0.3
        }
      }
    }
   ]
  }
 }
}

0 个答案:

没有答案
相关问题