B.1. Working with plugins

Plugins are split into two categories: site plugins and code plugins. A site plugin is one that provides no

additional functionality; it simply provides a web page served by Elasticsearch. Some examples of site plugins are the elasticsearch-head plugin, elasticsearch-kopf, bigdesk,

elasticsearch-hq, and whatson. For example, you may remember the screenshot from chapter 2 shown in figure B.1, showing shards allocated on two different nodes on the kopf plugin.

Figure B.1. Example of the kopf plugin

You can see in the figure that the kopf plugin shows information about the Elasticsearch cluster; Elasticsearch isn’t running any different code and hasn’t had any behavior on the server changed at all. The alternative to this is a code plugin.

A code plugin is any plugin that includes JVM code that Elasticsearch executes; this can include plugins that add features to Elasticsearch such as the AWS plugin, used to add the ability to snapshot indices to Amazon S3, as well as plugins like the ICU analysis plugin, which is used to better handle languagespecific characteristics of text during analysis. There are even plugins that replace internal parts of Elasticsearch such as the shard distributor and discovery mechanisms.

Some examples of code plugins are the elasticsearch-aws and elasticsearch-azure plugins and the multiple elasticsearch-lang-* plugins such as elasticsearch-langpython and elasticsearch-lang-ruby that add support for additional scripting languages. There are also plugins that add query capabilities such as additional highlighters and new types of aggregations. Because a code plugin is just a .jar file, it can add any kind of functionality that a developer can think of to Elasticsearch.

Although we said that plugins were split into two categories, that isn’t entirely true. It’s possible for a code plugin to also include basic HTML, image, and Java-Script files that Elasticsearch can serve to provide an interface as well. An example of a plugin like this is the elasticsearch-marvel plugin (www.elastic.co/products/marvel/), which includes Java code that collects and stores metrics, as well as the site portion, which includes an interface to display analytic information about data in Elasticsearch.

Now that we’ve covered the two different types of Elasticsearch plugins, let’s talk about how to install and start using them.