|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.solr.client.solrj.SolrServer
org.apache.solr.client.solrj.impl.CommonsHttpSolrServer
public class CommonsHttpSolrServer
Field Summary | |
---|---|
protected String |
_baseURL
The URL of the Solr server. |
protected ModifiableSolrParams |
_invariantParams
Default value: null / empty. |
protected ResponseParser |
_parser
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
User-Agent String as identified by the HTTP request by the HttpClient to the Solr
server from the client. |
protected RequestWriter |
requestWriter
The RequestWriter used to write all requests to Solr |
Constructor Summary | |
---|---|
CommonsHttpSolrServer(String solrServerUrl)
|
|
CommonsHttpSolrServer(String solrServerUrl,
org.apache.commons.httpclient.HttpClient httpClient)
Talk to the Solr server via the given HttpClient. |
|
CommonsHttpSolrServer(String solrServerUrl,
org.apache.commons.httpclient.HttpClient httpClient,
boolean useMultiPartPost)
|
|
CommonsHttpSolrServer(String solrServerUrl,
org.apache.commons.httpclient.HttpClient httpClient,
ResponseParser parser)
|
|
CommonsHttpSolrServer(URL baseURL)
|
|
CommonsHttpSolrServer(URL baseURL,
org.apache.commons.httpclient.HttpClient client)
|
|
CommonsHttpSolrServer(URL baseURL,
org.apache.commons.httpclient.HttpClient client,
boolean useMultiPartPost)
|
|
CommonsHttpSolrServer(URL baseURL,
org.apache.commons.httpclient.HttpClient client,
ResponseParser parser,
boolean useMultiPartPost)
|
Method Summary | |
---|---|
UpdateResponse |
add(Iterator<SolrInputDocument> docIterator)
Adds the documents supplied by the given iterator. |
UpdateResponse |
addBeans(Iterator<?> beanIterator)
Adds the beans supplied by the given iterator. |
String |
getBaseURL()
|
org.apache.commons.httpclient.HttpClient |
getHttpClient()
|
ModifiableSolrParams |
getInvariantParams()
Retrieve the default list of parameters are added to every request regardless. |
ResponseParser |
getParser()
|
NamedList<Object> |
request(SolrRequest request)
Process the request. |
NamedList<Object> |
request(SolrRequest request,
ResponseParser processor)
|
void |
setAllowCompression(boolean allowCompression)
set allowCompression. |
void |
setBaseURL(String baseURL)
|
void |
setConnectionManagerTimeout(int timeout)
Deprecated. Use setConnectionManagerTimeout(long) |
void |
setConnectionManagerTimeout(long timeout)
Sets soTimeout (read timeout) on the underlying HttpConnectionManager. |
void |
setConnectionTimeout(int timeout)
set connectionTimeout on the underlying HttpConnectionManager |
void |
setDefaultMaxConnectionsPerHost(int connections)
set maxConnectionsPerHost on the underlying HttpConnectionManager |
void |
setFollowRedirects(boolean followRedirects)
set followRedirects. |
void |
setMaxRetries(int maxRetries)
set maximum number of retries to attempt in the event of transient errors. |
void |
setMaxTotalConnections(int connections)
set maxTotalConnection on the underlying HttpConnectionManager |
void |
setParser(ResponseParser processor)
Note: This setter method is not thread-safe. |
void |
setRequestWriter(RequestWriter requestWriter)
|
void |
setSoTimeout(int timeout)
Sets soTimeout (read timeout) on the underlying HttpConnectionManager. |
Methods inherited from class org.apache.solr.client.solrj.SolrServer |
---|
add, add, addBean, addBeans, commit, commit, deleteById, deleteById, deleteByQuery, getBinder, optimize, optimize, optimize, ping, query, query, rollback |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
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
Method Detail |
---|
public NamedList<Object> request(SolrRequest request) throws SolrServerException, IOException
SolrRequest.getResponseParser()
is null, then use
getParser()
request
in class SolrServer
request
- The SolrRequest
to process
NamedList
result
SolrServerException
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 instances
SolrServerException
IOException
public UpdateResponse addBeans(Iterator<?> beanIterator) throws SolrServerException, IOException
beanIterator
- the iterator which returns Beans
SolrServerException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |