SearchClientBuilder Class

  • java.lang.Object
    • com.azure.search.documents.SearchClientBuilder

Implements

public final class SearchClientBuilder
implements HttpTrait<SearchClientBuilder>, ConfigurationTrait<SearchClientBuilder>, TokenCredentialTrait<SearchClientBuilder>, KeyCredentialTrait<SearchClientBuilder>, EndpointTrait<SearchClientBuilder>

A builder for creating a new instance of the SearchClient type.

Constructor Summary

Constructor Description
SearchClientBuilder()

Create an instance of the SearchClientBuilder.

Method Summary

Modifier and Type Method and Description
SearchClientBuilder addPolicy(HttpPipelinePolicy customPolicy)

.

SearchClientBuilder audience(SearchAudience audience)

Sets the Audience to use for authentication with Microsoft Entra ID.

SearchAsyncClient buildAsyncClient()

Builds an instance of SearchAsyncClient class.

SearchClient buildClient()

Builds an instance of SearchClient class.

SearchClientBuilder clientOptions(ClientOptions clientOptions)

.

SearchClientBuilder configuration(Configuration configuration)

.

SearchClientBuilder credential(KeyCredential keyCredential)

.

SearchClientBuilder credential(TokenCredential tokenCredential)

.

SearchClientBuilder endpoint(String endpoint)

.

SearchClientBuilder httpClient(HttpClient httpClient)

.

SearchClientBuilder httpLogOptions(HttpLogOptions httpLogOptions)

.

SearchClientBuilder indexName(String indexName)

Sets The name of the index.

SearchClientBuilder pipeline(HttpPipeline pipeline)

.

SearchClientBuilder retryOptions(RetryOptions retryOptions)

.

SearchClientBuilder retryPolicy(RetryPolicy retryPolicy)

Sets The retry policy that will attempt to retry failed requests, if applicable.

SearchClientBuilder serviceVersion(SearchServiceVersion serviceVersion)

Sets Service version.

Methods inherited from java.lang.Object

Constructor Details

SearchClientBuilder

public SearchClientBuilder()

Create an instance of the SearchClientBuilder.

Method Details

addPolicy

public SearchClientBuilder addPolicy(HttpPipelinePolicy customPolicy)

.

Parameters:

customPolicy

audience

public SearchClientBuilder audience(SearchAudience audience)

Sets the Audience to use for authentication with Microsoft Entra ID.

If audience is null the public cloud audience will be assumed.

Parameters:

audience - The Audience to use for authentication with Microsoft Entra ID.

Returns:

The updated SearchClientBuilder object.

buildAsyncClient

public SearchAsyncClient buildAsyncClient()

Builds an instance of SearchAsyncClient class.

Returns:

an instance of SearchAsyncClient.

buildClient

public SearchClient buildClient()

Builds an instance of SearchClient class.

Returns:

an instance of SearchClient.

clientOptions

public SearchClientBuilder clientOptions(ClientOptions clientOptions)

.

Parameters:

clientOptions

configuration

public SearchClientBuilder configuration(Configuration configuration)

.

Parameters:

configuration

credential

public SearchClientBuilder credential(KeyCredential keyCredential)

.

Parameters:

keyCredential

credential

public SearchClientBuilder credential(TokenCredential tokenCredential)

.

Parameters:

tokenCredential

endpoint

public SearchClientBuilder endpoint(String endpoint)

.

Parameters:

endpoint

httpClient

public SearchClientBuilder httpClient(HttpClient httpClient)

.

Parameters:

httpClient

httpLogOptions

public SearchClientBuilder httpLogOptions(HttpLogOptions httpLogOptions)

.

Parameters:

httpLogOptions

indexName

public SearchClientBuilder indexName(String indexName)

Sets The name of the index.

Parameters:

indexName - the indexName value.

Returns:

the SearchClientBuilder.

pipeline

public SearchClientBuilder pipeline(HttpPipeline pipeline)

.

Parameters:

pipeline

retryOptions

public SearchClientBuilder retryOptions(RetryOptions retryOptions)

.

Parameters:

retryOptions

retryPolicy

public SearchClientBuilder retryPolicy(RetryPolicy retryPolicy)

Sets The retry policy that will attempt to retry failed requests, if applicable.

Parameters:

retryPolicy - the retryPolicy value.

Returns:

the SearchClientBuilder.

serviceVersion

public SearchClientBuilder serviceVersion(SearchServiceVersion serviceVersion)

Sets Service version.

Parameters:

serviceVersion - the serviceVersion value.

Returns:

the SearchClientBuilder.

Applies to