org.apache.solr.update.processor
Class DocBasedVersionConstraintsProcessorFactory

java.lang.Object
  extended by org.apache.solr.update.processor.UpdateRequestProcessorFactory
      extended by org.apache.solr.update.processor.DocBasedVersionConstraintsProcessorFactory
All Implemented Interfaces:
UpdateRequestProcessorFactory.RunAlways, NamedListInitializedPlugin, SolrCoreAware

public class DocBasedVersionConstraintsProcessorFactory
extends UpdateRequestProcessorFactory
implements SolrCoreAware, UpdateRequestProcessorFactory.RunAlways

This Factory generates an UpdateProcessor that helps to enforce Version constraints on documents based on per-document version numbers using a configured name of a versionField. It should be configured on the "default" update processor somewhere before the DistributedUpdateProcessorFactory. As an example, see the solrconfig.xml that the tests use: solr/core/src/test-files/solr/collection1/conf/solrconfig-externalversionconstraint.xml

When documents are added through this processor, if a document with the same unique key already exists in the collection, then the value of the versionField in the existing document is not less then the field value in the new document then the new document is rejected with a 409 Version Conflict error.

In addition to the mandatory versionField init param, two additional optional init params affect the behavior of this factory:


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.solr.update.processor.UpdateRequestProcessorFactory
UpdateRequestProcessorFactory.RunAlways
 
Field Summary
static org.slf4j.Logger log
           
 
Constructor Summary
DocBasedVersionConstraintsProcessorFactory()
           
 
Method Summary
 UpdateRequestProcessor getInstance(SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next)
           
 void inform(SolrCore core)
           
 void init(NamedList args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static final org.slf4j.Logger log
Constructor Detail

DocBasedVersionConstraintsProcessorFactory

public DocBasedVersionConstraintsProcessorFactory()
Method Detail

init

public void init(NamedList args)
Specified by:
init in interface NamedListInitializedPlugin
Overrides:
init in class UpdateRequestProcessorFactory

getInstance

public UpdateRequestProcessor getInstance(SolrQueryRequest req,
                                          SolrQueryResponse rsp,
                                          UpdateRequestProcessor next)
Specified by:
getInstance in class UpdateRequestProcessorFactory

inform

public void inform(SolrCore core)
Specified by:
inform in interface SolrCoreAware


Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.