Book Image

ElasticSearch Cookbook

By : Alberto Paro
Book Image

ElasticSearch Cookbook

By: Alberto Paro

Overview of this book

Table of Contents (20 chapters)
ElasticSearch Cookbook Second Edition
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Creating a native plugin


In the previous recipe, we saw the site plugin. ElasticSearch also allows you to create a more powerful type of plugin, the: native JAR plugins.

Native plugins allow you to extend several aspects of the ElasticSearch server, but this requires a good knowledge of Java. Because these plugins are compiled through the JVM bytecode, they are generally very fast. In this recipe, we will see how to set up a working environment in order to develop native plugins.

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/simple_plugin directory, kept in the code bundle of the chapter on the Packt Publishing website.

How to do it...

Generally, ElasticSearch plugins are developed in Java using the Maven build tool and deployed as a ZIP file. In order to create a simple JAR plugin, perform the following steps:

  1. To correctly build and serve a plugin, the following files must be defined...