indexing - 向现有文档 elasticsearch 添加附加属性

标签 indexing elasticsearch document updating

如何向 Elasticsearch 索引中的现有文档添加附加属性。

$ curl -XPUT 'http://localhost:9200/twitter/tweet/1' -d '{
"user" : "kimchy",
"post_date" : "2009-11-15T14:12:12",
"message" : "trying out Elastic Search"
}'

这将在索引中创建一个文档。如何向文档添加属性? 假设

"new_attribute":"new_value"

这会将文档修改为

"user" : "kimchy",
"post_date" : "2009-11-15T14:12:12",
"message" : "trying out Elastic Search"
"new_attribute" :"new_value"

最佳答案

我认为更新 api 是可能的。 检查这个:

https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html#_update_part_of_a_document

并向下滚动到“向文档添加新字段”。

问候

关于indexing - 向现有文档 elasticsearch 添加附加属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18466773/

相关文章:

elasticsearch - 以零停机时间重新启动 2 节点 elasticsearch 集群

iphone - UIDocumentInteractionController 的奇怪问题

c# - 如何使用 C# 将表格粘贴到 Ms-Word 文档的末尾

google-app-engine - 在 GAE 的大表中索引 "explode"的速度是多少?

ruby-on-rails - 如何在 attr_encrypted 数据库字段上添加索引?

indexing - 地理空间索引如何工作?

mysql - 具有大量表的数据库的elasticsearch中的数据摄取

elasticsearch - Elasticsearch Reindex是否将旧数据保留在目的地

cocoa - "com.apple"自定义文件格式的 UTI

Python:按索引过滤列表