Package org.apache.solr.client.solrj.impl

## Class HttpSolrClient.Builder

- java.lang.Object
- - org.apache.solr.client.solrj.impl.SolrClientBuilder<HttpSolrClient.Builder>
  - - org.apache.solr.client.solrj.impl.HttpSolrClient.Builder

Enclosing class:
  HttpSolrClient

    @Deprecated(since="9.0")
    public static class HttpSolrClient.Builder
    extends SolrClientBuilder<HttpSolrClient.Builder>

Deprecated.
Please use `Http2SolrClient`
Constructs `HttpSolrClient` instances from provided configuration.

### Field Summary

Fields
`protected String` `baseSolrUrl` Deprecated.
`protected boolean` `compression` Deprecated.
`protected ModifiableSolrParams` `invariantParams` Deprecated.

### Fields inherited from class org.apache.solr.client.solrj.impl.SolrClientBuilder

`connectionTimeoutMillis, defaultCollection, followRedirects, httpClient, requestWriter, responseParser, socketTimeoutMillis, timeToLiveSeconds, urlParamNames, useMultiPartPost`

### Constructor Summary

Constructors
`Builder()` Deprecated.
`Builder​(String baseSolrUrl)` Deprecated. Create a Builder object, based on the provided Solr URL.

### Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods
`HttpSolrClient.Builder` `allowCompression​(boolean compression)` Deprecated. Chooses whether created `HttpSolrClient`s use compression by default.
`HttpSolrClient` `build()` Deprecated. Create a `HttpSolrClient` based on provided configuration.
`HttpSolrClient.Builder` `getThis()` Deprecated. The solution for the unchecked cast warning.
`HttpSolrClient.Builder` `withBaseSolrUrl​(String baseSolrUrl)` Deprecated. Specify the base-url for the created client to use when sending requests to Solr.
`HttpSolrClient.Builder` `withInvariantParams​(ModifiableSolrParams params)` Deprecated. Adds to the set of params that the created `HttpSolrClient` will add on all requests
`HttpSolrClient.Builder` `withKerberosDelegationToken​(String delegationToken)` Deprecated. Use a delegation token for authenticating via the KerberosPlugin

### Methods inherited from class org.apache.solr.client.solrj.impl.SolrClientBuilder

`allowMultiPartPost, getConnectionTimeoutMillis, getSocketTimeoutMillis, withConnectionTimeout, withConnectionTimeout, withDefaultCollection, withFollowRedirects, withHttpClient, withRequestWriter, withResponseParser, withSocketTimeout, withSocketTimeout, withTheseParamNamesInTheUrl`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### baseSolrUrl

    protected String baseSolrUrl

Deprecated.

#### compression

    protected boolean compression

Deprecated.

#### invariantParams

    protected ModifiableSolrParams invariantParams

Deprecated.

### Constructor Detail

#### Builder

    public Builder()

Deprecated.

#### Builder

    public Builder​(String baseSolrUrl)

Deprecated.
Create a Builder object, based on the provided Solr URL.

Two different paths can be specified as a part of this URL:

1) A path pointing directly at a particular core

       SolrClient client = new HttpSolrClient.Builder("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 = new HttpSolrClient.Builder("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 be specified on all requests.

By default, compression is not enabled on created HttpSolrClient objects. By default, redirects are not followed in created HttpSolrClient objects. By default, `BinaryRequestWriter` is used for composing requests. By default, `BinaryResponseParser` is used for parsing responses.

Parameters:
  `baseSolrUrl` - the base URL of the Solr server that will be targeted by any created clients.

### Method Detail

#### withBaseSolrUrl

    public HttpSolrClient.Builder withBaseSolrUrl​(String baseSolrUrl)

Deprecated.
Specify the base-url for the created client to use 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

       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.

#### allowCompression

    public HttpSolrClient.Builder allowCompression​(boolean compression)

Deprecated.
Chooses whether created `HttpSolrClient`s use compression by default.

#### withKerberosDelegationToken

    public HttpSolrClient.Builder withKerberosDelegationToken​(String delegationToken)

Deprecated.
Use a delegation token for authenticating via the KerberosPlugin

#### withInvariantParams

    public HttpSolrClient.Builder withInvariantParams​(ModifiableSolrParams params)

Deprecated.
Adds to the set of params that the created `HttpSolrClient` will add on all requests

Parameters:
  `params` - a set of parameters to add to the invariant-params list. These params must be unique and may not duplicate a param already in the invariant list.

#### build

    public HttpSolrClient build()

Deprecated.
Create a `HttpSolrClient` based on provided configuration.

#### getThis

    public HttpSolrClient.Builder getThis()

Deprecated.
Description copied from class: `SolrClientBuilder`
The solution for the unchecked cast warning.

Specified by:
  `getThis` in class `SolrClientBuilder<HttpSolrClient.Builder>`