| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 | [[query-dsl-has-parent-query]]=== Has Parent QueryThe `has_parent` query works the same as the<<query-dsl-has-parent-filter,has_parent>>filter, by automatically wrapping the filter with a constant_score (whenusing the default score type). It has the same syntax as the<<query-dsl-has-parent-filter,has_parent>>filter. [source,js]--------------------------------------------------{    "has_parent" : {        "parent_type" : "blog",        "query" : {            "term" : {                "tag" : "something"            }        }    }}--------------------------------------------------[float]==== Scoring capabilitiesThe `has_parent` also has scoring support. Thesupported score types are `score` or `none`. The default is `none` andthis ignores the score from the parent document. The score is in thiscase equal to the boost on the `has_parent` query (Defaults to 1). Ifthe score type is set to `score`, then the score of the matching parentdocument is aggregated into the child documents belonging to thematching parent document. The score type can be specified with the`score_type` field inside the `has_parent` query:[source,js]--------------------------------------------------{    "has_parent" : {        "parent_type" : "blog",        "score_type" : "score",        "query" : {            "term" : {                "tag" : "something"            }        }    }}--------------------------------------------------[float]==== Memory ConsiderationsWith the current implementation, all `_id` values are loaded to memory(heap) in order to support fast lookups, so make sure there is enoughmemory for it.
 |