Creating an analyzer plugin

ElasticSearch provides, out-of-the-box, a large set of analyzers and tokenizers to cover general needs. Sometimes, we need to extend the capabilities of ElasticSearch to add new analyzers. Typically, you need to create an analyzer plugin when you need to do the following:

  • Adding standard Lucene analyzers/tokenizers, which are not provided by ElasticSearch
  • Integrating third party analyzers
  • Adding a custom analyzer

In this recipe, we will add a new custom English analyzer similar to the one provided by ElasticSearch.

Getting ready

You will need a working ElasticSearch node, a Maven build tool, and optionally a Java IDE. The code of this recipe is available in the chapter12/analysis_plugin directory.

How to do it...

An analyzer ...

Get ElasticSearch Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.