简体   繁体   中英

What happens if I write data to an Elasticsearch index when an reindex is occuring

Lets say I'm copying data from index A to index B via Elasticsearch's Reindex API and the reindex operation takes 5 minutes. If during this 5 minute window I write a new document into index A. Will that document be copied as part of the reindex operation?

The short answer is NO.

The first time you run reindex operation ES will create a PIT(Point in time) and will move all documents until that time to the new index. To solve the problem you can flag new documents with specific property and then reindex them to the new index.

The better solution would be to use zero-downtime reindex approach using aliases for this approach you would create read and write alises you will write to the new index and read from both indices and then you can use clopse operation to filter result that are already indexed. For more information you can check this blog post here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM