Reindexing with a script
Reindexing is a functionality for automatically copying your data into a new index. This action is often done to cover different scenarios, as follows:
- Reindexing after a mapping change
- Removing a field from an index
- Adding new fields based on a function
Getting ready
You will need an up-and-running Elasticsearch installation, similar to the one that we described in the Downloading and installing Elasticsearch recipe in Chapter 1, Getting Started.
To execute curl
using the command line, you will need to install curl
for your operating system.
In order to correctly execute the following commands, you will need an index that is populated with the ch07/populate_aggregation.txt
script (available in the online code), and the JavaScript or Python language scripting plugins installed.
How to do it...
For reindexing with a script, we will perform the following steps:
- Create the destination index, as this is not created...