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 2012/12/11 02:03:35 UTC

[Solr Wiki] Update of "Atomic_Updates" by HossMan

Dear Wiki user,

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

The "Atomic_Updates" page has been changed by HossMan:
http://wiki.apache.org/solr/Atomic_Updates?action=diff&rev1=1&rev2=2

Comment:
doc edits inspired by SOLR-4127

  <!> [[Solr4.0]]
  
  = Atomic Updates =
-  
- <<TableOfContents(2)>>
- == Introduction ==
  
  Atomic Updates is a new feature in Solr 4.0 that allows you to update on a field level rather than on a document level (In previous versions). This means that you can update individual fields without having to send the document to Solr with the update fields values. Internally Solr re-adds the document to the index with the updated fields.
  
+ <<TableOfContents(2)>>
+ 
- == Available Modifiers ==
+ = Available Modifiers =
  
   * {{{set}}} – sets or replaces a particular value, or remove the value if {{{null}}} is specified as the new value. <!> Note: In the case of multi-valued fields if {{{null}}} is specified on {{{set}}} all the values in the field are removed. See [[https://issues.apache.org/jira/browse/SOLR-3862|SOLR-3862]]
   * {{{add}}} – adds an additional value to a multi-valued field 
   * {{{inc}}} – increments a numeric value by a specific amount
  
+ Example syntaxes...
- [[http://wiki.apache.org/solr/UpdateJSON#Solr_4.0_Example | Update JSON Example]] <<BR>>
- [[http://wiki.apache.org/solr/UpdateXmlMessages#Optional_attributes_for_.22field.22 | Update XML Example]]
  
+  * [[UpdateJSON#Solr_4.0_Example | Update JSON Example]]
+  * [[UpdateXmlMessages#Optional_attributes_for_.22field.22 | Update XML Example]]
+ 
+ = Caveats and Limitations =
+ 
+ == Stored Values ==
+ 
+ The core functionality of atomicaly updating a document requires that all fields in your SchemaXml must be configured as {{{stored="true"}}} except for fields which are {{{<copyField/>}}} destinations -- which must be configured as {{{stored="false"}}}.  This is because the atomic updates are applied to the document represented by the existing stored field values.
+ 
+ == Update Log ==
+ 
+ An {{{<updateLog/>}}} must be configured in your solrconfig.xml in order for atomic document updates to be used.  This is neccessary to ensure that the update instructions are applied to the most recently indexed version of the document -- even if that version has not yet been commited (just like RealTimeGet).
+ 
+ == DistributedUpdateRequestProcessorFactory ==
+ 
+ To improve performance in typical installations, atomic document updates are processed during execution of the {{{DistributedUpdateRequestProcessor}}}.  By default all [[UpdateRequestProcessor|update chains]] have the {{{DistributedUpdateRequestProcessorFactory}}} inserted into them just prior to the {{{RunUpdateProcessorFactory}}} and most users won't be afected by this implementation detail, but there are two situations where it might affect you...
+ 
+ === Using Update Processors that Modify Documents ===
+ 
+ If you use [[UpdateRequestProcessor|UpdateRequestProcessors]] to modify document values when indexing, these should be placed ''after'' the {{{DistributedUpdateRequestProcessorFactory}}} in your update chain to ensure they see the fully populated {{{SolrInputDocument}}} with all field values when an atomic document update request is recieved.
+ 
+ === Disabling DistributedUpdateRequestProcessorFactory ===
+ 
+ If you have disabled {{{DistributedUpdateRequestProcessorFactory}}} by adding your own {{{DistributingUpdateProcessorFactory}}} (or {{{NoOpDistributingUpdateProcessorFactory}}}) to your update chain, then atomic document updates are not supported
  
  = References =
  
- https://issues.apache.org/jira/browse/SOLR-139 <<BR>>
+  * https://issues.apache.org/jira/browse/SOLR-139
- http://yonik.com/solr/atomic-updates/
+  * http://yonik.com/solr/atomic-updates/