Slow parent/child relationship queries

any idea why query below is executing in around 5s:

POST //_search
"query": {
"has_child": {
"type": "",
"query": {
"has_child": {
"type": "<CHILD_SCORE>",
"query": {
"range": {
"score": {
"gt" : 0

it is very simplified version of my production query, but it highlights the

context of my query:

  • 6 node cluster
  • index with 12 shards and 2 replicas
  • 8m of parent documents
  • 13m of child documents
  • 13m of child_score documents
  • child and child_score documents are related 1-1
  • every parent can have up to 6 children
  • 30GB heap size (20% used by id_cache)

looks like every level of parent/child relationship is making the query run
slower by the factor of 10
(changing it to use filters instead of queries is not changing execution
time significantly)

i tried to use top_children query, but it is not really fitting my purpose
(for my production query) as the final score of the query is computed on
every level of parent child relationship

any suggestions what im doing wrong here (besides using parent/child
relationships) ?

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