Creating an analyzer plugin
Elasticsearch provides a large set of analyzers and tokenizers to cover general needs out of the box. Sometimes, we need to extend the capabilities of Elasticsearch by adding new analyzers.
Typically, you can create an analyzer plugin when you need to do the following:
- Add standard Lucene analyzers/tokenizers that are not provided by Elasticsearch.
- Integrate third-party analyzers.
- Add custom analyzers.
In this recipe, we will add a new custom English analyzer, similar to the one provided by Elasticsearch.
Getting ready
You need an up and running Elasticsearch installation, as we described in the Downloading and installing Elasticsearch recipe in Chapter 1, Getting Started.
Gradle or an integrated development environment (IDE) that supports Java programming with Gradle (version 7.3.x used in the examples), such as Eclipse, Visual Studio Code, or IntelliJ IDEA, is required. Java JDK 17 or above needs to be installed.
The...