Index-Switch


(Animesh Singh) #1

Can anyone help me with switching of indexes with reindexing old one without loosing new data that is indexed on old index during the time of reindexing .


(Byron Voorbach) #2

Could you be a bit more elaborate? :slight_smile:


(Animesh Singh) #3

ok , let explain the problem
i have millions of documents that have been indexed are more come every minute and according to need i have to change templates time to time and have to reindex whole lot of documents again , now problem arises when new documents are indexed in old index during the time of re-indexing , that lot is lost .
How to sync both the index and then discard old one ?
suggest any solutions?


(Mark Walkom) #4

Have a write index and a read index. The write index points to the active index and the read index covers both the active and old index.

Then in your code you will need to use the read index to query, and then deal with any duplicates in queries.


(Animesh Singh) #5

Sorry , but i could not get what you are suggesting , please explain more


(Animesh Singh) #6

Yes i got what are you suggesting , but can you tell me how get the timestamp of last update of document so that i can re-index in my new index and then discard the old one


(Mark Walkom) #7

Do you have a timestamp in the document you can use for this?


(Animesh Singh) #8

No i don't have time stamp in my ES , i am enquiring is there any timestamp field that is managed my elastic search only because if i give value of timestamp from application , due to network delay values will not be reflected correct and if es server give me i can manage it more efficiently


(Mark Walkom) #9

You will need to add that then.


(system) #10

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.