为包含精确短语的文档提高ElasticSearch分数

时间:2015-09-03 06:42:22

标签: elasticsearch

所以我有以下问题:

{
  "timeout": 10000,
  "from": 0,
  "size": 10,
  "sort": [
    {
      "_score": {
        "order": "desc"
       }
     },
    {
      "rating_avg": {
       "order": "desc"
      }
},
{
  "category_view_avg": {
    "order": "desc"
  }
    }
  ],
  "query": {
    "bool": {
      "must": [
        {
          "query_string": {
            "query": "*iphone 6*",
            "default_operator": "and",
            "fields": [
              "title",
              "description",
              "category_titles"
            ],
            "analyze_wildcard": true
          }
        }
      ]
    }
  },
  "filter": {
    "and": [
      {
        "terms": {
          "category_ids": [
            2889732
          ],
          "execution": "bool"
        }
      }
    ]
  },
  "aggs": {
    "category_ids": {
      "terms": {
        "field": "category_ids",
        "size": 15
      }
    }
  }
}

此查询将为具有如下标题的记录计算相同的_score

  • 苹果iphone-5-16gb
  • 苹果iphone-6加16GB - 银 - mga92b-A

有没有什么方法可以在查询字段中并排查询所有查询单词的文档中添加一些额外的_score点?

0 个答案:

没有答案