One other alternative option that might work for you is to flatten the data structure of your nested documents before indexing them into Elasticsearch. The method of how the data is flattened is up to you, but you can maintain a reference of flattened documents to the original nested document using the the join
field.
See: https://www.elastic.co/guide/en/elasticsearch/reference/current/parent-join.html
Elasticsearch also provides a flattened
data type that can be used to flatten the data. Using that, a nested object will be mapped as a single field. To visualize fields mapped as flattened
, you can use Runtime Fields to define fields you need for specific use.
For more on the flattened
type and Runtime Fields, see: