Differences between revisions 3 and 4
Revision 3 as of 2006-11-14 05:19:51
Size: 1546
Editor: HossMan
Comment:
Revision 4 as of 2006-11-14 20:33:09
Size: 4484
Editor: HossMan
Comment:
Deletions are marked like this. Additions are marked like this.
Line 6: Line 6:
== How to Load Plugins == = How to Load Plugins =
Line 12: Line 12:
=== The Old Way === == The Old Way ==
Line 19: Line 19:
== List of Classes that are 'Pluggable' == = List of Classes that are 'Pluggable' =
Line 25: Line 25:
== Request Processing ==
Line 26: Line 28:

Instances of [http://incubator.apache.org/solr/docs/api/org/apache/solr/request/SolrRequestHandler.html SolrRequestHandler] define the logic that is executed for any request. Multiple handlers (including multiple instances of the same !SolrRequestHandler class with different configurations) can be specified in your [wiki:SolrConfigXml solrconfig.xml]...

{{{
  <requestHandler name="foo" class="my.package.CustomRequestHandler" />
  <requestHandler name="bar" class="my.package.AnotherCustomRequestHandler" />
  <requestHandler name="baz" class="my.package.AnotherCustomRequestHandler">
    <!-- initialization args may optionally be defined here -->
     <lst name="defaults">
       <int name="rows">10</int>
       <str name="fl">*</str>
       <str name="version">2.1</str>
     <lst>
     <int name="someConfigValue">42</int>
  </requestHandler>
}}}
Line 27: Line 46:

Instances of [http://incubator.apache.org/solr/docs/api/org/apache/solr/request/QueryResponseWriter.html QueryResponseWriter] define the formatting used to output the results of a request. Multiple writers (including multiple instances of the same !QueryResponseWriter class with different configurations) can be specified in your [wiki:SolrConfigXml solrconfig.xml]...

{{{
  <queryResponseWriter name="wow" class="my.package.CustomResponseWriter" />
  <queryResponseWriter name="woz" class="my.package.AnotherCustomResponseWriter" />
  <queryResponseWriter name="woz" class="my.package.AnotherCustomResponseWriter" >
    <!-- initialization args may optionally be defined here -->
    <int name="someConfigValue">42</int>
  </queryResponseWriter>
}}}
Line 28: Line 59:

The [http://lucene.apache.org/java/docs/api/org/apache/lucene/search/Similarity.html Similarity] is a native lucene concept that determines how much of hte score calculations for the various types of queries are executed. For more information on how the methods in the Similarity class are used, consult the [http://lucene.apache.org/java/docs/scoring.html Lucene scoring documentation]. If you wish to override the !DefaultSimilarity provided by Lucene, you can specify your own subclass in your [wiki:SchemaXml schema.xml]...

{{{
  <similarity class="my.package.CustomSimilarity"/>
}}}


=== CacheRegenerator ===

The [http://incubator.apache.org/solr/docs/api/org/apache/solr/search/CacheRegenerator.html CacheRegenerator] API allows people who are writing custom !SolrRequestHandlers which utilize custom [wiki:SolrCaching User Caches] to specify how those caches should be populated during autowarming. A regenerator class can be specified hen the cache is declared in your [wiki:SolrConfigXml solrconfig.xml]...

{{{
    <cache name="myCustomCacheInstance"
      class="solr.LRUCache"
      size="4096"
      initialSize="1024"
      autowarmCount="1024"
      regenerator="my.package.CustomCacheRegenerator"
      />
}}}



== Fields ==
Line 31: Line 88:
=== CacheRegenerator ===
Line 33: Line 89:

== Internals ==

Solr Plugins

Solr allows you to load custom code to perform a variety of of tasks within Solr -- from custom 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.

This is a relatively new feature (as of 2006-11-13) which uses a custom Class Loader. It's not yet clear exactly how successful this approach works on the multitudes of servlet containers available in the wild.

The Old Way

Another method that works consistently on any servlet container is to:

  1. unpack the solr.war
  2. add a jar containing your custom classes to the WEB-INF/lib directory

  3. repack your new, customized, solr.war and use it.

List of Classes that are 'Pluggable'

The following is a complete list of every API that can be treated as a plugin in Solr, with information on how to use that configure your Solr instance to use an instance of that class.

/!\ :TODO: /!\ for each class, link to javadocs and show example of where/how to configure usage

Request Processing

SolrRequestHandler

Instances of [http://incubator.apache.org/solr/docs/api/org/apache/solr/request/SolrRequestHandler.html SolrRequestHandler] define the logic that is executed for any request. Multiple handlers (including multiple instances of the same SolrRequestHandler class with different configurations) can be specified in your [wiki:SolrConfigXml solrconfig.xml]...

  <requestHandler name="foo" class="my.package.CustomRequestHandler" />
  <requestHandler name="bar" class="my.package.AnotherCustomRequestHandler" />
  <requestHandler name="baz" class="my.package.AnotherCustomRequestHandler">
    <!-- initialization args may optionally be defined here -->
     <lst name="defaults">
       <int name="rows">10</int>
       <str name="fl">*</str>
       <str name="version">2.1</str>
     <lst>
     <int name="someConfigValue">42</int>
  </requestHandler>

QueryResponseWriter

Instances of [http://incubator.apache.org/solr/docs/api/org/apache/solr/request/QueryResponseWriter.html QueryResponseWriter] define the formatting used to output the results of a request. Multiple writers (including multiple instances of the same QueryResponseWriter class with different configurations) can be specified in your [wiki:SolrConfigXml solrconfig.xml]...

  <queryResponseWriter name="wow" class="my.package.CustomResponseWriter" />
  <queryResponseWriter name="woz" class="my.package.AnotherCustomResponseWriter" />
  <queryResponseWriter name="woz" class="my.package.AnotherCustomResponseWriter" >
    <!-- initialization args may optionally be defined here -->
    <int name="someConfigValue">42</int>
  </queryResponseWriter> 

Similarity

The [http://lucene.apache.org/java/docs/api/org/apache/lucene/search/Similarity.html Similarity] is a native lucene concept that determines how much of hte score calculations for the various types of queries are executed. For more information on how the methods in the Similarity class are used, consult the [http://lucene.apache.org/java/docs/scoring.html Lucene scoring documentation]. If you wish to override the DefaultSimilarity provided by Lucene, you can specify your own subclass in your [wiki:SchemaXml schema.xml]...

  <similarity class="my.package.CustomSimilarity"/>

CacheRegenerator

The [http://incubator.apache.org/solr/docs/api/org/apache/solr/search/CacheRegenerator.html CacheRegenerator] API allows people who are writing custom SolrRequestHandlers which utilize custom [wiki:SolrCaching User Caches] to specify how those caches should be populated during autowarming. A regenerator class can be specified hen the cache is declared in your [wiki:SolrConfigXml solrconfig.xml]...

    <cache name="myCustomCacheInstance"
      class="solr.LRUCache"
      size="4096"
      initialSize="1024"
      autowarmCount="1024"
      regenerator="my.package.CustomCacheRegenerator"
      />

Fields

Analyzer

TokenizerFactory

TokenFilterFactory

FieldType

Internals

SolrCache

SolrEventListener

UpdateHandler

SolrPlugins (last edited 2017-01-03 19:18:41 by ShawnHeisey)