lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Solr Wiki] Update of "UpdateRequestProcessor" by HossMan
Date Thu, 26 Jul 2012 01:23:05 GMT
Dear Wiki user,

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

The "UpdateRequestProcessor" page has been changed by HossMan:

elaborate on RunUpdateProcessor and DistributedUpdateProcessor

- <!> [[Solr1.3]]
+ /!\ [[Solr1.3]]
- The [[|UpdateRequestProcessor]]
defines how an update request is processed before it is indexed by the update handler.
+ [[|UpdateRequestProcessors]]
can be mixed and matched in [[|UpdateRequestProcessorChains]]
that define how update requests  are processed.
+ <<TableOfContents()>>
- == Configuring UpdateRequestProcessors ==
+ = Configuring Update Request Processors =
- solrconfig.xml will load a UpdateRequestProcessorChain
+ solrconfig.xml files can contain any number of !UpdateRequestProcessorChains...
   <updateRequestProcessorChain name="mychain" >
@@ -15, +18 @@

         <str name="n2">x2</str>
+    <processor class="solr.LogUpdateProcessorFactory" />
     <processor class="solr.RunUpdateProcessorFactory" />
-    <processor class="solr.LogUpdateProcessorFactory" />
+ Allmost all processor chains should end with an instance of {{{RunUpdateProcessorFactory}}}
unless the user is explicitly executing the update commands in an alternative custom {{{!UpdateRequestProcessorFactory}}}.
- == Selecting the UpdateChain for your request ==
+ = Selecting the UpdateChain for Your Request =
- Once one or more update chains are defined, you may select one on the update request through
the parameter {{{update.chain}}} ( <!> Note that for pre-[[Solr3.2]] you need to use
{{{update.processor}}} instead). Example: {{{http://localhost:8983/solr/update/xml?update.chain=mychain}}}.
You may also choose to set a default UpdateChain for a certain UpdateRequestHandler:
+ Once one or more update chains are defined, you may select one on the update request through
the parameter {{{update.chain}}} 
+ Example: {{{http://localhost:8983/solr/update/xml?update.chain=mychain}}}. 
+ <!> '''Note:''' for Solr versions prior to [[Solr3.2]] you need to use {{{update.processor}}}
instead <!>
+ You may also choose to set a default chain for a certain UpdateRequestHandler:
   <!-- referencing it in an update handler -->
   <requestHandler name="/update/processortest" class="solr.JsonUpdateRequestHandler" >
@@ -31, +43 @@

+ = Distributed Updates =
+ Begining with [[Solr4.0]] all !UpdateRequestProcessorChains which include {{{RunUpdateProcessorFactory}}},
but do not include an implementation of the [[|DistributingUpdateProcessorFactory]]
will have an instance of {{{DistributedUpdateProcessorFactory}}} automaticly injected immediately
prior to the {{{RunUpdateProcessorFactory}}}.
+ In single-server instances, {{{DistributedUpdateProcessorFactory}}} is a No-Op, but for
Solr Cloud instances, it determines where the in the chain the request gets forwarded to the
leader (and other all other nodes in the shard). Processors prior to {{{DistributedUpdateProcessorFactory}}}
in the chain will be executed only on the first node to recieve the command, processors after
the {{{DistributedUpdateProcessorFactory}}} will be executed on every node in the appropriate
+ = Processor Customization Examples =
+ == Field Mutating Update Processors ==
+ Beginging with [[Solr4.0]] various [[|FieldMutatingUpdateProcessorFactories]]
are available that can be mixed and matched to accomplish a variety of goals.
  == Implementing a conditional copyField ==
  Here is a quick example that adds the 'cat' 'popular' if the value of 'popularity' is >
@@ -79, +104 @@

- === ScriptUpdateProcessor ===
+ == Script UpdateProcessors ==
  [[|SOLR-1725]], to be committed for Solr
4.0 final release, adds a ScriptUpdateProcessor.  There is a StatelessScriptUpdateProcessorFactory
included to configure into your solrconfig.xml configuration file.  The ScriptUpdateProcessor
allows for Java scripting engines to be used during the Solr document update processing, allowing
dramatic flexibility in expressing custom document processing before being indexed.  (it also
allows hooks to commit, delete, etc, but add will have the most common usage).  More coming

View raw message