0

I am uploading data to elasticSearch using batch process. I am getting data once in a day from third party which need to be uploaded in elasticSearch.

My question is can I maintain past, current & future version of index in elasticSearch?

Below are the thinking: If Batch process is success : 1.Upload the data in future version of index. 2.Copy the data of current version of index to past. 3.Copy future version of index data to current version.

If Batch process is fail: 1.Do nothing and continue with the current version of index.

Can anyone please help me with this?

1 Answer 1

0

This is usually done with aliases. E.g.

Alias pointing to working yesterday's index:

working_index -> index_2016_12_01

Create new index_2016_12_02, upload data, if everything is ok switch alias (Alias API allows transactional changes.)

working_index -> index_2016_12_02

Then you can archive or delete or just leave untouched the old index

Always perform all the queries against alias instead of real index name.

2
  • Thanks for the suggestion...can you please share the sample search query which will refer alias instead of index Jun 23, 2016 at 16:43
  • you can literally use alias name instead of index name.
    – xeye
    Jun 23, 2016 at 19:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.