Elastic search scoring issue

Hi All,

I have implemented edge_ngram.
When i am searching "Santanu Prasad"
I am getting 3 doc, "santanu", "santanu prasad" and "prasad"
For the below query i am getting : "Prasad" with highest score then "Santanu Prasad" then "Santanu" .
Could you please tell me why this behaviour
I am trying to search name with below query :

{
"size": "1000",
"from": 0,
"sort": [
{
"_score": {
"order": "desc"
}
}
],
"query": {
"bool": {
"must": {
"nested": {
"path": "names",
"query": {
"bool": {
"must": [
{
"match": {
"names.name": {
"query": "Santanu Prasad"

                                    }
                                }
                            }
                        ]
                    }
                }
            }
        },
        "filter": [
       
            {
                "nested": {
                    "path": "names",
                    "query": {
                        "bool": {
                            "must": [
                               {
                                    "match": {
                                        "names.name": {
                                            "query": "Santanu Prasad"
                                        }
                                    }
                                    
                                }
                                
                              
                            ]
                        }
                    },
                    "inner_hits": {
                        "_source": [
                            "names"
                        ]
                    }
                }
            }
        ]
    }
},
"_source": [
    "partyId",
    
    "isSearchable"
  
]

}

can you share with us the settings and mapping of your index?

"my index": {
"settings": {
"index": {
"routing": {
"allocation": {
"include": {
"_tier_preference": "data_content"
}
}
},
"mapping": {
"nested_objects": {
"limit": "50000"
}
},
"number_of_shards": "3",
"provided_name": "my index",
"creation_date": "1735928240828",
"analysis": {
"filter": {
"synonym": {
"type": "synonym",
"synonyms_path": "./dictionaries/synonyms.txt"
}
},
"analyzer": {
"autocomplete": {
"filter": [
"lowercase"
],
"tokenizer": "autocomplete"
},
"case_insensitive": {
"filter": [
"lowercase"
],
"tokenizer": "keyword"
}
},
"tokenizer": {
"autocomplete": {
"filter": [
"lowercase",
"synonym"
],
"token_chars": [
"letter",
"digit"
],
"min_gram": "3",
"type": "edge_ngram",
"max_gram": "40"
}
}
},
"number_of_replicas": "0",
"uuid": "xxxxxxxxx",
"version": {
"created": "8505000"
}
}
}
}
}

Hey @Santanu112 !

Please wrap your JSON using preformatted text, so we can read that better :slightly_smiling_face:

Can you add ?explain=true to your search so you get an explanation of the score for your documents?