nafas
nafas

Reputation: 5423

how to make elastic search to "NOT" increase scores if multiple were matched

consider this:

doc1-->
{
   "content":{"one"}
}

doc2-->
{
   "content": {"one one one one two two"}
}

doc3-->
{
   "content": {"one one"}
}

if I query this as :

{endpoint}/_search?q=one+two

my scores would be :

(doc2)6,(doc3)2,(doc1)1

my question is how I can query this so my scores would ignore duplicates and be flatted to:

(doc2)2,(doc3)1,(doc1)1

Upvotes: 0

Views: 54

Answers (1)

Vineeth Mohan
Vineeth Mohan

Reputation: 19263

What you are trying to achieve is to disable term frequency in scoring. You can disable it in the mapping.

You can find how to do it here.

Upvotes: 3

Related Questions