Elasticsearch-维护文档历史记录 [英] Elasticsearch - Maintaining Document History

查看:97
本文介绍了Elasticsearch-维护文档历史记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Elasticsearch的新手,要问一个非常基本的问题;

I am new to Elasticsearch with a very basic question to ask;

我打算将Elasticsearch用作文档存储并存储文档,这是要求之一我也必须维护历史数据。

I am planning to use Elasticsearch as a document store and with storing documents, one of the requirements I have is to maintain historical data as well.

因此,我可以成功地将文档发布到Elasticsearch,但是当我发布同一文档的更新版本时-看到-原始副本被覆盖。我需要做的是让Elasticsearch保留旧的副本,以及应该可以通过指定版本号来访问的旧副本。

So I can post documents to Elasticsearch successfully, but when I post an updated version of the same document - as I've seen - original copy is overwritten. What I need is to have Elasticsearch keep older copies stored as well which I should be able to access via specifying a version number.

我已经查看了其对文档的本机支持版本控制对并发控制非常有用,但是看起来并没有保留以前版本的历史,只有最新版本可用。

I have looked at its native support for document versioning which works great for concurrency control but doesn't look like it keeps a history of previous versions and only the latest version is available.

有人可以在右边指导我吗

Could someone guide me in the right direction here please.

推荐答案

此处 ES不存储较早的版本。

As stated in here ES do not store older versions.


请注意,Elasticsearch不存储旧版本的文档。只能检索当前版本的

Note that Elasticsearch do not store older versions of documents. Only the current version can be retrieved.

您应将历史记录存储在单独的索引中。并在每次更新原始文档索引时将其插入历史索引。

You should store the history in a separate index. And insert into the history index on every update to the original document index.

这篇关于Elasticsearch-维护文档历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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