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

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"
          }
        }
      ]
    }
  }
}

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

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

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

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











本文转自张昺华-sky博客园博客,原文链接:http://www.cnblogs.com/bonelee/p/6475896.html,如需转载请自行联系原作者


上一篇:Python:设计模式之代理模式


下一篇:酒店式公寓:智能家居落地的第一站?