
Elasticsearch 8.x Cookbook
By :

In the previous recipe, we saw the has_child
query. Elasticsearch also provides a query to search child documents based on the parent query, has_parent
, which complements the previous query.
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 are available in the online code. The index that's used in this recipe is mybooks-join
.
To execute the has_parent
query, we will perform the following steps:
author
) of the parent (book
) that has the bill
term in...