lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Solr Wiki] Update of "SolrPlugins" by HossMan
Date Tue, 14 Nov 2006 20:33:10 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The following page has been changed by HossMan:
http://wiki.apache.org/solr/SolrPlugins

------------------------------------------------------------------------------
  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 ==
+ = 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 ===
+ == The Old Way ==
  
  Another method that works consistently on any servlet container is to:
     1. unpack the solr.war
     1. add a jar containing your custom classes to the `WEB-INF/lib` directory
     1. repack your new, customized, solr.war and use it.
  
- == List of Classes that are 'Pluggable' ==
+ = 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 ===
- === CacheRegenerator ===
  === FieldType ===
+ 
+ == Internals ==
+ 
  === SolrCache ===
  === SolrEventListener ===
  === UpdateHandler ===

Mime
View raw message