Combining information from parent and child for scoring


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.