public class AddUpdateCommand extends UpdateCommand
UpdateCommand
for adding or updating one document. Technically more than one Lucene documents
may be involved in the event of nested documents.Modifier and Type | Field and Description |
---|---|
int |
commitWithin |
boolean |
isLastDocInBatch |
Boolean |
isNested
Is this a nested update, null means not yet calculated.
|
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.
|
Term |
updateTerm
The term to use to delete an existing document (for dedupe).
|
BUFFERING, CLEAR_CACHES, flags, IGNORE_AUTOCOMMIT, IGNORE_INDEXWRITER, PEER_SYNC, REPLAY, req, route, version
Constructor and Description |
---|
AddUpdateCommand(SolrQueryRequest req) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Reset state to reuse this object with a different document in the same request
|
String |
getHashableId() |
BytesRef |
getIndexedId()
Returns the indexed ID for this document.
|
Iterable<Document> |
getLuceneDocsIfNested()
Computes the final flattened Solr docs that are ready to be converted to Lucene docs.
|
Document |
getLuceneDocument()
Creates and returns a lucene Document to index.
|
String |
getPrintableId() |
String |
getRootIdUsingRouteParam() |
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(BytesRef indexedId) |
String |
toString() |
clone, getFlags, getReq, getRoute, getVersion, setFlags, setReq, setRoute, setVersion
public SolrInputDocument solrDoc
public long prevVersion
public boolean overwrite
public Term updateTerm
public int commitWithin
public boolean isLastDocInBatch
public Boolean isNested
public AddUpdateCommand(SolrQueryRequest req)
public String name()
name
in class UpdateCommand
public void clear()
public SolrInputDocument getSolrInputDocument()
public Document getLuceneDocument()
getLuceneDocsIfNested()
for that.
Any changes made to the returned Document will not be reflected in the SolrInputDocument, or future calls to this
method.
Note that the behavior of this is sensitive to isInPlaceUpdate()
.public BytesRef getIndexedId()
public void setIndexedId(BytesRef indexedId)
public String getPrintableId()
public String getRootIdUsingRouteParam()
ShardParams._ROUTE_
), otherwise doc id.public String getHashableId()
public Iterable<Document> getLuceneDocsIfNested()
getLuceneDocument()
instead.
This should only be called once.
Any changes made to the returned Document(s) will not be reflected in the SolrInputDocument,
or future calls to this method.public String toString()
toString
in class UpdateCommand
public boolean isInPlaceUpdate()
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.