Book Image

ElasticSearch Blueprints

Book Image

ElasticSearch Blueprints

Overview of this book

Table of Contents (15 chapters)
Elasticsearch Blueprints
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Limitations on a query on nested fields


There are some limitations to the nested object type. In the simple inner object type, each nested JSON object is treated independently. However, the act of defining the mapping for inner objects as a nested type lets you overcome this drawback. Also, the use of nested types has its disadvantages, which we are about to see:

  • Nested types are updation unfriendly. Updating the parent element information or child element information means that you need to reindex the whole document. Hence, if a new student is admitted to a school or when a new student leaves the school, the entire document has to be reindexed, along with the information of other students and the school. Remember, updating a document is nothing but a soft deletion and addition of documents under the hood.

  • You can't retrieve the nested object alone. Say you need to get information of a single student; this is not possible in this approach. You need to get the entire source of the document...