第一节点弹性搜索中的父规范 [英] Parent specification in elasticsearch for first node

查看:154
本文介绍了第一节点弹性搜索中的父规范的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用_bulk api来索引我的数据。除了第一个文件,我有一个除了第一个文件之外的每个文档的父域。

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.

我应该将父字段留空?

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

或者我不应该包含父字段?

Or should I not include the parent field at all?

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


推荐答案

您根本不要在第一个文档中包含 parent 所有其他文件的文件。

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.

这篇关于第一节点弹性搜索中的父规范的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆