11.05.2016 Views

Apache Solr Reference Guide Covering Apache Solr 6.0

21SiXmO

21SiXmO

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Related Topics<br />

Using <strong>Solr</strong>’s REST APIs to manage stop words and synonyms by Tim Potter @ SearchHub.org<br />

<strong>Solr</strong> Plugins<br />

<strong>Solr</strong> allows you to load custom code to perform a variety of tasks within <strong>Solr</strong>, from custom Request Handlers to<br />

process your searches, to custom Analyzers and Token Filters for your text field. You can even load custom<br />

Field Types. These pieces of custom code are called plugins.<br />

Not everyone will need to create plugins for their <strong>Solr</strong> instances - what's provided is usually enough for most<br />

applications. However, if there's something that you need, you may want to review the <strong>Solr</strong> Wiki documentation<br />

on plugins at <strong>Solr</strong>Plugins.<br />

If you have a plugin you would like to use, and you are running in <strong>Solr</strong>Cloud mode, you can use the Blob Store<br />

API and the Config API to load the jars to <strong>Solr</strong>. The commands to use are described in the section Adding<br />

Custom Plugins in <strong>Solr</strong>Cloud Mode.<br />

Adding Custom Plugins in <strong>Solr</strong>Cloud Mode<br />

When running <strong>Solr</strong> in <strong>Solr</strong>Cloud mode and you want to use custom code (such as custom analyzers, tokenizers,<br />

query parsers, and other plugins), it can be cumbersome to add jars to the classpath on all nodes in your cluster.<br />

Using the Blob Store API and special commands with the Config API, you can upload jars to a special<br />

system-level collection and dynamically load plugins from them at runtime with out needing to restart any nodes.<br />

This Feature is Disabled By Default<br />

In addition to requiring that <strong>Solr</strong> by running in <strong>Solr</strong>Cloud mode, this feature is also disabled by default<br />

unless all <strong>Solr</strong> nodes are run with the -Denable.runtime.lib=true option on startup.<br />

Before enabling this feature, users should carefully consider the issues discussed in the Securing<br />

Runtime Libraries section below.<br />

Uploading Jar Files<br />

The first step is to use the Blob Store API to upload your jar files. This will to put your jars in the .system collecti<br />

on and distribute them across your <strong>Solr</strong>Cloud nodes. These jars are added to a separate classloader and only<br />

accessible to components that are configured with the property runtimeLib=true. These components are<br />

loaded lazily because the .system collection may not be loaded when a particular core is loaded.<br />

Config API Commands to use Jars as Runtime Libraries<br />

The runtime library feature uses a special set of commands for the Config API to add, update, or remove jar files<br />

currently available in the blob store to the list of runtime libraries.<br />

The following commands are used to manage runtime libs:<br />

add-runtimelib<br />

update-runtimelib<br />

delete-runtimelib<br />

<strong>Apache</strong> <strong>Solr</strong> <strong>Reference</strong> <strong>Guide</strong> <strong>6.0</strong><br />

498

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!