public class UpdateRequest extends AbstractUpdateRequest
AbstractUpdateRequest.ACTION
SolrRequest.METHOD
Modifier and Type | Field and Description |
---|---|
static String |
COMMIT_WITHIN |
static String |
MIN_REPFACT |
static String |
OVERWRITE |
static String |
REPFACT |
static String |
VER |
commitWithin, params
SUPPORTED_METHODS, useBinaryV2, usev2
Constructor and Description |
---|
UpdateRequest() |
UpdateRequest(String url) |
createResponse, getAction, getCommitWithin, getParams, isWaitSearcher, rollback, setAction, setAction, setAction, setAction, setAction, setAction, setAction, setCommitWithin, setParam, setParams, setWaitSearcher
getBasicAuthPassword, getBasicAuthUser, getCollection, getMethod, getPath, getQueryParams, getResponseParser, getStreamingResponseCallback, process, process, setBasicAuthCredentials, setMethod, setPath, setQueryParams, setResponseParser, setStreamingResponseCallback, setUseBinaryV2, setUseV2
public static final String REPFACT
public static final String MIN_REPFACT
public static final String VER
public static final String OVERWRITE
public static final String COMMIT_WITHIN
public UpdateRequest()
public UpdateRequest(String url)
public void clear()
public UpdateRequest add(SolrInputDocument doc)
NullPointerException
- if the document is nullpublic UpdateRequest add(String... fields)
public UpdateRequest add(SolrInputDocument doc, Boolean overwrite)
doc
- the documentoverwrite
- true if the document should overwrite existing docs with the same idNullPointerException
- if the document is nullpublic UpdateRequest add(SolrInputDocument doc, Integer commitWithin)
doc
- the documentcommitWithin
- the time horizon by which the document should be committed (in ms)NullPointerException
- if the document is nullpublic UpdateRequest add(SolrInputDocument doc, Integer commitWithin, Boolean overwrite)
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 idNullPointerException
- if the document is nullpublic UpdateRequest add(Collection<SolrInputDocument> docs)
NullPointerException
- if any of the documents in the collection are nullpublic UpdateRequest deleteById(String id)
public UpdateRequest deleteById(String id, String route)
public UpdateRequest deleteById(String id, String route, Long version)
public UpdateRequest deleteById(List<String> ids)
public UpdateRequest deleteById(String id, Long version)
public UpdateRequest deleteByQuery(String q)
public UpdateRequest withRoute(String route)
public UpdateResponse commit(SolrClient client, String collection) throws IOException, SolrServerException
IOException
SolrServerException
public Map<String,LBHttpSolrClient.Req> getRoutes(DocRouter router, DocCollection col, Map<String,List<String>> urlMap, ModifiableSolrParams params, String idField)
router
- to route updates withcol
- DocCollection for the updatesurlMap
- of the clusterparams
- params to useidField
- the id fieldpublic void setDocIterator(Iterator<SolrInputDocument> docIterator)
public Collection<ContentStream> getContentStreams() throws IOException
getContentStreams
in class SolrRequest<UpdateResponse>
IOException
public String getXML() throws IOException
IOException
public UpdateRequest writeXML(Writer writer) throws IOException
IOException
public List<SolrInputDocument> getDocuments()
public Map<SolrInputDocument,Map<String,Object>> getDocumentsMap()
public Iterator<SolrInputDocument> getDocIterator()
public boolean isLastDocInBatch()
public void lastDocInBatch()
Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.