Query-Time Boosting

In Prioritizing Clauses, we explained 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

相关文章:

  • 2023-03-21
  • 2021-08-03
  • 2021-07-10
  • 2021-11-06
  • 2022-02-04
  • 2021-05-26
猜你喜欢
  • 2021-09-22
  • 2021-09-11
  • 2021-05-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-12
相关资源
相似解决方案