Indexing Hierarchical Couchbase Documents

From the example documents you supplied there's no indication that doc 2 should be related to doc 1.

You have 3 options :

  • Collapse all source docs into a single "flat" JSON doc
  • Collapse all source docs into a single "nested" JSON doc [1]
  • Store parent and child source docs separately but relate them when you add them [2]

The decision process for why you would choose one approach over another is roughly this:

I'm unfamiliar with the couchbase plugin and to what extent it can be made to work with elasticsearch's parent/child indexing API.

[1] https://www.elastic.co/guide/en/elasticsearch/guide/2.x/nested-objects.html
[2] https://www.elastic.co/guide/en/elasticsearch/guide/2.x/parent-child.html

1 Like