# Combining information from parent and child for scoring

**URL:** <https://discuss.elastic.co/t/combining-information-from-parent-and-child-for-scoring/56635>\
**Category:** Elasticsearch\
**Created:** [July 28, 2016, 2:16pm UTC](https://discuss.elastic.co/t/combining-information-from-parent-and-child-for-scoring/56635 "2016-07-28T14:16:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stefan\_Henzen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stefan_henzen/32/11103_2.png) [@Stefan\_Henzen](https://discuss.elastic.co/u/Stefan_Henzen)\
**Post date:** [July 28, 2016, 2:16pm UTC](https://discuss.elastic.co/t/combining-information-from-parent-and-child-for-scoring/56635/1 "2016-07-28T14:16:07Z")

</div>

Hi,

When searching for a child document, I find myself wanting to combine information in the parent and the child document using a script. Is there a way to do that?

The scoring script basically runs on the information in the parent document, and uses one small piece of information from the child document as a parameter. Very very simplified it looks like this:

```
parent: {
  price_rules: {
    foo: {bar: 10, ...}
    ...
  }
}

child: {
  base_price: 10
}

```

I need the price per child, based on the price rules of the parent & some params applied to the base price of the child.

Alternatively I can denormalize the parent into the child. Is there an efficient way to do this? i.e. server-side? since the children update often and the parent rarely.

Tnx!

---

<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:** [July 5, 2017, 10:32pm UTC](https://discuss.elastic.co/t/combining-information-from-parent-and-child-for-scoring/56635/2 "2017-07-05T22:32:02Z")

</div>


