Reindexing a document with index aliases

(Vasco) #1

My understanding thus far is that aliases and time based templating are an essential part of managing your indexes in the long term. But what isn't exactly clear to me is how I should deal with reindexing documents when my indexes are aliased.

Without aliases reindexing is trivial; just issue an index command using the document's id is enough. As I understand it, uid's in ES's index are unique within an index, but not within the scope of an alias (right?). Working on this assumption that means that in order to reindex a document I would have to do an ids search using the alias to find the index it is in, then delete the document using the actual index, and only then issue an index command on the most recent aliased index to reindex the document. Having to do this for every document I need to index seems like it would be a drawback of using aliases. So I am hoping there is a better way to go about re-indexing docs.

(Mark Walkom) #2

Generally using scroll and scan is the best idea when working across an index, but you will want to do it against the index rather than the alias just to be explicit.

(system) #3