public class DocBasedVersionConstraintsProcessor extends UpdateRequestProcessor
next
Constructor and Description |
---|
DocBasedVersionConstraintsProcessor(List<String> versionFields,
boolean ignoreOldUpdates,
List<String> deleteVersionParamNames,
boolean supportMissingVersionOnOldDocs,
boolean useFieldCache,
NamedList<Object> tombstoneConfig,
SolrQueryRequest req,
UpdateRequestProcessor next) |
Modifier and Type | Method and Description |
---|---|
protected SolrInputDocument |
createTombstoneDocument(IndexSchema schema,
String id,
String[] versionFieldNames,
String[] deleteParamValues,
NamedList<Object> tombstoneConfig)
Creates a tombstone document, that will be used to update a document that's being deleted by ID.
|
protected boolean |
newUpdateComparePasses(Comparable newUserVersion,
Comparable oldUserVersion,
String userVersionFieldName)
Given two comparable user versions, returns whether the new version is acceptable
to replace the old version.
|
void |
processAdd(AddUpdateCommand cmd) |
void |
processDelete(DeleteUpdateCommand cmd) |
protected boolean |
versionInUpdateIsAcceptable(Object[] newUserVersions,
Object[] oldUserVersions)
Returns whether or not the versions in the command are acceptable to be indexed.
|
close, doClose, finish, processCommit, processMergeIndexes, processRollback
public DocBasedVersionConstraintsProcessor(List<String> versionFields, boolean ignoreOldUpdates, List<String> deleteVersionParamNames, boolean supportMissingVersionOnOldDocs, boolean useFieldCache, NamedList<Object> tombstoneConfig, SolrQueryRequest req, UpdateRequestProcessor next)
protected boolean versionInUpdateIsAcceptable(Object[] newUserVersions, Object[] oldUserVersions)
newUserVersions
- New versions in update requestoldUserVersions
- Old versions currently in solr indexprotected boolean newUpdateComparePasses(Comparable newUserVersion, Comparable oldUserVersion, String userVersionFieldName)
newUserVersion
- User-specified version on the new version of the documentoldUserVersion
- User-specified version on the old version of the documentuserVersionFieldName
- Field name of the user versions being comparedpublic void processAdd(AddUpdateCommand cmd) throws IOException
processAdd
in class UpdateRequestProcessor
IOException
public void processDelete(DeleteUpdateCommand cmd) throws IOException
processDelete
in class UpdateRequestProcessor
IOException
protected SolrInputDocument createTombstoneDocument(IndexSchema schema, String id, String[] versionFieldNames, String[] deleteParamValues, NamedList<Object> tombstoneConfig)
versionField
parameter)tombstoneConfig
parametertombstoneConfig
,
otherwise this tombstone will fail when indexing (and consequently the delete will fail). Alternatively, required fields must be populated by some
other means (like DocBasedVersionConstraintsProcessorFactory
or similar)Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.