简体   繁体   English

在 elasticsearch 中重新索引后,原始索引中的数据会发生什么变化?

[英]What happens to the data in the original index after reindexing in elasticsearch?

In an elasticsearch instance, I have data in an index "a".在 elasticsearch 实例中,我在索引“a”中有数据。 I want to copy all data within a period (say Aug 2021 to September 2021) to another index "b".我想将一段时间内(例如 2021 年 8 月至 2021 年 9 月)内的所有数据复制到另一个索引“b”。 I apply reindex in the following manner:我以下列方式应用重新索引:

POST _reindex
{
    "source": {
        "index": "a",
            "query": {
                    "range": {
                        "created": {
                            "gte": "2021-08-01 00:00:00.000",
                            "lt": "2021-09-01 00:00:00.000"
                            }
                        }
                    }
        },
    "dest": {
            "index": "b"
        }  
}

Now, if I decide to delete the index "b", what happens to the data that I just moved?现在,如果我决定删除索引“b”,我刚刚移动的数据会发生什么? Does it still stay in index "a"?它仍然停留在索引“a”中吗?

Yes, the reindex operation leaves the source index untouched.是的,重新索引操作使源索引保持不变。 After the reindex is done, you have two indexes a and b and you can decide to do whatever you want with them.重新索引完成后,您有两个索引ab ,您可以决定对它们做任何您想做的事情。

If you're happy with the data in index b you can decide to remove index a , if you're not, you can delete b , keep a and re-attempt another reindex.如果您对索引b中的数据感到满意,您可以决定删除索引a ,如果不满意,您可以删除b ,保留a并重新尝试另一个重新索引。

It's up to you to do whatever you want.做任何你想做的事都取决于你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Elasticsearch中为索引重新索引-ELK - Reindexing a index in elasticsearch - ELK elasticsearch:重新索引索引 - elasticsearch: reindexing an index ElasticSearch的重新索引编制API完成后,目标索引的状态是什么? - What is the state of my destination index after ElasticSearch's reindexing api completes? 如果我在发生重新索引时将数据写入 Elasticsearch 索引会发生什么 - What happens if I write data to an Elasticsearch index when an reindex is occuring 在 Elasticsearch 中克隆和重新索引索引有什么区别? - What's the difference between cloning and reindexing an index in Elasticsearch? 在elasticsearch中重新索引期间,小写索引中的所有字段 - Lowercase all fields in an index during reindexing in elasticsearch 使用父子关系重新索引Elasticsearch索引 - Reindexing Elasticsearch index with parent and child relationship Elasticsearch-重新索引相同的索引名称 - Elasticsearch--reindexing to the same index name 如果logstash将数据发送到elasticsearch的速度快于索引速度,会发生什么? - What happens if logstash sends data to elasticsearch at a rate faster than it can index? 如果在索引已经运行的情况下运行ElasticSearch索引会发生什么? - What happens if you run ElasticSearch index while index is already running?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM