Search code examples
elasticsearchswisscomdev

Reindex on elasticsearch v2.1.0 on Swisscom Application Cloud


I want to reindex data from an existing index on the Swisscom Application Cloud to a new one (have to make adjustments to the mapping). I saw that from version 2.3.0 on there is a reindex API. But since the elasticsearch version on the appcloud is 2.1.0, i have no clue how to reindex my data. Do you have any suggestions how to proceed? And will there be an elasticsearch upgrade in the near future?


Solution

  • Document in elasticsearch are immutable. Reindexing a document consist of the following steps:

    • Retrieve the JSON (that you want to reindex)
    • Change it
    • Delete the old document
    • Index a new document

    In your case you want to reindex your whole index, so I suggest that you use the scan API to retrieve all your old document and reindex it into your new index: Scan API documentation for reindexing.