Reputation: 914
I've to change the format of elasticseach document id, I was wondering if its possible without deleting and re-indexing all the documents.
Upvotes: 2
Views: 1350
Reputation: 2861
Yes, You can do it via fetching the data and Re-Indexing it. But in case you have GB's of data you should Run it like a long term Job.
So, you can do like, Fetch the old format Documents Id's of the indexed data and store/index in the new storage such as Cassandra, MongoDB or even in the SQL(As such your application need) by mapping the new format ID to that older one and when you fetch it and while using or on the displaying the data replace that with the mapped newer ID.
Upvotes: 0
Reputation: 1479
You have to reindex. The simplest way to apply these changes to your existing data is: create a new index with the new settings and copy all of your documents from the old index to the new index with bulk-api, see: http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/reindex.html
Upvotes: 2