Creating a REST plugin

The previous recipe described how to set up a working environment and the steps required to build a native plugin. In this recipe, we will see how to create one of the most common ElasticSearch plugins: the REST plugin.

This kind of plugin allows you to extend the standard REST calls with custom ones to easily improve the capabilities of ElasticSearch.

In this recipe, we will see how to define a REST entry point and create its action. In the next recipe, we will see how to execute this action and distribute it in shards.

Getting ready

You will need a working ElasticSearch node, a Maven build tool, and an optional Java IDE. The code of this recipe is available in the chapter12/rest_plugin directory in the code bundle of the same ...

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.