public class UpdateRequest extends AbstractUpdateRequest
AbstractUpdateRequest.ACTION
SolrRequest.METHOD
Modifier and Type | Field and Description |
---|---|
static String |
COMMIT_WITHIN |
static String |
MIN_REPFACT
Deprecated.
Solr now always includes in the response the
REPFACT , this parameter
doesn't need to be explicitly set |
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
getBasePath, getBasicAuthPassword, getBasicAuthUser, getCollection, getContentWriter, getMethod, getPath, getQueryParams, getResponseParser, getStreamingResponseCallback, getUserPrincipal, process, process, setBasePath, setBasicAuthCredentials, setMethod, setPath, setQueryParams, setResponseParser, setStreamingResponseCallback, setUseBinaryV2, setUserPrincipal, setUseV2
public static final String REPFACT
public static final String MIN_REPFACT
REPFACT
, this parameter
doesn't need to be explicitly setpublic 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-2019 Apache Software Foundation. All Rights Reserved.