Has Child Query

The has_child query works the same as the has_child filter, by automatically wrapping the filter with a constant_score. It has the same syntax as the has_child filter:

{
    "has_child" : {
        "type" : "blog_tag"
        "query" : {
            "term" : {
                "tag" : "something"
            }
        }
    }
}

Scope

A _scope can be defined on the filter allowing to run facets on the same scope name that will work against the child documents. For example:

{
    "has_child" : {
        "_scope" : "my_scope",
        "type" : "blog_tag"
        "query" : {
            "term" : {
                "tag" : "something"
            }
        }
    }
}

Memory Considerations

With the current implementation, all _id values are loaded to memory (heap) in order to support fast lookups, so make sure there is enough mem for it.

Table Of Contents

Previous topic

Fuzzy Query

Next topic

Ids Query

This Page