Solr Plugins

One of Solr’s strengths is providing a rich platform of functionality with the option of adding your own custom components running within Solr.

Solr calls such components plugins when the implementation is configurable. Surely you have seen many already throughout Solr’s configuration via the "class" reference. Common examples are Request Handlers, Search Components, and Query Parsers to process your searches, and Token Filters for processing text.

Most apps don’t need to create plugins because Solr offers a rich set of them built-in. However if you do, start by looking at the code for existing similar plugins. Writing your own is an advanced subject that is out of scope of the reference guide. One resource is the Solr Wiki documentation on plugins at SolrPlugins, which is rather out-of-date but has some utility.

Types of Plugins

There are essentially two types of plugins in Solr:

  • Collection level plugins. These are registered on individual collections, either by hand-editing the solrconfig.xml or schema files for the collection’s configset or by using the Config API or Schema API. Examples of these are query parsers, request handlers, update request processors, value source parsers, response writers etc.

  • Cluster level (or Core Container level) plugins. These are plugins that are installed at a cluster level and every Solr node has one instance each of these plugins. Examples of these are Configuring Authentication and Authorization, metrics reporters, cluster level request handlers, etc.

Installing Plugins

Most plugins are built-in to Solr core and there is nothing to install. The subject here is how to make the bundled modules and other plugins available to Solr. Plugins are packaged into a Java jar file and may have other dependent jar files to function.

The next sections describe some options:

Lib Directories and Directives: Plugins as libraries on the filesystem.

Solr Modules: Loading bundled modules.

Package Management: Package-based plugins.

Cluster Plugins: Cluster-level plugins.