You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by Apache Wiki <wi...@apache.org> on 2010/04/22 01:10:03 UTC
[Solr Wiki] Update of "SolrPlugins" by HossMan
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.
The "SolrPlugins" page has been changed by HossMan.
The comment on this change is: mention lib directive in solrconfig.xml.
http://wiki.apache.org/solr/SolrPlugins?action=diff&rev1=38&rev2=39
--------------------------------------------------
= Solr Plugins =
- Solr allows you to load custom code to perform a variety of tasks within Solr -- from custom Request Handlers to process your searches, to custom Analyzers and Token Filters for your text field, even custom Field Types. <<TableOfContents>>
+ Solr allows you to load custom code to perform a variety of tasks within Solr -- from custom Request Handlers to process your searches, to custom Analyzers and Token Filters for your text field, even custom Field Types.
+
+ <<TableOfContents>>
= How to Load Plugins =
- Plugin code can be loaded into Solr by putting Jars containing your classes in a `lib` directory in your Solr Home directory prior to starting your servlet container. In the example program, the location is example/solr/lib. ''This directory does not exist in the distribution'', so you would need to do `mkdir` for the first time.
+ Plugin code can be loaded into Solr by putting your classes into a JAR file, and then configuring Solr to know how to find them.
- This feature for loading plugins uses a custom Class Loader. It has been tested with a variety of Servlet Containers, but given the multitudes of servlet containers available in the wild it may not always work with ''every'' servlet container.
+ If you want to use multiple !SolrCores, and have a plugin available to all of them, you can place your JAR files in a directory specified using the "sharedLib" attribute in your [[CoreAdmin#Configuration|solr.xml]] file prior to starting your servlet container.
+
+ For loading plugins in individual !SolrCores, you have two options:
+
+ 1. Place your JARs in a `lib` directory in the instanceDir of your !SolrCore. In the example program, the location is example/solr/lib. ''This directory does not exist in the distribution'', so you would need to do `mkdir` for the first time.
+ 1. use the [[SolrConfigXml#lib|lib]] directive in your solrconfig.xml file to specify an arbitrary JAR path, directory of JAR files, or a directory plus regex that JAR file names must match.
+
+ Loading plugins uses a custom Class Loader. It has been tested with a variety of Servlet Containers, but given the multitudes of servlet containers available in the wild it may not always work with ''every'' servlet container.
== The Old Way ==
Another method that works consistently on any servlet container is to: