Elasticsearch Reindex
If you use Elasticsearch as search engine for yuuvis® Momentum, find here a reindex example procedure.
Table of Contents
Introduction
In case new requirements, either in terms of load capacity or functionality (e.g., new supported languages), are introduced to a yuuvis® Momentum system during production, it may become necessary to overhaul the backend Elasticsearch cluster by performing a reindex operation. The operation itself is slow and requires a lot of resources, as it essentially creates a copy of the original Elasticsearch index within the same Elasticsearch cluster, to make sure enough storage space is available and to optionally create more data nodes which can be shut down after the operation.
An Elasticsearch reindex entails the creation of a new Momentum-capable index, the migration of Elasticsearch data from the original index into said new index, and finally the removal of the old index. These steps are achieved by interaction with the Elasticsearch API, which is exposed by Elasticsearch through port 9200 on selected master nodes. It is highly recommended to create an Elasticsearch snapshot using the same API before attempting the reindex.
Below, you can find a detailed overview of the CURL commands needed to successfully perform a reindex in yuuvis® Momentum. Note that all commands assume you have port-forwarded the ElasticSearch API to http:\\localhost:9200.
Creating a Momentum-Capable Elasticsearch Index
Two steps are required to create an Elasticsearch index that can interact with yuuvis® Momentum:
- Creation of a new Elasticsearch index, and
Applying yuuvis® Momentum Elasticsearch index mapping and settings
Creating a new Elasticsearch Index
A new index needs to be created to match the specifications of the new requirements.
Applying yuuvis® Momentum Elasticsearch Index Mapping and Settings
The yuuvis® Momentum services require Elasticsearch to use a custom mapping. Using Elasticsearch's automatic mapping algorithm for reindexing renders the new index unusable for the yuuvis® Momentum system.
Migrating the Data to the new Index
Once a compatible index has been created, the reindex operation can be triggered through the Elasticsearch API.
After the reindex is completed, the new index must be activated by reassigning the yuuvis
alias.
Deleting the Original Index
To free up space in the Elasticsearch cluster, it is sensible to remove the original index after verifying the yuuvis® Momentum system has accepted the new index.