Parent specification in elasticsearch for first no

2019-09-09 16:50发布

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条回答
老娘就宠你
2楼-- · 2019-09-09 17:12

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.

查看更多
登录 后发表回答