| = Solr Plugins |
| :page-children: libs, \ |
| package-manager, \ |
| adding-custom-plugins-in-solrcloud-mode |
| |
| // Licensed to the Apache Software Foundation (ASF) under one |
| // or more contributor license agreements. See the NOTICE file |
| // distributed with this work for additional information |
| // regarding copyright ownership. The ASF licenses this file |
| // to you under the Apache License, Version 2.0 (the |
| // "License"); you may not use this file except in compliance |
| // with the License. You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, |
| // software distributed under the License is distributed on an |
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| // KIND, either express or implied. See the License for the |
| // specific language governing permissions and limitations |
| // under the License. |
| |
| 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 https://cwiki.apache.org/confluence/display/solr/SolrPlugins[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.adoc#,config API>> or <<schema-api.adoc#,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 <<authentication-and-authorization-plugins.adoc#,authentication and authorization plugins>>, <<metrics-reporting.adoc#reporters,metrics reporters>>, https://issues.apache.org/jira/browse/SOLR-14404[cluster level request handlers] etc. |
| |
| == Installing Plugins == |
| |
| Most plugins are built-in to Solr and there is nothing to install. |
| The subject here is how to make other plugins available to Solr, including those in contrib modules. |
| Plugins are packaged into a Java jar file and may have other dependent jar files to function. |
| |
| The next sections describe some options: |
| |
| * <<libs.adoc#lib-directories,Lib Directories>>: |
| Describes where to put the plugin's JAR files on the file system; either in one of the special places or a place convenient to you along with a `<lib/>` directive in `solrconfig.xml`. |
| This has been the standard approach since Solr's inception. |
| It's simple and reliable but it's entirely on you to ensure that all nodes in a cluster have them. |
| Contrib modules ship with Solr so there's no effort for them but not so for other plugins (yours or 3rd party). |
| |
| * <<package-manager.adoc#,Package Management>>: |
| Describes a new and experimental system to manage packages of plugins in SolrCloud. |
| It includes CLI commands, cluster-wide installation, use of plugin registries that host plugins, cryptographically signed plugins for security, and more. |
| Only some plugins support this as of now (support for more types of plugins coming soon). |
| |
| * <<adding-custom-plugins-in-solrcloud-mode.adoc#,Blob and Runtimelib>>: |
| Describes a deprecated system that predates the above package management system. |
| It's functionality is a subset of the package management system. |
| It will no longer be supported in Solr 9. |