Package org.apache.solr.update
Class AddUpdateCommand
java.lang.Object
org.apache.solr.update.UpdateCommand
org.apache.solr.update.AddUpdateCommand
- All Implemented Interfaces:
Cloneable
An
UpdateCommand for adding or updating one document. Technically more than one Lucene
documents may be involved in the event of nested documents.-
Field Summary
FieldsModifier and TypeFieldDescriptionintbooleanbooleanlongThis is the version of a document, previously indexed, on which the current update depends on.org.apache.solr.common.SolrInputDocumentHigher level SolrInputDocument, normally used to construct the Lucene Document(s) to index.org.apache.lucene.index.TermThe term to use to delete an existing document (for dedupe).Fields inherited from class org.apache.solr.update.UpdateCommand
BUFFERING, CLEAR_CACHES, flags, IGNORE_AUTOCOMMIT, IGNORE_INDEXWRITER, PEER_SYNC, REPLAY, req, route, version -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Reset state to reuse this object with a different document in the same requestorg.apache.lucene.util.BytesRefReturns the indexed ID that we route this document on.Returns the indexed ID that we route this document on.The ID for logging purposes.Returns the ID of the doc itself, possibly different fromgetIndexedIdStr()which points to the root doc.org.apache.solr.common.SolrInputDocumentbooleanIs 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.name()voidsetIndexedId(org.apache.lucene.util.BytesRef indexedId) toString()Methods inherited from class org.apache.solr.update.UpdateCommand
clone, getFlags, getReq, getRoute, getVersion, setFlags, setRoute, setVersion
-
Field Details
-
solrDoc
public org.apache.solr.common.SolrInputDocument solrDocHigher level SolrInputDocument, normally used to construct the Lucene Document(s) to index. -
prevVersion
public long prevVersionThis 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 updateTermThe term to use to delete an existing document (for dedupe). (optional) -
commitWithin
public int commitWithin -
isLastDocInBatch
public boolean isLastDocInBatch
-
-
Constructor Details
-
AddUpdateCommand
-
-
Method Details
-
name
- Specified by:
namein classUpdateCommand
-
clear
public void clear()Reset state to reuse this object with a different document in the same request -
getSolrInputDocument
public org.apache.solr.common.SolrInputDocument getSolrInputDocument() -
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
Returns the ID of the doc itself, possibly different fromgetIndexedIdStr()which points to the root doc.- Returns:
- possibly null if there's no uniqueKey field
-
getPrintableId
The ID for logging purposes. -
setIndexedId
public void setIndexedId(org.apache.lucene.util.BytesRef indexedId) -
toString
- Overrides:
toStringin classUpdateCommand
-
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.
-