Parent specification in elasticsearch for first node

64 views Asked by At

I am using the _bulk api for indexing my data. I have a parent field for every document except the first document.

Normally my documents will have the following meta-data:

{"index":{"_id":"11111", "parent": "00000"}}

What should I specify in the parent field for the first document.

Should I leave the parent field blank?

{"index":{"_id":"00000", "parent": ""}}

Or should I not include the parent field at all?

{"index":{"_id":"00000"}}
1

There are 1 answers

3
Val On BEST ANSWER

You simply don't include the parent property at all in your first document, which should act as the parent document for all other documents.