In the previous recipe, we saw the has_child query. Elasticsearch provides a query to search child documents based on the parent query, has_parent.
Using the has_parent query
Getting ready
You need an up and running Elasticsearch installation, as we described in the Downloading and installing Elasticsearch recipe in Chapter 1, Getting Started.
To execute these commands, I suggest using the Kibana console, as this provides code completion and better character escaping for Elasticsearch.
To correctly execute the following commands, you will need an index populated with the ch04/populate_kibana.txt commands, which is available in the online code. The index that's used in this recipe is ...