public abstract class SolrServer extends Object implements Serializable
| Constructor and Description |
|---|
SolrServer() |
| Modifier and Type | Method and Description |
|---|---|
UpdateResponse |
add(Collection<SolrInputDocument> docs)
Adds a collection of documents
|
UpdateResponse |
add(Collection<SolrInputDocument> docs,
int commitWithinMs)
Adds a collection of documents, specifying max time before they become committed
|
UpdateResponse |
add(SolrInputDocument doc)
Adds a single document
|
UpdateResponse |
add(SolrInputDocument doc,
int commitWithinMs)
Adds a single document specifying max time before it becomes committed
|
UpdateResponse |
addBean(Object obj)
Adds a single bean
|
UpdateResponse |
addBean(Object obj,
int commitWithinMs)
Adds a single bean specifying max time before it becomes committed
|
UpdateResponse |
addBeans(Collection<?> beans)
Adds a collection of beans
|
UpdateResponse |
addBeans(Collection<?> beans,
int commitWithinMs)
Adds a collection of beans specifying max time before they become committed
|
UpdateResponse |
commit()
Performs an explicit commit, causing pending documents to be committed for indexing
|
UpdateResponse |
commit(boolean waitFlush,
boolean waitSearcher)
Performs an explicit commit, causing pending documents to be committed for indexing
|
UpdateResponse |
commit(boolean waitFlush,
boolean waitSearcher,
boolean softCommit)
Performs an explicit commit, causing pending documents to be committed for indexing
|
UpdateResponse |
deleteById(List<String> ids)
Deletes a list of documents by unique ID
|
UpdateResponse |
deleteById(List<String> ids,
int commitWithinMs)
Deletes a list of documents by unique ID, specifying max time before commit
|
UpdateResponse |
deleteById(String id)
Deletes a single document by unique ID
|
UpdateResponse |
deleteById(String id,
int commitWithinMs)
Deletes a single document by unique ID, specifying max time before commit
|
UpdateResponse |
deleteByQuery(String query)
Deletes documents from the index based on a query
|
UpdateResponse |
deleteByQuery(String query,
int commitWithinMs)
Deletes documents from the index based on a query, specifying max time before commit
|
DocumentObjectBinder |
getBinder() |
UpdateResponse |
optimize()
Performs an explicit optimize, causing a merge of all segments to one.
|
UpdateResponse |
optimize(boolean waitFlush,
boolean waitSearcher)
Performs an explicit optimize, causing a merge of all segments to one.
|
UpdateResponse |
optimize(boolean waitFlush,
boolean waitSearcher,
int maxSegments)
Performs an explicit optimize, causing a merge of all segments to one.
|
SolrPingResponse |
ping()
Issues a ping request to check if the server is alive
|
QueryResponse |
query(SolrParams params)
Performs a query to the Solr server
|
QueryResponse |
query(SolrParams params,
SolrRequest.METHOD method)
Performs a query to the Solr server
|
QueryResponse |
queryAndStreamResponse(SolrParams params,
StreamingResponseCallback callback)
Query solr, and stream the results.
|
abstract NamedList<Object> |
request(SolrRequest request)
SolrServer implementations need to implement how a request is actually processed
|
UpdateResponse |
rollback()
Performs a rollback of all non-committed documents pending.
|
abstract void |
shutdown()
Release allocated resources.
|
public UpdateResponse add(Collection<SolrInputDocument> docs) throws SolrServerException, IOException
docs - the collection of documentsIOException - If there is a low-level I/O error.SolrServerExceptionpublic UpdateResponse add(Collection<SolrInputDocument> docs, int commitWithinMs) throws SolrServerException, IOException
docs - the collection of documentscommitWithinMs - max time (in ms) before a commit will happenIOException - If there is a low-level I/O error.SolrServerExceptionpublic UpdateResponse addBeans(Collection<?> beans) throws SolrServerException, IOException
beans - the collection of beansIOException - If there is a low-level I/O error.SolrServerExceptionpublic UpdateResponse addBeans(Collection<?> beans, int commitWithinMs) throws SolrServerException, IOException
beans - the collection of beanscommitWithinMs - max time (in ms) before a commit will happenIOException - If there is a low-level I/O error.SolrServerExceptionpublic UpdateResponse add(SolrInputDocument doc) throws SolrServerException, IOException
doc - the input documentIOException - If there is a low-level I/O error.SolrServerExceptionpublic UpdateResponse add(SolrInputDocument doc, int commitWithinMs) throws SolrServerException, IOException
doc - the input documentcommitWithinMs - max time (in ms) before a commit will happenIOException - If there is a low-level I/O error.SolrServerExceptionpublic UpdateResponse addBean(Object obj) throws IOException, SolrServerException
obj - the input beanIOException - If there is a low-level I/O error.SolrServerExceptionpublic UpdateResponse addBean(Object obj, int commitWithinMs) throws IOException, SolrServerException
obj - the input beancommitWithinMs - max time (in ms) before a commit will happenIOException - If there is a low-level I/O error.SolrServerExceptionpublic UpdateResponse commit() throws SolrServerException, IOException
waitFlush=true and waitSearcher=true to be inline with the defaults for plain HTTP access
IOException - If there is a low-level I/O error.SolrServerExceptionpublic UpdateResponse optimize() throws SolrServerException, IOException
waitFlush=true and waitSearcher=true to be inline with the defaults for plain HTTP access
Note: In most cases it is not required to do explicit optimize
IOException - If there is a low-level I/O error.SolrServerExceptionpublic UpdateResponse commit(boolean waitFlush, boolean waitSearcher) throws SolrServerException, IOException
waitFlush - block until index changes are flushed to diskwaitSearcher - block until a new searcher is opened and registered as the main query searcher, making the changes visibleIOException - If there is a low-level I/O error.SolrServerExceptionpublic UpdateResponse commit(boolean waitFlush, boolean waitSearcher, boolean softCommit) throws SolrServerException, IOException
waitFlush - block until index changes are flushed to diskwaitSearcher - block until a new searcher is opened and registered as the main query searcher, making the changes visiblesoftCommit - makes index changes visible while neither fsync-ing index files nor writing a new index descriptorIOException - If there is a low-level I/O error.SolrServerExceptionpublic UpdateResponse optimize(boolean waitFlush, boolean waitSearcher) throws SolrServerException, IOException
Note: In most cases it is not required to do explicit optimize
waitFlush - block until index changes are flushed to diskwaitSearcher - block until a new searcher is opened and registered as the main query searcher, making the changes visibleIOException - If there is a low-level I/O error.SolrServerExceptionpublic UpdateResponse optimize(boolean waitFlush, boolean waitSearcher, int maxSegments) throws SolrServerException, IOException
Note: In most cases it is not required to do explicit optimize
waitFlush - block until index changes are flushed to diskwaitSearcher - block until a new searcher is opened and registered as the main query searcher, making the changes visiblemaxSegments - optimizes down to at most this number of segmentsIOException - If there is a low-level I/O error.SolrServerExceptionpublic UpdateResponse rollback() throws SolrServerException, IOException
Note that this is not a true rollback as in databases. Content you have previously added may have been committed due to autoCommit, buffer full, other client performing a commit etc.
IOException - If there is a low-level I/O error.SolrServerExceptionpublic UpdateResponse deleteById(String id) throws SolrServerException, IOException
id - the ID of the document to deleteIOException - If there is a low-level I/O error.SolrServerExceptionpublic UpdateResponse deleteById(String id, int commitWithinMs) throws SolrServerException, IOException
id - the ID of the document to deletecommitWithinMs - max time (in ms) before a commit will happenIOException - If there is a low-level I/O error.SolrServerExceptionpublic UpdateResponse deleteById(List<String> ids) throws SolrServerException, IOException
ids - the list of document IDs to deleteIOException - If there is a low-level I/O error.SolrServerExceptionpublic UpdateResponse deleteById(List<String> ids, int commitWithinMs) throws SolrServerException, IOException
ids - the list of document IDs to deletecommitWithinMs - max time (in ms) before a commit will happenIOException - If there is a low-level I/O error.SolrServerExceptionpublic UpdateResponse deleteByQuery(String query) throws SolrServerException, IOException
query - the query expressing what documents to deleteIOException - If there is a low-level I/O error.SolrServerExceptionpublic UpdateResponse deleteByQuery(String query, int commitWithinMs) throws SolrServerException, IOException
query - the query expressing what documents to deletecommitWithinMs - max time (in ms) before a commit will happenIOException - If there is a low-level I/O error.SolrServerExceptionpublic SolrPingResponse ping() throws SolrServerException, IOException
IOException - If there is a low-level I/O error.SolrServerExceptionpublic QueryResponse query(SolrParams params) throws SolrServerException
params - an object holding all key/value parameters to send along the requestSolrServerExceptionpublic QueryResponse query(SolrParams params, SolrRequest.METHOD method) throws SolrServerException
params - an object holding all key/value parameters to send along the requestmethod - specifies the HTTP method to use for the request, such as GET or POSTSolrServerExceptionpublic QueryResponse queryAndStreamResponse(SolrParams params, StreamingResponseCallback callback) throws SolrServerException, IOException
SolrServerExceptionIOExceptionpublic abstract NamedList<Object> request(SolrRequest request) throws SolrServerException, IOException
SolrServerExceptionIOExceptionpublic DocumentObjectBinder getBinder()
public abstract void shutdown()
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.