码迷,mamicode.com
首页 > 其他好文 > 详细

ES设置字段搜索权重——Query-Time Boosting

时间:2017-02-27 20:39:04      阅读:564      评论:0      收藏:0      [点我收藏+]

标签:guid   important   设置   tty   mat   content   not   row   wrap   

Query-Time Boosting

In Prioritizing Clauses, we explained how you could use the boost parameter at search time to give one query clause more importance than another. For instance:

GET /_search
{
  "query": {
    "bool": {
      "should": [
        {
          "match": {
            "title": {
              "query": "quick brown fox",
              "boost": 2 技术分享
            }
          }
        },
        {
          "match": { 技术分享
            "content": "quick brown fox"
          }
        }
      ]
    }
  }
}

技术分享

The title query clause is twice as important as the content query clause, because it has been boosted by a factor of 2.

技术分享

A query clause without a boost value has a neutral boost of 1.

 

转自:https://www.elastic.co/guide/en/elasticsearch/guide/current/query-time-boosting.html

ES设置字段搜索权重——Query-Time Boosting

标签:guid   important   设置   tty   mat   content   not   row   wrap   

原文地址:http://www.cnblogs.com/bonelee/p/6475896.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!