Class UpdateRequest
- java.lang.Object
- 
- org.apache.solr.client.solrj.SolrRequest<UpdateResponse>
- 
- org.apache.solr.client.solrj.request.AbstractUpdateRequest
- 
- org.apache.solr.client.solrj.request.UpdateRequest
 
 
 
- 
- All Implemented Interfaces:
- Serializable,- IsUpdateRequest
 
 public class UpdateRequest extends AbstractUpdateRequest - Since:
- solr 1.3
- See Also:
- Serialized Form
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class org.apache.solr.client.solrj.request.AbstractUpdateRequestAbstractUpdateRequest.ACTION
 - 
Nested classes/interfaces inherited from class org.apache.solr.client.solrj.SolrRequestSolrRequest.METHOD
 
- 
 - 
Field SummaryFields Modifier and Type Field Description static StringCOMMIT_WITHINstatic StringMIN_REPFACTDeprecated.Solr now always includes in the response theREPFACT, this parameter doesn't need to be explicitly setstatic StringOVERWRITEstatic StringREPFACTstatic StringVER- 
Fields inherited from class org.apache.solr.client.solrj.request.AbstractUpdateRequestcommitWithin, params
 - 
Fields inherited from class org.apache.solr.client.solrj.SolrRequestSUPPORTED_METHODS, useBinaryV2, usev2
 
- 
 - 
Constructor SummaryConstructors Constructor Description UpdateRequest()UpdateRequest(String url)
 - 
Method Summary- 
Methods inherited from class org.apache.solr.client.solrj.request.AbstractUpdateRequestcreateResponse, getAction, getCommitWithin, getParams, isWaitSearcher, rollback, setAction, setAction, setAction, setAction, setAction, setAction, setAction, setCommitWithin, setParam, setParams, setWaitSearcher
 - 
Methods inherited from class org.apache.solr.client.solrj.SolrRequestgetBasicAuthPassword, getBasicAuthUser, getCollection, getContentWriter, getMethod, getPath, getQueryParams, getResponseParser, getStreamingResponseCallback, process, process, setBasicAuthCredentials, setMethod, setPath, setQueryParams, setResponseParser, setStreamingResponseCallback, setUseBinaryV2, setUseV2
 
- 
 
- 
- 
- 
Field Detail- 
REPFACTpublic static final String REPFACT - See Also:
- Constant Field Values
 
 - 
MIN_REPFACTpublic static final String MIN_REPFACT Deprecated.Solr now always includes in the response theREPFACT, this parameter doesn't need to be explicitly set- See Also:
- Constant Field Values
 
 - 
VERpublic static final String VER - See Also:
- Constant Field Values
 
 - 
OVERWRITEpublic static final String OVERWRITE - See Also:
- Constant Field Values
 
 - 
COMMIT_WITHINpublic static final String COMMIT_WITHIN - See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
UpdateRequestpublic UpdateRequest() 
 - 
UpdateRequestpublic UpdateRequest(String url) 
 
- 
 - 
Method Detail- 
clearpublic void clear() clear the pending documents and delete commands
 - 
addpublic UpdateRequest add(SolrInputDocument doc) Add a SolrInputDocument to this request- Throws:
- NullPointerException- if the document is null
 
 - 
addpublic UpdateRequest add(String... fields) 
 - 
addpublic UpdateRequest add(SolrInputDocument doc, Boolean overwrite) Add a SolrInputDocument to this request- Parameters:
- doc- the document
- overwrite- true if the document should overwrite existing docs with the same id
- Throws:
- NullPointerException- if the document is null
 
 - 
addpublic UpdateRequest add(SolrInputDocument doc, Integer commitWithin) Add a SolrInputDocument to this request- Parameters:
- doc- the document
- commitWithin- the time horizon by which the document should be committed (in ms)
- Throws:
- NullPointerException- if the document is null
 
 - 
addpublic UpdateRequest add(SolrInputDocument doc, Integer commitWithin, Boolean overwrite) Add a SolrInputDocument to this request- Parameters:
- doc- the document
- commitWithin- 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
 
 - 
addpublic UpdateRequest add(Collection<SolrInputDocument> docs) Add a collection of SolrInputDocuments to this request- Throws:
- NullPointerException- if any of the documents in the collection are null
 
 - 
deleteByIdpublic UpdateRequest deleteById(String id) 
 - 
deleteByIdpublic UpdateRequest deleteById(String id, String route) 
 - 
deleteByIdpublic UpdateRequest deleteById(String id, String route, Long version) 
 - 
deleteByIdpublic UpdateRequest deleteById(List<String> ids) 
 - 
deleteByIdpublic UpdateRequest deleteById(String id, Long version) 
 - 
deleteByQuerypublic UpdateRequest deleteByQuery(String q) 
 - 
withRoutepublic UpdateRequest withRoute(String route) 
 - 
commitpublic UpdateResponse commit(SolrClient client, String collection) throws IOException, SolrServerException - Throws:
- IOException
- SolrServerException
 
 - 
getRoutespublic Map<String,LBHttpSolrClient.Req> getRoutes(DocRouter router, DocCollection col, Map<String,List<String>> urlMap, ModifiableSolrParams params, String idField) - Parameters:
- router- to route updates with
- col- DocCollection for the updates
- urlMap- of the cluster
- params- params to use
- idField- the id field
- Returns:
- a Map of urls to requests
 
 - 
setDocIteratorpublic void setDocIterator(Iterator<SolrInputDocument> docIterator) 
 - 
getContentStreamspublic Collection<ContentStream> getContentStreams() throws IOException - Overrides:
- getContentStreamsin class- SolrRequest<UpdateResponse>
- Throws:
- IOException
 
 - 
getXMLpublic String getXML() throws IOException - Throws:
- IOException
 
 - 
writeXMLpublic UpdateRequest writeXML(Writer writer) throws IOException - Throws:
- IOException
- Since:
- solr 1.4
 
 - 
getDocumentspublic List<SolrInputDocument> getDocuments() 
 - 
getDocumentsMappublic Map<SolrInputDocument,Map<String,Object>> getDocumentsMap() 
 - 
getDocIteratorpublic Iterator<SolrInputDocument> getDocIterator() 
 - 
isLastDocInBatchpublic boolean isLastDocInBatch() 
 - 
lastDocInBatchpublic void lastDocInBatch() 
 
- 
 
-