Class PatchedLBHttpSolrClient.Builder
- java.lang.Object
-
- org.apache.solr.client.solrj.impl.SolrClientBuilder<org.apache.solr.client.solrj.impl.LBHttpSolrClient.Builder>
-
- org.apache.solr.client.solrj.impl.LBHttpSolrClient.Builder
-
- de.hybris.platform.solrfacetsearch.solr.impl.PatchedLBHttpSolrClient.Builder
-
- Enclosing class:
- PatchedLBHttpSolrClient
public static class PatchedLBHttpSolrClient.Builder extends org.apache.solr.client.solrj.impl.LBHttpSolrClient.Builder
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<java.lang.String>baseSolrUrlsprotected java.lang.IntegerconnectionTimeoutMillisprotected org.apache.http.client.HttpClienthttpClientprotected org.apache.solr.client.solrj.impl.HttpSolrClient.BuilderhttpSolrClientBuilderprotected org.apache.solr.client.solrj.ResponseParserresponseParserprotected java.lang.IntegersocketTimeoutMillis
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PatchedLBHttpSolrClientbuild()Create aHttpSolrClientbased on provided configuration.org.apache.solr.client.solrj.impl.HttpSolrClient.BuildergetHttpSolrClientBuilder()PatchedLBHttpSolrClient.BuildergetThis()PatchedLBHttpSolrClient.BuilderwithBaseSolrUrl(java.lang.String baseSolrUrl)Provide a Solr endpoint to be used when configuringLBHttpSolrClientinstances.PatchedLBHttpSolrClient.BuilderwithBaseSolrUrls(java.lang.String... solrUrls)Provide Solr endpoints to be used when configuringLBHttpSolrClientinstances.PatchedLBHttpSolrClient.BuilderwithHttpSolrClientBuilder(org.apache.solr.client.solrj.impl.HttpSolrClient.Builder builder)Provides aHttpSolrClient.Builderto be used for building the internally used clients.
-
-
-
Field Detail
-
baseSolrUrls
protected final java.util.List<java.lang.String> baseSolrUrls
-
httpSolrClientBuilder
protected org.apache.solr.client.solrj.impl.HttpSolrClient.Builder httpSolrClientBuilder
-
httpClient
protected org.apache.http.client.HttpClient httpClient
-
responseParser
protected org.apache.solr.client.solrj.ResponseParser responseParser
-
connectionTimeoutMillis
protected java.lang.Integer connectionTimeoutMillis
-
socketTimeoutMillis
protected java.lang.Integer socketTimeoutMillis
-
-
Method Detail
-
getHttpSolrClientBuilder
public org.apache.solr.client.solrj.impl.HttpSolrClient.Builder getHttpSolrClientBuilder()
- Overrides:
getHttpSolrClientBuilderin classorg.apache.solr.client.solrj.impl.LBHttpSolrClient.Builder
-
withBaseSolrUrl
public PatchedLBHttpSolrClient.Builder withBaseSolrUrl(java.lang.String baseSolrUrl)
Provide a Solr endpoint to be used when configuringLBHttpSolrClientinstances. 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 coreSolrClient 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.- Overrides:
withBaseSolrUrlin classorg.apache.solr.client.solrj.impl.LBHttpSolrClient.Builder
-
withBaseSolrUrls
public PatchedLBHttpSolrClient.Builder withBaseSolrUrls(java.lang.String... solrUrls)
Provide Solr endpoints to be used when configuringLBHttpSolrClientinstances. 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 coreSolrClient 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.- Overrides:
withBaseSolrUrlsin classorg.apache.solr.client.solrj.impl.LBHttpSolrClient.Builder
-
withHttpSolrClientBuilder
public PatchedLBHttpSolrClient.Builder withHttpSolrClientBuilder(org.apache.solr.client.solrj.impl.HttpSolrClient.Builder builder)
Provides aHttpSolrClient.Builderto be used for building the internally used clients.- Overrides:
withHttpSolrClientBuilderin classorg.apache.solr.client.solrj.impl.LBHttpSolrClient.Builder
-
build
public PatchedLBHttpSolrClient build()
Create aHttpSolrClientbased on provided configuration.- Overrides:
buildin classorg.apache.solr.client.solrj.impl.LBHttpSolrClient.Builder
-
getThis
public PatchedLBHttpSolrClient.Builder getThis()
- Overrides:
getThisin classorg.apache.solr.client.solrj.impl.LBHttpSolrClient.Builder
-
-