Is it possible to sort by values of different children?

We already managed to sort the parent by values of a single child using this workaround (https://www.elastic.co/guide/en/elasticsearch/reference/6.2/query-dsl-has-child-query.html#_sorting).
Now we want to sort the parent entries by values of 2 different child types as follows:

parent_score = value_of_child_1 / value_of_child_2

Is it be possible to temporarily store the values of the children (maybe via painless scripts) and use them both in a function_score query later?

We know that storing the pre-calculated values of the children in a new child type would solve this. But this is a bad solution for our use-case, as it introduces a big synchronization and management overhead on the application side.

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