Class UpdateRequest
java.lang.Object
org.apache.solr.client.solrj.SolrRequest<UpdateResponse>
org.apache.solr.client.solrj.request.CollectionRequiringSolrRequest<UpdateResponse>
org.apache.solr.client.solrj.request.AbstractUpdateRequest
org.apache.solr.client.solrj.request.UpdateRequest
- All Implemented Interfaces:
Serializable
- Since:
- solr 1.3
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.solr.client.solrj.request.AbstractUpdateRequest
AbstractUpdateRequest.ACTIONNested classes/interfaces inherited from class org.apache.solr.client.solrj.SolrRequest
SolrRequest.ApiVersion, SolrRequest.METHOD, SolrRequest.SolrClientContext, SolrRequest.SolrRequestType -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class org.apache.solr.client.solrj.request.AbstractUpdateRequest
commitWithin, paramsFields inherited from class org.apache.solr.client.solrj.SolrRequest
SUPPORTED_METHODS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(Collection<SolrInputDocument> docs) Add a collection of SolrInputDocuments to this requestadd(SolrInputDocument doc) Add a SolrInputDocument to this requestadd(SolrInputDocument doc, Boolean overwrite) Add a SolrInputDocument to this requestadd(SolrInputDocument doc, Integer commitWithin) Add a SolrInputDocument to this requestadd(SolrInputDocument doc, Integer commitWithin, Boolean overwrite) Add a SolrInputDocument to this requestvoidclear()clear the pending documents and delete commandscommit(SolrClient client, String collection) deleteById(String id) deleteById(String id, Long version) deleteById(String id, String route) deleteById(String id, String route, Long version) deleteById(List<String> ids) getRoutesToCollection(DocRouter router, DocCollection col, Map<String, List<String>> urlMap, ModifiableSolrParams params, String idField) booleanbooleanvoidvoidsetDeleteQuery(List<String> deleteQuery) voidsetDocIterator(Iterator<SolrInputDocument> docIterator) setSendToLeaders(boolean sendToLeaders) Methods inherited from class org.apache.solr.client.solrj.request.AbstractUpdateRequest
createResponse, getAction, getCommitWithin, getParams, isWaitSearcher, rollback, setAction, setAction, setAction, setAction, setAction, setAction, setAction, setCommitWithin, setParam, setParams, setWaitSearcherMethods inherited from class org.apache.solr.client.solrj.request.CollectionRequiringSolrRequest
requiresCollectionMethods inherited from class org.apache.solr.client.solrj.SolrRequest
addHeader, addHeaders, getApiVersion, getBasicAuthPassword, getBasicAuthUser, getCollection, getContentStreams, getContentWriter, getHeaders, getMethod, getPath, getPreferredNodes, getQueryParams, getRequestType, getResponseParser, getStreamingResponseCallback, getUserPrincipal, process, process, processWithBaseUrl, setBasicAuthCredentials, setMethod, setPath, setPreferredNodes, setQueryParams, setRequestType, setResponseParser, setStreamingResponseCallback, setUserPrincipal
-
Field Details
-
REPFACT
- See Also:
-
VER
- See Also:
-
OVERWRITE
- See Also:
-
COMMIT_WITHIN
- See Also:
-
-
Constructor Details
-
UpdateRequest
public UpdateRequest() -
UpdateRequest
-
-
Method Details
-
clear
public void clear()clear the pending documents and delete commands -
add
Add a SolrInputDocument to this request- Throws:
NullPointerException- if the document is null
-
add
-
add
Add a SolrInputDocument to this request- Parameters:
doc- the documentoverwrite- true if the document should overwrite existing docs with the same id- Throws:
NullPointerException- if the document is null
-
add
Add a SolrInputDocument to this request- Parameters:
doc- the documentcommitWithin- the time horizon by which the document should be committed (in ms)- Throws:
NullPointerException- if the document is null
-
add
Add a SolrInputDocument to this request- Parameters:
doc- the documentcommitWithin- the time horizon by which the document should be committed (in ms)overwrite- true if the document should overwrite existing docs with the same id- Throws:
NullPointerException- if the document is null
-
add
Add a collection of SolrInputDocuments to this request- Throws:
NullPointerException- if any of the documents in the collection are null
-
deleteById
-
deleteById
-
deleteById
-
deleteById
-
deleteById
-
deleteByQuery
-
withRoute
-
commit
public UpdateResponse commit(SolrClient client, String collection) throws IOException, SolrServerException - Throws:
IOExceptionSolrServerException
-
getRoutesToCollection
public Map<String,LBSolrClient.Req> getRoutesToCollection(DocRouter router, DocCollection col, Map<String, List<String>> urlMap, ModifiableSolrParams params, String idField) - Parameters:
router- to route updates withcol- DocCollection for the updatesurlMap- of the clusterparams- params to useidField- the id field- Returns:
- a Map of urls to requests
-
setDocIterator
-
setDeleteQuery
-
getDocuments
-
getDocumentsMap
-
getDocIterator
-
getDeleteById
-
getDeleteByIdMap
-
getDeleteQuery
-
isLastDocInBatch
public boolean isLastDocInBatch() -
lastDocInBatch
public void lastDocInBatch() -
isSendToLeaders
public boolean isSendToLeaders() -
setSendToLeaders
-