Class PatchedLBHttpSolrClient.Builder

java.lang.Object
org.apache.solr.client.solrj.impl.SolrClientBuilder<PatchedLBHttpSolrClient.Builder>
de.hybris.platform.solrfacetsearch.solr.impl.PatchedLBHttpSolrClient.Builder
Enclosing class:
PatchedLBHttpSolrClient

public static class PatchedLBHttpSolrClient.Builder extends org.apache.solr.client.solrj.impl.SolrClientBuilder<PatchedLBHttpSolrClient.Builder>
Constructs PatchedLBHttpSolrClient instances from provided configuration.
  • Field Details

    • baseSolrUrls

      protected final List<String> baseSolrUrls
    • httpSolrClientBuilder

      protected org.apache.solr.client.solrj.impl.HttpSolrClient.Builder httpSolrClientBuilder
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • getHttpSolrClientBuilder

      public org.apache.solr.client.solrj.impl.HttpSolrClient.Builder getHttpSolrClientBuilder()
    • withBaseSolrUrl

      public PatchedLBHttpSolrClient.Builder withBaseSolrUrl(String baseSolrUrl)
      Provide a Solr endpoint to be used when configuring PatchedLBHttpSolrClient 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.
    • withBaseSolrUrls

      public PatchedLBHttpSolrClient.Builder withBaseSolrUrls(String... solrUrls)
      Provide Solr endpoints to be used when configuring PatchedLBHttpSolrClient 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.
    • withHttpSolrClientBuilder

      public PatchedLBHttpSolrClient.Builder withHttpSolrClientBuilder(org.apache.solr.client.solrj.impl.HttpSolrClient.Builder builder)
      Provides a HttpSolrClient.Builder to be used for building the internally used clients.
    • build

      public PatchedLBHttpSolrClient build()
      Create a HttpSolrClient based on provided configuration.
    • getThis

      Specified by:
      getThis in class org.apache.solr.client.solrj.impl.SolrClientBuilder<PatchedLBHttpSolrClient.Builder>