Filter can generate _score other than 1?


(Kyunam Kim) #1

I saw this paragraph in Elasticsearch Guide -

“Relevance is not just about full-text search, though. It can equally be applied to yes/no clauses, where the more clauses that match, the higher the _score."

I tried bool filter with multiple term filters but still generated _score = 1.

Can you give me one example that will make me understand the above paragraph?

thanks,
Q


(Adrien Grand) #2

Something like:

{
  "bool": {
    "should": [
      { "constant_score": { "term": { "tags": "foo" } } },
      { "constant_score": { "term": { "tags": "bar" } } }
    ]
  }
}

In that case the score will only depends on the tags that exist in the documents, not about term frequency, document frequency, or any other thing that are usually leveraged for full text scoring.


(system) #3