'Elasticsearch full match score lower than part prefix

I use text field and default analyzer.

Source:

  "id": "1",
  "name": "Nette"  // convert by default analyzer to 'nette'
  
  "id": "2",
  "name": ".NET"  // convert by default analyzer to 'net'

I do phrase_prefix query

{
    "query": {
        "multi_match": {
            "type": "phrase_prefix",
            "query": ".net", // convert by default analyzer to 'net'
            "fields": ["name"]
        }
}

And i get result:

"_score": 8.211289,
    "_source": { "name": "Nette",

"_score": 7.5605545,
    "_source": { "name": ".NET",

What is joke? why full match 'net' == 'net' is lower then 'net' == 'nette' ?



Solution 1:[1]

Use the explain: true query parameter to find out the details of the score value. I'm not sure, but it might be that the found word is just longer than the other one and therefore "more valuable".

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 antti.kom