Class SkipExistingDocumentsProcessorFactory
- All Implemented Interfaces:
UpdateRequestProcessorFactory.RunAlways,NamedListInitializedPlugin,SolrCoreAware
skipInsertIfExists- This boolean parameter defaults totrue, but if set tofalsethen inserts (i.e. not Atomic Updates) will be passed through unchanged even if the document already exists.skipUpdateIfMissing- This boolean parameter defaults totrue, but if set tofalsethen Atomic Updates will be passed through unchanged regardless of whether the document exists.
These params can also be specified per-request, to override the configured behaviour for
specific updates e.g. /update?skipUpdateIfMissing=true
This implementation is a simpler alternative to DocBasedVersionConstraintsProcessorFactory when you are not concerned with versioning, and just
want to quietly ignore duplicate documents and/or silently skip updates to non-existent documents
(in the same way a database UPDATE would).
If your documents do have an explicit version field, and you want to ensure older versions are
skipped instead of replacing the indexed document, you should consider DocBasedVersionConstraintsProcessorFactory instead.
An example chain configuration to use this for skipping duplicate inserts, but not skipping updates to missing documents by default, is:
<updateRequestProcessorChain name="skipexisting">
<processor class="solr.LogUpdateProcessorFactory" />
<processor class="solr.SkipExistingDocumentsProcessorFactory">
<bool name="skipInsertIfExists">true</bool>
<bool name="skipUpdateIfMissing">false</bool> <!-- Can override this per-request -->
</processor>
<processor class="solr.DistributedUpdateProcessorFactory" />
<processor class="solr.RunUpdateProcessorFactory" />
</updateRequestProcessorChain>
- Since:
- 6.4.0
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.solr.update.processor.UpdateRequestProcessorFactory
UpdateRequestProcessorFactory.RunAlways -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.solr.update.processor.SkipExistingDocumentsProcessorFactory.SkipExistingDocumentsUpdateProcessorgetInstance(SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next) voidvoidinit(org.apache.solr.common.util.NamedList<?> args) initwill be called just once, immediately after creation.
-
Constructor Details
-
SkipExistingDocumentsProcessorFactory
public SkipExistingDocumentsProcessorFactory()
-
-
Method Details
-
init
public void init(org.apache.solr.common.util.NamedList<?> args) Description copied from interface:NamedListInitializedPlugininitwill be called just once, immediately after creation.Source of the initialization arguments will typically be solrconfig.xml, but will ultimately depends on the plugin itself
- Specified by:
initin interfaceNamedListInitializedPlugin- Parameters:
args- non-null list of initialization parameters (may be empty)
-
getInstance
public org.apache.solr.update.processor.SkipExistingDocumentsProcessorFactory.SkipExistingDocumentsUpdateProcessor getInstance(SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next) - Specified by:
getInstancein classUpdateRequestProcessorFactory
-
inform
- Specified by:
informin interfaceSolrCoreAware
-