Elasticsearch : constant_score query vs bool.filter query

后端 未结 1 801
醉酒成梦
醉酒成梦 2021-01-17 18:19

I am trying to achieve an exact match result using Elasticsearch (so I don\'t care about scoring here)

I see that there are 2 ways to do this :

{
          


        
1条回答
  •  伪装坚强ぢ
    2021-01-17 18:44

    Constant score query gives an equal score to any matching document irrespective of any scoring factors like TF, IDF etc. This can be used when you don't care whether how much a doc matched but just if a doc matched or not and give a score too, unlike filter.

    A constant_score query takes a boost argument that is set as the score for every returned document when combined with other queries. By default boost is set to 1.

    If you are interested below link will give you more insight

    https://www.compose.com/articles/elasticsearch-query-time-strategies-and-techniques-for-relevance-part-ii/

    0 讨论(0)
提交回复
热议问题