HttpSolrServer
instead.public class CommonsHttpSolrServer extends SolrServer
CommonsHttpSolrServer
uses the Apache Commons HTTP Client to connect to solr.
SolrServer server = new CommonsHttpSolrServer( url );
Modifier and Type | Field and Description |
---|---|
protected String |
_baseURL
Deprecated.
The URL of the Solr server.
|
protected ModifiableSolrParams |
_invariantParams
Deprecated.
Default value: null / empty.
|
protected ResponseParser |
_parser
Deprecated.
Default response parser is BinaryResponseParser
This parser represents the default Response Parser chosen to
parse the response if the parser were not specified as part of
the request.
|
static String |
AGENT
Deprecated.
User-Agent String as identified by the HTTP request by the
HttpClient to the Solr
server from the client. |
protected RequestWriter |
requestWriter
Deprecated.
The RequestWriter used to write all requests to Solr
|
Constructor and Description |
---|
CommonsHttpSolrServer(String solrServerUrl)
Deprecated.
|
CommonsHttpSolrServer(String solrServerUrl,
org.apache.commons.httpclient.HttpClient httpClient)
Deprecated.
Talk to the Solr server via the given HttpClient.
|
CommonsHttpSolrServer(String solrServerUrl,
org.apache.commons.httpclient.HttpClient httpClient,
boolean useMultiPartPost)
Deprecated.
|
CommonsHttpSolrServer(String solrServerUrl,
org.apache.commons.httpclient.HttpClient httpClient,
ResponseParser parser)
Deprecated.
|
CommonsHttpSolrServer(URL baseURL)
Deprecated.
|
CommonsHttpSolrServer(URL baseURL,
org.apache.commons.httpclient.HttpClient client)
Deprecated.
|
CommonsHttpSolrServer(URL baseURL,
org.apache.commons.httpclient.HttpClient client,
boolean useMultiPartPost)
Deprecated.
|
CommonsHttpSolrServer(URL baseURL,
org.apache.commons.httpclient.HttpClient client,
ResponseParser parser,
boolean useMultiPartPost)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
UpdateResponse |
add(Iterator<SolrInputDocument> docIterator)
Deprecated.
Adds the documents supplied by the given iterator.
|
UpdateResponse |
add(Iterator<SolrInputDocument> docIterator,
int commitWithinMs)
Deprecated.
Adds the documents supplied by the given iterator, specifying max time before they become committed
|
UpdateResponse |
addBeans(Iterator<?> beanIterator)
Deprecated.
Adds the beans supplied by the given iterator
|
UpdateResponse |
addBeans(Iterator<?> beanIterator,
int commitWithinMs)
Deprecated.
Adds the beans supplied by the given iterator, specifying max time before they become committed
|
String |
getBaseURL()
Deprecated.
|
org.apache.commons.httpclient.HttpClient |
getHttpClient()
Deprecated.
|
ModifiableSolrParams |
getInvariantParams()
Deprecated.
Retrieve the default list of parameters are added to every request regardless.
|
ResponseParser |
getParser()
Deprecated.
|
NamedList<Object> |
request(SolrRequest request)
Deprecated.
Process the request.
|
NamedList<Object> |
request(SolrRequest request,
ResponseParser processor)
Deprecated.
|
void |
setAllowCompression(boolean allowCompression)
Deprecated.
set allowCompression.
|
void |
setBaseURL(String baseURL)
Deprecated.
|
void |
setConnectionManagerTimeout(int timeout)
Deprecated.
|
void |
setConnectionManagerTimeout(long timeout)
Deprecated.
Sets soTimeout (read timeout) on the underlying
HttpConnectionManager.
|
void |
setConnectionTimeout(int timeout)
Deprecated.
set connectionTimeout on the underlying HttpConnectionManager
|
void |
setDefaultMaxConnectionsPerHost(int connections)
Deprecated.
set maxConnectionsPerHost on the underlying HttpConnectionManager
|
void |
setFollowRedirects(boolean followRedirects)
Deprecated.
set followRedirects.
|
void |
setMaxRetries(int maxRetries)
Deprecated.
set maximum number of retries to attempt in the event of
transient errors.
|
void |
setMaxTotalConnections(int connections)
Deprecated.
set maxTotalConnection on the underlying HttpConnectionManager
|
void |
setParser(ResponseParser processor)
Deprecated.
Note: This setter method is not thread-safe.
|
void |
setRequestWriter(RequestWriter requestWriter)
Deprecated.
|
void |
setSoTimeout(int timeout)
Deprecated.
Sets soTimeout (read timeout) on the underlying
HttpConnectionManager.
|
add, add, add, add, addBean, addBean, addBeans, addBeans, commit, commit, deleteById, deleteById, deleteById, deleteById, deleteByQuery, deleteByQuery, getBinder, optimize, optimize, optimize, ping, query, query, rollback
public static final String AGENT
HttpClient
to the Solr
server from the client.protected String _baseURL
protected ModifiableSolrParams _invariantParams
protected ResponseParser _parser
BinaryResponseParser
protected RequestWriter requestWriter
RequestWriter
public CommonsHttpSolrServer(String solrServerUrl) throws MalformedURLException
solrServerUrl
- The URL of the Solr server. For
example, "http://localhost:8983/solr/
"
if you are using the standard distribution Solr webapp
on your local machine.MalformedURLException
public CommonsHttpSolrServer(String solrServerUrl, org.apache.commons.httpclient.HttpClient httpClient) throws MalformedURLException
MalformedURLException
public CommonsHttpSolrServer(String solrServerUrl, org.apache.commons.httpclient.HttpClient httpClient, boolean useMultiPartPost) throws MalformedURLException
MalformedURLException
public CommonsHttpSolrServer(String solrServerUrl, org.apache.commons.httpclient.HttpClient httpClient, ResponseParser parser) throws MalformedURLException
MalformedURLException
public CommonsHttpSolrServer(URL baseURL)
baseURL
- The URL of the Solr server. For example,
"http://localhost:8983/solr/
" if you are using the
standard distribution Solr webapp on your local machine.public CommonsHttpSolrServer(URL baseURL, org.apache.commons.httpclient.HttpClient client)
public CommonsHttpSolrServer(URL baseURL, org.apache.commons.httpclient.HttpClient client, boolean useMultiPartPost)
useMultiPartPost
public CommonsHttpSolrServer(URL baseURL, org.apache.commons.httpclient.HttpClient client, ResponseParser parser, boolean useMultiPartPost)
useMultiPartPost
,
_parser
public NamedList<Object> request(SolrRequest request) throws SolrServerException, IOException
SolrRequest.getResponseParser()
is null, then use
getParser()
request
in class SolrServer
request
- The SolrRequest
to processNamedList
resultSolrServerException
IOException
request(org.apache.solr.client.solrj.SolrRequest, org.apache.solr.client.solrj.ResponseParser)
public NamedList<Object> request(SolrRequest request, ResponseParser processor) throws SolrServerException, IOException
SolrServerException
IOException
public ModifiableSolrParams getInvariantParams()
_invariantParams
public String getBaseURL()
public void setBaseURL(String baseURL)
public ResponseParser getParser()
public void setParser(ResponseParser processor)
processor
- Default Response Parser chosen to parse the response if the parser were not specified as part of the request.SolrRequest.getResponseParser()
public org.apache.commons.httpclient.HttpClient getHttpClient()
public void setConnectionTimeout(int timeout)
timeout
- Timeout in milliseconds@Deprecated public void setConnectionManagerTimeout(int timeout)
setConnectionManagerTimeout(long)
timeout
- Timeout in millisecondspublic void setConnectionManagerTimeout(long timeout)
timeout
- Timeout in millisecondspublic void setSoTimeout(int timeout)
timeout
- Timeout in millisecondspublic void setDefaultMaxConnectionsPerHost(int connections)
public void setMaxTotalConnections(int connections)
public void setFollowRedirects(boolean followRedirects)
_followRedirects
public void setAllowCompression(boolean allowCompression)
_allowCompression
public void setMaxRetries(int maxRetries)
maxRetries
- No more than 1 recommended_maxRetries
public void setRequestWriter(RequestWriter requestWriter)
public UpdateResponse add(Iterator<SolrInputDocument> docIterator) throws SolrServerException, IOException
docIterator
- the iterator which returns SolrInputDocument instancesSolrServerException
IOException
public UpdateResponse add(Iterator<SolrInputDocument> docIterator, int commitWithinMs) throws SolrServerException, IOException
docIterator
- the iterator which returns SolrInputDocument instancescommitWithinMs
- the time in milliseconds before a commit automatically is triggeredSolrServerException
IOException
public UpdateResponse addBeans(Iterator<?> beanIterator) throws SolrServerException, IOException
beanIterator
- the iterator which returns BeansSolrServerException
IOException
public UpdateResponse addBeans(Iterator<?> beanIterator, int commitWithinMs) throws SolrServerException, IOException
commitWithinMs
- the time in milliseconds before a commit automatically is triggeredbeanIterator
- the iterator which returns BeansSolrServerException
IOException