# How do I make the score calculation of nested hits independend of the amount of nested docs?

**URL:** <https://discuss.elastic.co/t/how-do-i-make-the-score-calculation-of-nested-hits-independend-of-the-amount-of-nested-docs/165249>\
**Category:** Elasticsearch\
**Created:** [January 22, 2019, 2:08pm UTC](https://discuss.elastic.co/t/how-do-i-make-the-score-calculation-of-nested-hits-independend-of-the-amount-of-nested-docs/165249 "2019-01-22T14:08:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![randel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/randel/32/2541_2.png) [@randel](https://discuss.elastic.co/u/randel)\
**Post date:** [January 22, 2019, 2:08pm UTC](https://discuss.elastic.co/t/how-do-i-make-the-score-calculation-of-nested-hits-independend-of-the-amount-of-nested-docs/165249/1 "2019-01-22T14:08:40Z")

</div>

Using `GET /my_index/_doc/2416/_explain` to see how the score is calculated, I found out that the calculation depends on the amount of nested docs of a parent. The more nested docs, the lower the score of the hit. I use `"score_mode": "max"` as the nested score mode.

How can I make the score calculation independent of the amount of nested docs?

---

<div class="post-metadata">

**Author:** ![randel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/randel/32/2541_2.png) [@randel](https://discuss.elastic.co/u/randel)\
**Post date:** [January 24, 2019, 2:05pm UTC](https://discuss.elastic.co/t/how-do-i-make-the-score-calculation-of-nested-hits-independend-of-the-amount-of-nested-docs/165249/2 "2019-01-24T14:05:43Z")

</div>

I got around it using a Constant Score Query.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 21, 2019, 2:05pm UTC](https://discuss.elastic.co/t/how-do-i-make-the-score-calculation-of-nested-hits-independend-of-the-amount-of-nested-docs/165249/3 "2019-02-21T14:05:47Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
