# Elastic search scoring issue

**URL:** <https://discuss.elastic.co/t/elastic-search-scoring-issue/374694>\
**Category:** Elasticsearch\
**Created:** [February 18, 2025, 3:12pm UTC](https://discuss.elastic.co/t/elastic-search-scoring-issue/374694 "2025-02-18T15:12:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Santanu112](https://avatars.discourse-cdn.com/v4/letter/s/3bc359/32.png) [@Santanu112](https://discuss.elastic.co/u/Santanu112)\
**Post date:** [February 18, 2025, 3:12pm UTC](https://discuss.elastic.co/t/elastic-search-scoring-issue/374694/1 "2025-02-18T15:12:45Z")

</div>

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"
  
]

```

}

---

<div class="post-metadata">

**Author:** ![ahmed\_charafouddine](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ahmed_charafouddine/32/45129_2.png) [@ahmed\_charafouddine](https://discuss.elastic.co/u/ahmed_charafouddine)\
**Post date:** [February 18, 2025, 3:59pm UTC](https://discuss.elastic.co/t/elastic-search-scoring-issue/374694/2 "2025-02-18T15:59:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Santanu112](https://avatars.discourse-cdn.com/v4/letter/s/3bc359/32.png) [@Santanu112](https://discuss.elastic.co/u/Santanu112)\
**Post date:** [February 18, 2025, 4:30pm UTC](https://discuss.elastic.co/t/elastic-search-scoring-issue/374694/3 "2025-02-18T16:30:48Z")

</div>

"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"  
}  
}  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![Carlos\_D](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carlos_d/32/126245_2.png) [@Carlos\_D](https://discuss.elastic.co/u/Carlos_D)\
**Post date:** [February 21, 2025, 7:04pm UTC](https://discuss.elastic.co/t/elastic-search-scoring-issue/374694/4 "2025-02-21T19:04:47Z")

</div>

Hey @Santanu112 !

Please wrap your JSON using `preformatted text`, so we can read that better 🙂

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