Class HttpSolrClient
- java.lang.Object
- 
- org.apache.solr.client.solrj.SolrClient
- 
- org.apache.solr.client.solrj.impl.BaseHttpSolrClient
- 
- org.apache.solr.client.solrj.impl.HttpSolrClient
 
 
 
- 
- All Implemented Interfaces:
- Closeable,- Serializable,- AutoCloseable
 - Direct Known Subclasses:
- DelegationTokenHttpSolrClient
 
 @Deprecated(since="9.0") public class HttpSolrClient extends BaseHttpSolrClient Deprecated.Please useHttp2SolrClientorHttpJdkSolrClientA SolrClient implementation that talks directly to a Solr server via Apache HTTP client- See Also:
- Serialized Form
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classHttpSolrClient.BuilderDeprecated.Please useHttp2SolrClientstatic classHttpSolrClient.HttpUriRequestResponseDeprecated.- 
Nested classes/interfaces inherited from class org.apache.solr.client.solrj.impl.BaseHttpSolrClientBaseHttpSolrClient.RemoteExecutionException, BaseHttpSolrClient.RemoteSolrException
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected StringbaseUrlDeprecated.The URL of the Solr server.protected ModifiableSolrParamsinvariantParamsDeprecated.Default value: null / empty.protected ResponseParserparserDeprecated.Default response parser is BinaryResponseParserprotected RequestWriterrequestWriterDeprecated.The RequestWriter used to write all requests to Solrprotected static Set<Integer>UNMATCHED_ACCEPTED_ERROR_CODESDeprecated.- 
Fields inherited from class org.apache.solr.client.solrj.SolrClientdefaultCollection
 
- 
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedHttpSolrClient(HttpSolrClient.Builder builder)Deprecated.Use the builder to create this client
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected ModifiableSolrParamscalculateQueryParams(Set<String> queryParamNames, ModifiableSolrParams wparams)Deprecated.voidclose()Deprecated.Close theHttpClientConnectionManagerfrom the internal client.protected org.apache.http.client.methods.HttpRequestBasecreateMethod(SolrRequest<?> request, String collection)Deprecated.protected NamedList<Object>executeMethod(org.apache.http.client.methods.HttpRequestBase method, Principal userPrincipal, ResponseParser processor, boolean isV2Api)Deprecated.StringgetBaseURL()Deprecated.Typically looks likehttp://localhost:8983/solr(no core or collection)org.apache.http.client.HttpClientgetHttpClient()Deprecated.Return the HttpClient this instance uses.ModifiableSolrParamsgetInvariantParams()Deprecated.Retrieve the default list of parameters are added to every request regardless.ResponseParsergetParser()Deprecated.Set<String>getQueryParams()Deprecated.Set<String>getUrlParamNames()Deprecated.HttpSolrClient.HttpUriRequestResponsehttpUriRequest(SolrRequest<?> request)Deprecated.HttpSolrClient.HttpUriRequestResponsehttpUriRequest(SolrRequest<?> request, ResponseParser processor)Deprecated.booleanisUseMultiPartPost()Deprecated.NamedList<Object>request(SolrRequest<?> request, String collection)Deprecated.Process the request.NamedList<Object>request(SolrRequest<?> request, ResponseParser processor)Deprecated.NamedList<Object>request(SolrRequest<?> request, ResponseParser processor, String collection)Deprecated.voidsetBaseURL(String baseUrl)Deprecated.useHttpSolrClient.BuilderinsteadvoidsetFollowRedirects(boolean followRedirects)Deprecated.useSolrClientBuilder.withFollowRedirects(boolean)Redirects(boolean)} insteadvoidsetParser(ResponseParser parser)Deprecated.voidsetRequestWriter(RequestWriter requestWriter)Deprecated.voidsetUseMultiPartPost(boolean useMultiPartPost)Deprecated.useSolrClientBuilder.allowMultiPartPost(Boolean)instead- 
Methods inherited from class org.apache.solr.client.solrj.SolrClientadd, add, add, add, add, add, add, add, add, add, addBean, addBean, addBean, addBean, addBeans, addBeans, addBeans, addBeans, addBeans, addBeans, commit, commit, commit, commit, commit, commit, deleteById, deleteById, deleteById, deleteById, deleteById, deleteById, deleteById, deleteById, deleteByQuery, deleteByQuery, deleteByQuery, deleteByQuery, getBinder, getById, getById, getById, getById, getById, getById, getById, getById, getContext, getDefaultCollection, optimize, optimize, optimize, optimize, optimize, optimize, ping, ping, query, query, query, query, queryAndStreamResponse, queryAndStreamResponse, queryAndStreamResponse, request, rollback, rollback
 
- 
 
- 
- 
- 
Field Detail- 
UNMATCHED_ACCEPTED_ERROR_CODESprotected static final Set<Integer> UNMATCHED_ACCEPTED_ERROR_CODES Deprecated.
 - 
baseUrlprotected volatile String baseUrl Deprecated.The URL of the Solr server.
 - 
invariantParamsprotected ModifiableSolrParams invariantParams Deprecated.Default value: null / empty.Parameters that are added to every request regardless. This may be a place to add something like an authentication token. 
 - 
parserprotected volatile ResponseParser parser Deprecated.Default response parser is BinaryResponseParserThis parser represents the default Response Parser chosen to parse the response if the parser were not specified as part of the request. - See Also:
- BinaryResponseParser
 
 - 
requestWriterprotected volatile RequestWriter requestWriter Deprecated.The RequestWriter used to write all requests to Solr- See Also:
- RequestWriter
 
 
- 
 - 
Constructor Detail- 
HttpSolrClientprotected HttpSolrClient(HttpSolrClient.Builder builder) Deprecated.Use the builder to create this client
 
- 
 - 
Method Detail- 
getQueryParams@Deprecated public Set<String> getQueryParams() Deprecated.
 - 
requestpublic NamedList<Object> request(SolrRequest<?> request, String collection) throws SolrServerException, IOException Deprecated.Process the request. IfSolrRequest.getResponseParser()is null, then usegetParser()- Specified by:
- requestin class- SolrClient
- Parameters:
- request- The- SolrRequestto process
- collection- the collection to execute the request against
- Returns:
- The NamedListresult
- Throws:
- IOException- If there is a low-level I/O error.
- SolrServerException- if there is an error on the server
- See Also:
- request(org.apache.solr.client.solrj.SolrRequest, org.apache.solr.client.solrj.ResponseParser)
 
 - 
requestpublic NamedList<Object> request(SolrRequest<?> request, ResponseParser processor) throws SolrServerException, IOException Deprecated.- Throws:
- SolrServerException
- IOException
 
 - 
requestpublic NamedList<Object> request(SolrRequest<?> request, ResponseParser processor, String collection) throws SolrServerException, IOException Deprecated.- Throws:
- SolrServerException
- IOException
 
 - 
httpUriRequestpublic HttpSolrClient.HttpUriRequestResponse httpUriRequest(SolrRequest<?> request) throws SolrServerException, IOException Deprecated.- Throws:
- SolrServerException
- IOException
- WARNING: This API is experimental and might change in incompatible ways in the next release.
 
 - 
httpUriRequestpublic HttpSolrClient.HttpUriRequestResponse httpUriRequest(SolrRequest<?> request, ResponseParser processor) throws SolrServerException, IOException Deprecated.- Throws:
- SolrServerException
- IOException
- WARNING: This API is experimental and might change in incompatible ways in the next release.
 
 - 
calculateQueryParamsprotected ModifiableSolrParams calculateQueryParams(Set<String> queryParamNames, ModifiableSolrParams wparams) Deprecated.
 - 
createMethodprotected org.apache.http.client.methods.HttpRequestBase createMethod(SolrRequest<?> request, String collection) throws IOException, SolrServerException Deprecated.- Throws:
- IOException
- SolrServerException
 
 - 
executeMethodprotected NamedList<Object> executeMethod(org.apache.http.client.methods.HttpRequestBase method, Principal userPrincipal, ResponseParser processor, boolean isV2Api) throws SolrServerException Deprecated.- Throws:
- SolrServerException
 
 - 
getInvariantParamspublic ModifiableSolrParams getInvariantParams() Deprecated.Retrieve the default list of parameters are added to every request regardless.- See Also:
- invariantParams
 
 - 
getBaseURLpublic String getBaseURL() Deprecated.Typically looks likehttp://localhost:8983/solr(no core or collection)
 - 
setBaseURL@Deprecated public void setBaseURL(String baseUrl) Deprecated.useHttpSolrClient.BuilderinsteadChange the base-url used when sending requests to Solr.Two different paths can be specified as a part of this URL: 1) A path pointing directly at a particular core httpSolrClient.setBaseURL("http://my-solr-server:8983/solr/core1"); QueryResponse resp = httpSolrClient.query(new SolrQuery("*:*"));Note that when a core is provided in the base URL, queries and other requests can be made without mentioning the core explicitly. However, the client can only send requests to that core.2) The path of the root Solr path ("/solr") httpSolrClient.setBaseURL("http://my-solr-server:8983/solr"); QueryResponse resp = httpSolrClient.query("core1", new SolrQuery("*:*"));In this case the client is more flexible and can be used to send requests to any cores. The cost of this is that the core must be specified on each request.SolrClientsetters can be unsafe when the involvedSolrClientis used in multiple threads simultaneously.
 - 
getParserpublic ResponseParser getParser() Deprecated.
 - 
setParser@Deprecated public void setParser(ResponseParser parser) Deprecated.Note: This setter method is not thread-safe.- Parameters:
- parser- Default Response Parser chosen to parse the response if the parser were not specified as part of the request.
- See Also:
- SolrRequest.getResponseParser()
 
 - 
getHttpClientpublic org.apache.http.client.HttpClient getHttpClient() Deprecated.Return the HttpClient this instance uses.
 - 
setFollowRedirects@Deprecated public void setFollowRedirects(boolean followRedirects) Deprecated.useSolrClientBuilder.withFollowRedirects(boolean)Redirects(boolean)} insteadConfigure whether the client should follow redirects or not.This defaults to false under the assumption that if you are following a redirect to get to a Solr installation, something is configured wrong somewhere. 
 - 
setRequestWriter@Deprecated public void setRequestWriter(RequestWriter requestWriter) Deprecated.Choose theRequestWriterto use.By default, BinaryRequestWriteris used.Note: This setter method is not thread-safe. 
 - 
closepublic void close() throws IOExceptionDeprecated.Close theHttpClientConnectionManagerfrom the internal client.- Throws:
- IOException
 
 - 
isUseMultiPartPostpublic boolean isUseMultiPartPost() Deprecated.
 - 
setUseMultiPartPost@Deprecated public void setUseMultiPartPost(boolean useMultiPartPost) Deprecated.useSolrClientBuilder.allowMultiPartPost(Boolean)insteadSet the multipart connection propertiesNote: This setter method is not thread-safe. 
 
- 
 
-