Using a parent-child approach

A parent-child datatype is yet another alternative to establish relational data. In the parent-child approach, we establish the parent-child relation during index time. In a map reduce or sharded architecture, it's not possible for a map or shard to communicate with each other. The work has to be done independently by each shard. Keeping that in mind, relational data can't be maintained as a cross shard, which means I can't have the school information document in one shard and student information in another.

Hence, to establish a parent-child relation, it's required that the parent and child documents be in the same shard. Let's first see how to index parent and child documents and then how this rule is imposed.

Let's ...

Get Elasticsearch Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.