每当我更新文档时,Elasticsearch会自动为文档重新编制索引吗 [英] Does Elasticsearch reindex the documents automatically each time I update them

查看:56
本文介绍了每当我更新文档时,Elasticsearch会自动为文档重新编制索引吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个社交模型,用户可以在其中喜欢照片.

I have a social model where users can like photos.

我的照片文档如下:

{
"id" : ... //Indexed
"url": ...
"likes": .. //Not indexed
//Other properties
}

我的问题是,只要照片得到其他用户的喜欢,我就必须更新我的文档.这次更新是否会使Elasticsearch自动为其重新建立索引(知道"likes"属性未在我的映射中建立索引)还是仅在我的索引属性已更改的情况下才完成?

My question is, as long as a photo gets likes from other users I have to update my document. Does this update make elasticsearch automatically reindex it (knowing that the "likes" property is NOT indexed in my mapping) or it's done only if my indexed properties have changed?

我关心的是这里的表现.

My concern is performance here.

推荐答案

elasticsearch中的文档是不可变的.更新文档始终是重新索引,并且包括以下步骤:

Document in elasticsearch are immutable. Updating a document is always a reindexing and it consist of the following steps:

  • 获取JSON(您要重新索引)
  • 更改
  • 删除旧文档
  • 索引新文档

Elasticsearch文档

这篇关于每当我更新文档时,Elasticsearch会自动为文档重新编制索引吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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