public static class PatchedLBHttpSolrClient.Builder
extends LBHttpSolrClient.Builder
| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<java.lang.String> |
baseSolrUrls |
protected java.lang.Integer |
connectionTimeoutMillis |
protected HttpClient |
httpClient |
protected HttpSolrClient.Builder |
httpSolrClientBuilder |
protected ResponseParser |
responseParser |
protected java.lang.Integer |
socketTimeoutMillis |
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
PatchedLBHttpSolrClient |
build()
Create a
HttpSolrClient based on provided configuration. |
HttpSolrClient.Builder |
getHttpSolrClientBuilder() |
PatchedLBHttpSolrClient.Builder |
getThis() |
PatchedLBHttpSolrClient.Builder |
withBaseSolrUrl(java.lang.String baseSolrUrl)
Provide a Solr endpoint to be used when configuring
LBHttpSolrClient instances. |
PatchedLBHttpSolrClient.Builder |
withBaseSolrUrls(java.lang.String... solrUrls)
Provide Solr endpoints to be used when configuring
LBHttpSolrClient instances. |
PatchedLBHttpSolrClient.Builder |
withHttpSolrClientBuilder(HttpSolrClient.Builder builder)
Provides a
HttpSolrClient.Builder to be used for building the internally used clients. |
protected final java.util.List<java.lang.String> baseSolrUrls
protected HttpSolrClient.Builder httpSolrClientBuilder
protected HttpClient httpClient
protected ResponseParser responseParser
protected java.lang.Integer connectionTimeoutMillis
protected java.lang.Integer socketTimeoutMillis
public HttpSolrClient.Builder getHttpSolrClientBuilder()
public PatchedLBHttpSolrClient.Builder withBaseSolrUrl(java.lang.String baseSolrUrl)
LBHttpSolrClient instances.
Method may be called multiple times. All provided values will be used.
Two different paths can be specified as a part of the URL:
1) A path pointing directly at a particular core
SolrClient client = builder.withBaseSolrUrl("http://my-solr-server:8983/solr/core1").build();
QueryResponse resp = client.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")
SolrClient client = builder.withBaseSolrUrl("http://my-solr-server:8983/solr").build();
QueryResponse resp = client.query("core1", new SolrQuery("*:*"));
In this case the client is more flexible and can be used to send requests to any cores. This flexibility though
requires that the core is specified on all requests.public PatchedLBHttpSolrClient.Builder withBaseSolrUrls(java.lang.String... solrUrls)
LBHttpSolrClient instances.
Method may be called multiple times. All provided values will be used.
Two different paths can be specified as a part of each URL:
1) A path pointing directly at a particular core
SolrClient client = builder.withBaseSolrUrls("http://my-solr-server:8983/solr/core1").build();
QueryResponse resp = client.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")
SolrClient client = builder.withBaseSolrUrls("http://my-solr-server:8983/solr").build();
QueryResponse resp = client.query("core1", new SolrQuery("*:*"));
In this case the client is more flexible and can be used to send requests to any cores. This flexibility though
requires that the core is specified on all requests.public PatchedLBHttpSolrClient.Builder withHttpSolrClientBuilder(HttpSolrClient.Builder builder)
HttpSolrClient.Builder to be used for building the internally used clients.public PatchedLBHttpSolrClient build()
HttpSolrClient based on provided configuration.public PatchedLBHttpSolrClient.Builder getThis()
Copyright © 2018 SAP SE. All Rights Reserved.