Hi,

This happens because of query normalization: the query normalization factor
is 1/boost so in the end the score is multiplied by the boost and then
divided by the boost again in the end, so the score remains 0.

However, this doesn't mean that the boost is always ignored! For example,
if you wrap two constant-score queries into a boolean query:

{
    "query": {
        "bool": {
            "should": [
               {
                   "constant_score": {
                       "filter": {
                           "term": {
                              "fifled": "value1"
                           }
                       },
                       "boost": 2
                    }
               },
               {
                   "constant_score": {
                       "filter": {
                           "term": {
                              "field": "value2"
                           }
                       },
                       "boost": 5
                    }
               }
            ]
        }
    }
}

Documents that match "value2" will get a higher score than documents that
match "value1".

-- 
Adrien Grand

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j7me_CRCvSan5zwh-MNOxUx1fgEqi6c9G-4zoxB_W6%3DLA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to