Class DocBasedVersionConstraintsProcessorFactory

  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
Field Summary
static org.slf4j.Logger log
Constructor Summary
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


public static final org.slf4j.Logger log
Constructor Detail


public DocBasedVersionConstraintsProcessorFactory()
Method Detail


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


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


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

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