Class AddUpdateCommand

  • All Implemented Interfaces:
    Cloneable

    public class AddUpdateCommand
    extends UpdateCommand
    An UpdateCommand for adding or updating one document. Technically more than one Lucene documents may be involved in the event of nested documents.
    • Field Detail

      • solrDoc

        public SolrInputDocument solrDoc
        Higher level SolrInputDocument, normally used to construct the Lucene Document(s) to index.
      • prevVersion

        public long prevVersion
        This is the version of a document, previously indexed, on which the current update depends on. This version could be that of a previous in-place update or a full update. A negative value here, e.g. -1, indicates that this add update does not depend on a previous update.
      • overwrite

        public boolean overwrite
      • updateTerm

        public org.apache.lucene.index.Term updateTerm
        The term to use to delete an existing document (for dedupe). (optional)
      • commitWithin

        public int commitWithin
      • isLastDocInBatch

        public boolean isLastDocInBatch
    • Method Detail

      • clear

        public void clear()
        Reset state to reuse this object with a different document in the same request
      • getIndexedIdStr

        public String getIndexedIdStr()
        Returns the indexed ID that we route this document on. Typically, this is for the unique key of the document but for a nested document, it's the ID of the root.
        Returns:
        possibly null if there's no uniqueKey field
      • getIndexedId

        public org.apache.lucene.util.BytesRef getIndexedId()
        Returns the indexed ID that we route this document on. Typically, this is for the unique key of the document but for a nested document, it's the ID of the root.

        BytesRef should be treated as immutable. It will not be re-used/modified for additional docs.

        Returns:
        possibly null if there's no uniqueKey field
      • getSelfOrNestedDocIdStr

        public String getSelfOrNestedDocIdStr()
        Returns the ID of the doc itself, possibly different from getIndexedIdStr() which points to the root doc.
        Returns:
        possibly null if there's no uniqueKey field
      • getPrintableId

        public String getPrintableId()
        The ID for logging purposes.
      • setIndexedId

        public void setIndexedId​(org.apache.lucene.util.BytesRef indexedId)
      • isInPlaceUpdate

        public boolean isInPlaceUpdate()
        Is this add update an in-place update? An in-place update is one where only docValues are updated, and a new document is not indexed.