Elastic Search: Parent child vs Nested Document Elastic Search: Parent child vs Nested Document elasticsearch elasticsearch

Elastic Search: Parent child vs Nested Document


How many nested documents/array size i can save in one field

By default, you can have a maximum of 50 nested fields defined per index. In each of those nested fields arrays, you may store any number of elements.

We have to manipulate the fields often so whats the recommendation if we use nested field type

That's where nested fields come short, as whenever a nested document changes, you either have to reindex the whole parent document or figure out via scripting which nested document to update, but it can quickly get quite convoluted.

What are the limitations of Parent/child if we use 4 types of relations

In ES 6.x onwards, you're limited to a single join field per index.

As it looks like, it doesn't seem like either nested fields nor parent/child would work well in your case... Maybe there's another possible design if you are willing to denormalize a little bit more your data, but hard to say without getting more detailed information about your preceise use case.

Choosing Parent/Child vs Nested Document