# Elastic Search is giving same score for all parent document which has nested documents

**URL:** <https://discuss.elastic.co/t/elastic-search-is-giving-same-score-for-all-parent-document-which-has-nested-documents/364931>\
**Category:** Elasticsearch\
**Created:** [August 14, 2024, 8:04pm UTC](https://discuss.elastic.co/t/elastic-search-is-giving-same-score-for-all-parent-document-which-has-nested-documents/364931 "2024-08-14T20:04:52Z")\
**Posts on this page:** 3\
**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:** [August 14, 2024, 8:04pm UTC](https://discuss.elastic.co/t/elastic-search-is-giving-same-score-for-all-parent-document-which-has-nested-documents/364931/1 "2024-08-14T20:04:52Z")

</div>

I am trying elstic search query and all my search results is showing same \_score. For that i am not getting the appropriate result.  
GET my\_index/\_search  
{  
"from": 0,  
"size": 10,  
"query": {

```
    "bool": {
        "must": [
            {
                "match": {
                    "Id": "xxxxx"
                }
            }
        ],
        "filter": [
            {
                "nested": {
                    "path": "names",
                    "query": {
                     
                        "bool": {
                            "should": [
                                {
                                    "match": {
                                        "names.name": {
                                            "query": "Jon wick"
                                            //"fuzziness": "AUTO"
                                        }
                                    }
                                }
                            ]
                        }
                      
                    
                    }
                    
                }
            }
        ]
    
    
  }
},

     

"_source": [
    "partyId",
    "isSearchable"

]

```

}

Result:  
I am getting sult like below :{  
"\_index": "my\_index",  
"\_id": "1",  
"\_score": 0.023666047,  
"\_source": {}  
},  
{  
"\_index": "my\_index",  
"\_id": "2",  
"\_score": 0.023666047,  
"\_source": {}  
},

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [August 15, 2024, 10:07am UTC](https://discuss.elastic.co/t/elastic-search-is-giving-same-score-for-all-parent-document-which-has-nested-documents/364931/2 "2024-08-15T10:07:32Z")

</div>

It's because you are matching only on Id.  
The filter part only excludes what is not matching the filter without any effect on the score.  
If you want to change that, put everything in the must part.

---

<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:** [August 15, 2024, 8:24pm UTC](https://discuss.elastic.co/t/elastic-search-is-giving-same-score-for-all-parent-document-which-has-nested-documents/364931/3 "2024-08-15T20:24:27Z")

</div>

Thank you so much for your reply. Its working now.
