# Factor aggregate score on child collection into query on parent

**URL:** <https://discuss.elastic.co/t/factor-aggregate-score-on-child-collection-into-query-on-parent/196757>\
**Category:** Elasticsearch\
**Created:** [August 26, 2019, 11:49am UTC](https://discuss.elastic.co/t/factor-aggregate-score-on-child-collection-into-query-on-parent/196757 "2019-08-26T11:49:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shertu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shertu/32/53021_2.png) [@shertu](https://discuss.elastic.co/u/shertu)\
**Post date:** [August 26, 2019, 11:49am UTC](https://discuss.elastic.co/t/factor-aggregate-score-on-child-collection-into-query-on-parent/196757/1 "2019-08-26T11:49:10Z")

</div>

I want to create a search system where a user's search is analyzed against similar searches. Here is an example of the data in my system:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/8/a85000b85e73e8d4b604f492d0f66e16b6af0446.png)

Each document in my system contains a list of events wherein the document was read - typically after the user entered in a search query.

I want to perform a query on all the elements in this "postReadEventCollection" for each post, and then sum the results, and factor the sum into a query on the document.

How do I go about doing this?

---

<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:** [September 23, 2019, 11:49am UTC](https://discuss.elastic.co/t/factor-aggregate-score-on-child-collection-into-query-on-parent/196757/2 "2019-09-23T11:49:12Z")

</div>

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