# Which query type can give you an average score of the sub-queries?

**URL:** <https://discuss.elastic.co/t/which-query-type-can-give-you-an-average-score-of-the-sub-queries/148764>\
**Category:** Elasticsearch\
**Created:** [September 17, 2018, 6:19am UTC](https://discuss.elastic.co/t/which-query-type-can-give-you-an-average-score-of-the-sub-queries/148764 "2018-09-17T06:19:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![NewHere](https://avatars.discourse-cdn.com/v4/letter/n/5e9695/32.png) [@NewHere](https://discuss.elastic.co/u/NewHere)\
**Post date:** [September 17, 2018, 6:19am UTC](https://discuss.elastic.co/t/which-query-type-can-give-you-an-average-score-of-the-sub-queries/148764/1 "2018-09-17T06:19:40Z")

</div>

Say I have a bunch of sub-queries, using bool query "should" I can get the sum of each matched query score into the final score. How do I get an average score instead of sum? e.g.:

```
{"query":{"bool":{"should":[{sub-query scored 2},{sub-query scored 8}]}}}

```

Instead of getting 10 for this document, I want to see a final score of `(2+8)/2 = 5`.

Thank you.

---

<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:** [October 15, 2018, 6:19am UTC](https://discuss.elastic.co/t/which-query-type-can-give-you-an-average-score-of-the-sub-queries/148764/2 "2018-10-15T06:19:47Z")

</div>

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