Parent specification in elasticsearch for first node

纵饮孤独 提交于 2019-12-12 04:05:24

问题


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:


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.



来源:https://stackoverflow.com/questions/36029148/parent-specification-in-elasticsearch-for-first-node

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!