0

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"}}
Amriteya
  • 1,118
  • 15
  • 37

1 Answers1

1

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.

Val
  • 207,596
  • 13
  • 358
  • 360
  • I am using bulk api. Creating a string in Java. Persisting that string using bulki api. But it is giving 400 error. – Amriteya Mar 16 '16 at 07:47
  • Please show a relevant part of your bulk query and the error you're getting. – Val Mar 16 '16 at 07:50
  • http://stackoverflow.com/questions/36030795/elasticsearch-bulk-api-returning-400-error-in-java – Amriteya Mar 16 '16 at 08:57