Package org.apache.solr.update
Class AddUpdateCommand
- java.lang.Object
-
- org.apache.solr.update.UpdateCommand
-
- org.apache.solr.update.AddUpdateCommand
-
- All Implemented Interfaces:
Cloneable
public class AddUpdateCommand extends UpdateCommand
AnUpdateCommand
for adding or updating one document. Technically more than one Lucene documents may be involved in the event of nested documents.
-
-
Field Summary
Fields Modifier and Type Field Description int
commitWithin
boolean
isLastDocInBatch
boolean
overwrite
long
prevVersion
This is the version of a document, previously indexed, on which the current update depends on.SolrInputDocument
solrDoc
Higher level SolrInputDocument, normally used to construct the Lucene Document(s) to index.org.apache.lucene.index.Term
updateTerm
The 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 Constructor Description AddUpdateCommand(SolrQueryRequest req)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Reset state to reuse this object with a different document in the same requestorg.apache.lucene.util.BytesRef
getIndexedId()
Returns the indexed ID that we route this document on.String
getIndexedIdStr()
Returns the indexed ID that we route this document on.String
getPrintableId()
The ID for logging purposes.String
getSelfOrNestedDocIdStr()
Returns the ID of the doc itself, possibly different fromgetIndexedIdStr()
which points to the root doc.SolrInputDocument
getSolrInputDocument()
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.String
name()
void
setIndexedId(org.apache.lucene.util.BytesRef indexedId)
String
toString()
-
Methods inherited from class org.apache.solr.update.UpdateCommand
clone, getFlags, getReq, getRoute, getTracer, getVersion, setFlags, setReq, setRoute, setVersion
-
-
-
-
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
-
-
Constructor Detail
-
AddUpdateCommand
public AddUpdateCommand(SolrQueryRequest req)
-
-
Method Detail
-
name
public String name()
- Specified by:
name
in classUpdateCommand
-
clear
public void clear()
Reset state to reuse this object with a different document in the same request
-
getSolrInputDocument
public SolrInputDocument getSolrInputDocument()
-
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 fromgetIndexedIdStr()
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)
-
toString
public String toString()
- Overrides:
toString
in 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.
-
-