elasticsearch - ElasticSearch 快照/恢复功能是否会导致在恢复期间再次分析数据?

标签 elasticsearch

我的 ElasticSearch 索引中有大量数据。我更改了 default analyzer对于索引,因此基本上我需要重新索引我的数据,以便使用新的分析器再次对其进行分析。因此,与其创建一个测试脚本来删除 ES 索引中的所有现有数据并重新添加我认为是否有可以使用的备份/恢复模块的数据。作为其中的一部分,我找到了 ES 支持的快照/恢复模块 - ElasticSearch-SnapshotAndRestore .

我的问题是——如果我使用上面的 ES 快照/恢复模块,它真的会导致数据被重新分析吗?由于我更改了默认分析器,因此我需要重新分析数据。如果没有,您是否会建议使用其他工具/模块来实现数据的纯导出和导入,从而导致在导入期间重新分析数据?

开发用户

最佳答案

不,它不会重新分析数据。您将需要重新索引您的数据。

幸运的是,这对 Elasticsearch 来说相当简单,因为它默认存储文档的来源:

Reindexing your data

While you can add new types to an index, or add new fields to a type, you can’t add new analyzers or make changes to existing fields. If you were to do so, the data that has already been indexed would be incorrect and your searches would no longer work as expected.

The simplest way to apply these changes to your existing data is just to reindex: create a new index with the new settings and copy all of your documents from the old index to the new index.

One of the advantages of the _source field is that you already have the whole document available to you in Elasticsearch itself. You don’t have to rebuild your index from the database, which is usually much slower.

To reindex all of the documents from the old index efficiently, use scan & scroll to retrieve batches of documents from the old index, and the bulk API to push them into the new index.



http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/reindex.html

在采用这种方法之前,我已经阅读了 Scan and Scroll :

http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/scan-scroll.html

TaskRabbit 开源了一个导入/导出工具,但我没用过,所以不能推荐,但值得一看:

https://github.com/taskrabbit/elasticsearch-dump

关于elasticsearch - ElasticSearch 快照/恢复功能是否会导致在恢复期间再次分析数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24940210/

相关文章:

elasticsearch - 在 Elasticsearch 中对字符串进行排序

elasticsearch - elasticsearch重新索引。选择嵌套字段

geolocation - ElasticSearch 中的地理排序和距离计算不起作用

elasticsearch - 仅显示匹配的工作日

elasticsearch - Elasticsearch中是否有任何默认方式来保存搜索

elasticsearch - 如何在 Elasticsearch 中避免或最小化具有 3 个节点的裂脑

node.js - ElasticSearch JS查询返回所有文档而不是过滤

apache-spark - Spark Elasticsearch基本调整

elasticsearch - elasticsearch嵌套聚合总值

c# - 使用 NEST 索引动态对象