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 2008/09/01 06:32:33 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 following page has been changed by HossMan:
http://wiki.apache.org/solr/SolrPlugins

The comment on the change is:
formating cleanup, small reorg, and remove info redundent from SearchComponent

------------------------------------------------------------------------------
     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.
- 
- = Building Plugins =
- 
- To develop your own plugins, add the `apache-solr-*.jar` jar files to the classpath you use to compile your code.  They contains all of the Solr Interfaces and Class files you may need.  If you are developing plugins that know about lower level Lucene interfaces, you may need to also include the `lucene-*.jar` jar files from the `lib/` directory of your Solr distribution.
  
  = Classes that are 'Pluggable' =
  
@@ -48, +44 @@

  
  for more info, see: SolrRequestHandler
  
- === SearchComponent ===
+ ==== SearchComponent ====
  <!> ["Solr1.3"]
  
+ Instances of [http://lucene.apache.org/solr/api/org/apache/solr/handler/component/SearchComponent.html SearchComponent] define discrete units of logic that can be combined together and reused by Request Handlers that know about them.  (in particular: [http://lucene.apache.org/solr/api/org/apache/solr/handler/component/SearchHandler.html SearchHandler])
- Instances of [http://lucene.apache.org/solr/api/org/apache/solr/handler/component/SearchComponent.html SearchComponent] define logic that is registered to !SolrCore and is executed by a given !SolrRequestHandler typically to supplement a result set.  The following components are available by default:
- {{{
- <searchComponent name="query"     class="org.apache.solr.handler.component.QueryComponent" />
- <searchComponent name="facet"     class="org.apache.solr.handler.component.FacetComponent" />
- <searchComponent name="mlt"       class="org.apache.solr.handler.component.MoreLikeThisComponent" />
- <searchComponent name="highlight" class="org.apache.solr.handler.component.HighlightComponent" />
- <searchComponent name="debug"     class="org.apache.solr.handler.component.DebugComponent" />
- }}}
- 
- Multiple search components can be added to a given !SolrRequestHandler.  Components and their configuration can be specified in your [wiki:SolrConfigXml solrconfig.xml]...
- {{{
- <searchComponent name="elevator" class="org.apache.solr.handler.component.QueryElevationComponent" >
-   <!-- pick a fieldType to analyze queries -->
-   <str name="queryFieldType">string</str>
-   <str name="config-file">elevate.xml</str>
- </searchComponent>
-  
- <requestHandler name="/elevate" class="org.apache.solr.handler.component.SearchHandler" startup="lazy">
-   <lst name="defaults">
-     <str name="echoParams">explicit</str>
-   </lst>
-   <!--
-   By default, this will register the following components:
-     
-   <arr name="components">
-     <str>query</str>
-     <str>facet</str>
-     <str>mlt</str>
-     <str>highlight</str>
-     <str>debug</str>
-   </arr>
-     
-   To insert handlers before or after the 'standard' components, use:
-   
-   <arr name="first-components">
-     <str>first</str>
-   </arr>
- 
-   We insert the elevator component after all the defaults
-   -->
-   <arr name="last-components">
-     <str>elevator</str>
-   </arr>
- </requestHandler>
- }}}
  
  for more info, see: SearchComponent
- 
  
  === QueryResponseWriter ===
  
@@ -223, +174 @@

  
  }}}
  
+ = Building Plugins =
+ 
+ To develop your own plugins, add the `apache-solr-*.jar` jar files to the classpath you use to compile your code.  They contains all of the Solr Interfaces and Class files you may need.  If you are developing plugins that know about lower level Lucene interfaces, you may need to also include the `lucene-*.jar` jar files from the `lib/` directory of your Solr distribution.
+ 
  
  = Plugin Initialization =
  
@@ -231, +186 @@

  Plugins are initializes either with [http://svn.apache.org/repos/asf/lucene/solr/trunk/src/java/org/apache/solr/util/plugin/MapInitializedPlugin.java init( Map<String,String> args )] or [http://svn.apache.org/repos/asf/lucene/solr/trunk/src/java/org/apache/solr/util/plugin/NamedListInitializedPlugin.java init( NamedList args )].
  
  == ResourceLoaderAware ==
- Classes that need to know about the [http://svn.apache.org/repos/asf/lucene/solr/trunk/src/java/org/apache/solr/common/ResourceLoader.java ResourceLoader] can implement [http://svn.apache.org/repos/asf/lucene/solr/trunk/src/java/org/apache/solr/util/plugin/ResourceLoaderAware.java ResourceLoaderAware].  Valid ResourceLoaderAware include:
+ Classes that need to know about the [http://svn.apache.org/repos/asf/lucene/solr/trunk/src/java/org/apache/solr/common/ResourceLoader.java ResourceLoader] can implement [http://svn.apache.org/repos/asf/lucene/solr/trunk/src/java/org/apache/solr/util/plugin/ResourceLoaderAware.java ResourceLoaderAware].  Valid !ResourceLoaderAware include:
-  * TokenFilterFactory
+  * !TokenFilterFactory
-  * TokenizerFactory
+  * !TokenizerFactory
-  * FieldType
+  * !FieldType
  
  == SolrCoreAware ==
- Classes that need to know about the [SolrCore] can implement [http://svn.apache.org/repos/asf/lucene/solr/trunk/src/java/org/apache/solr/util/plugin/SolrCoreAware.java SolrCoreAware].  Valid SolrCoreAware classes include:
+ Classes that need to know about the [SolrCore] can implement [http://svn.apache.org/repos/asf/lucene/solr/trunk/src/java/org/apache/solr/util/plugin/SolrCoreAware.java SolrCoreAware].  Valid !SolrCoreAware classes include:
   * SolrRequestHandler
   * QueryResponseWriter
   * SearchComponent
@@ -245, +200 @@

  == Lifecycle ==
  The initialization lifecycle is:
   1. Constructor
-  2. ''init( Map / !NamedList )''
+  2. {{{init( Map / NamedList )}}}
-  3. ResourceLoaderAware classes call: ''inform( !ResourceLoader );''
+  3. !ResourceLoaderAware classes call: {{{inform( ResourceLoader );}}}
-  3. Before the first request is made and after all plugins have been created and registered, SolrCoreAware plugins call: ''inform( SolrCore );''
+  3. Before the first request is made and after all plugins have been created and registered, !SolrCoreAware plugins call: {{{inform( SolrCore );}}}