Re: Counts of children in parent/child data


Sounds like you want to query the parents and then score/rank them by the
sum of the userScore values of their corresponding children. You can try
something like this:

POST http://localhost:9200//_search
"query": {
"has_child": {
"type": "",
"score_type": "sum",
"query": {
"function_score": {
"script_score": {
"script": "doc['.userScore'].value"
"boost_mode": "replace"

You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
For more options, visit