Class DocBasedVersionConstraintsProcessor

    • Method Detail

      • versionInUpdateIsAcceptable

        protected boolean versionInUpdateIsAcceptable​(Object[] newUserVersions,
                                                      Object[] oldUserVersions)
        Returns whether or not the versions in the command are acceptable to be indexed. If the instance is set to ignoreOldUpdates==false, it will throw a SolrException with CONFLICT in the event the version is not acceptable rather than return false.
        Parameters:
        newUserVersions - New versions in update request
        oldUserVersions - Old versions currently in solr index
        Returns:
        True if acceptable, false if not (or will throw exception)
      • newUpdateComparePasses

        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.
        Parameters:
        newUserVersion - User-specified version on the new version of the document
        oldUserVersion - User-specified version on the old version of the document
        userVersionFieldName - Field name of the user versions being compared
        Returns:
        True if acceptable, false if not.
      • createTombstoneDocument

        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. The returned document will contain:
        • uniqueKey
        • versions (All the fields configured as in the versionField parameter)
        • All the fields set in the tombstoneConfig parameter
        Note that if the schema contains required fields (other than version fields or uniqueKey), they should be populated by the tombstoneConfig, 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)