SearchIndexClient Class

  • java.lang.Object
    • com.azure.search.documents.indexes.SearchIndexClient

public final class SearchIndexClient

Initializes a new instance of the synchronous SearchIndexClient type.

Method Summary

Modifier and Type Method and Description
AnalyzeResult analyzeText(String name, AnalyzeTextOptions request)

Shows how an analyzer breaks text into tokens.

Response<AnalyzeResult> analyzeTextWithResponse(String name, AnalyzeTextOptions request, RequestOptions requestOptions)

Shows how an analyzer breaks text into tokens.

static List<SearchField> buildSearchFields(Class<?> model)

Convenience method to convert a Class's Fields and Methods annotated with either BasicField or ComplexField into SearchField to help aid the creation of a SearchField which represents the Class.

SearchAlias createAlias(SearchAlias alias)

Creates a new search alias.

Response<SearchAlias> createAliasWithResponse(SearchAlias alias, RequestOptions requestOptions)

Creates a new search alias.

SearchIndex createIndex(SearchIndex index)

Creates a new search index.

Response<SearchIndex> createIndexWithResponse(SearchIndex index, RequestOptions requestOptions)

Creates a new search index.

KnowledgeBase createKnowledgeBase(KnowledgeBase knowledgeBase)

Creates a new knowledge base.

Response<KnowledgeBase> createKnowledgeBaseWithResponse(KnowledgeBase knowledgeBase, RequestOptions requestOptions)

Creates a new knowledge base.

KnowledgeSource createKnowledgeSource(KnowledgeSource knowledgeSource)

Creates a new knowledge source.

Response<KnowledgeSource> createKnowledgeSourceWithResponse(KnowledgeSource knowledgeSource, RequestOptions requestOptions)

Creates a new knowledge source.

SearchAlias createOrUpdateAlias(SearchAlias alias)

Creates a new search alias or updates an alias if it already exists.

Response<SearchAlias> createOrUpdateAliasWithResponse(SearchAlias alias, RequestOptions requestOptions)

Creates a new search alias or updates an alias if it already exists.

SearchIndex createOrUpdateIndex(SearchIndex index)

Creates a new search index or updates an index if it already exists.

Response<SearchIndex> createOrUpdateIndexWithResponse(SearchIndex index, RequestOptions requestOptions)

Creates a new search index or updates an index if it already exists.

KnowledgeBase createOrUpdateKnowledgeBase(KnowledgeBase knowledgeBase)

Creates a new knowledge base or updates a knowledge base if it already exists.

Response<KnowledgeBase> createOrUpdateKnowledgeBaseWithResponse(KnowledgeBase knowledgeBase, RequestOptions requestOptions)

Creates a new knowledge base or updates a knowledge base if it already exists.

KnowledgeSource createOrUpdateKnowledgeSource(KnowledgeSource knowledgeSource)

Creates a new knowledge source or updates an knowledge source if it already exists.

Response<KnowledgeSource> createOrUpdateKnowledgeSourceWithResponse(KnowledgeSource knowledgeSource, RequestOptions requestOptions)

Creates a new knowledge source or updates an knowledge source if it already exists.

SynonymMap createOrUpdateSynonymMap(SynonymMap synonymMap)

Creates a new synonym map or updates a synonym map if it already exists.

Response<SynonymMap> createOrUpdateSynonymMapWithResponse(SynonymMap synonymMap, RequestOptions requestOptions)

Creates a new synonym map or updates a synonym map if it already exists.

SynonymMap createSynonymMap(SynonymMap synonymMap)

Creates a new synonym map.

Response<SynonymMap> createSynonymMapWithResponse(SynonymMap synonymMap, RequestOptions requestOptions)

Creates a new synonym map.

void deleteAlias(String name)

Deletes a search alias and its associated mapping to an index.

void deleteAlias(String name, MatchConditions matchConditions)

Deletes a search alias and its associated mapping to an index.

Response<Void> deleteAliasWithResponse(String name, RequestOptions requestOptions)

Deletes a search alias and its associated mapping to an index.

void deleteIndex(String name)

Deletes a search index and all the documents it contains.

void deleteIndex(String name, MatchConditions matchConditions)

Deletes a search index and all the documents it contains.

Response<Void> deleteIndexWithResponse(String name, RequestOptions requestOptions)

Deletes a search index and all the documents it contains.

void deleteKnowledgeBase(String name)

Deletes a knowledge base.

void deleteKnowledgeBase(String name, MatchConditions matchConditions)

Deletes a knowledge base.

Response<Void> deleteKnowledgeBaseWithResponse(String name, RequestOptions requestOptions)

Deletes a knowledge base.

void deleteKnowledgeSource(String name)

Deletes an existing knowledge source.

void deleteKnowledgeSource(String name, MatchConditions matchConditions)

Deletes an existing knowledge source.

Response<Void> deleteKnowledgeSourceWithResponse(String name, RequestOptions requestOptions)

Deletes an existing knowledge source.

void deleteSynonymMap(String name)

Deletes a synonym map.

void deleteSynonymMap(String name, MatchConditions matchConditions)

Deletes a synonym map.

Response<Void> deleteSynonymMapWithResponse(String name, RequestOptions requestOptions)

Deletes a synonym map.

SearchAlias getAlias(String name)

Retrieves an alias definition.

Response<SearchAlias> getAliasWithResponse(String name, RequestOptions requestOptions)

Retrieves an alias definition.

String getEndpoint()

Gets the endpoint used to communicate with the Azure AI Search service.

SearchIndex getIndex(String name)

Retrieves an index definition.

GetIndexStatisticsResult getIndexStatistics(String name)

Returns statistics for the given index, including a document count and storage usage.

Response<GetIndexStatisticsResult> getIndexStatisticsWithResponse(String name, RequestOptions requestOptions)

Returns statistics for the given index, including a document count and storage usage.

Response<SearchIndex> getIndexWithResponse(String name, RequestOptions requestOptions)

Retrieves an index definition.

KnowledgeBase getKnowledgeBase(String name)

Retrieves a knowledge base definition.

Response<KnowledgeBase> getKnowledgeBaseWithResponse(String name, RequestOptions requestOptions)

Retrieves a knowledge base definition.

KnowledgeSource getKnowledgeSource(String name)

Retrieves a knowledge source definition.

KnowledgeSourceStatus getKnowledgeSourceStatus(String name)

Retrieves the status of a knowledge source.

Response<KnowledgeSourceStatus> getKnowledgeSourceStatusWithResponse(String name, RequestOptions requestOptions)

Retrieves the status of a knowledge source.

Response<KnowledgeSource> getKnowledgeSourceWithResponse(String name, RequestOptions requestOptions)

Retrieves a knowledge source definition.

SearchClient getSearchClient(String indexName)

Initializes a new SearchClient using the given index name and the same configuration as the SearchIndexClient.

SearchServiceStatistics getServiceStatistics()

Gets service level statistics for a search service.

Response<SearchServiceStatistics> getServiceStatisticsWithResponse(RequestOptions requestOptions)

Gets service level statistics for a search service.

SearchServiceVersion getServiceVersion()

Gets the SearchServiceVersion used to communicate with the Azure AI Search service.

SynonymMap getSynonymMap(String name)

Retrieves a synonym map definition.

Response<SynonymMap> getSynonymMapWithResponse(String name, RequestOptions requestOptions)

Retrieves a synonym map definition.

PagedIterable<SearchAlias> listAliases()

Lists all aliases available for a search service.

PagedIterable<SearchAlias> listAliases(RequestOptions requestOptions)

Lists all aliases available for a search service.

PagedIterable<SearchIndex> listIndexes()

Lists all indexes available for a search service.

PagedIterable<SearchIndex> listIndexes(RequestOptions requestOptions)

Lists all indexes available for a search service.

PagedIterable<SearchIndexResponse> listIndexesWithSelectedProperties()

Lists all indexes available for a search service.

PagedIterable<SearchIndexResponse> listIndexesWithSelectedProperties(List<String> select)

Lists all indexes available for a search service.

PagedIterable<String> listIndexNames()

Lists the names all indexes available for a search service.

PagedIterable<KnowledgeBase> listKnowledgeBases()

Lists all knowledge bases available for a search service.

PagedIterable<KnowledgeBase> listKnowledgeBases(RequestOptions requestOptions)

Lists all knowledge bases available for a search service.

PagedIterable<KnowledgeSource> listKnowledgeSources()

Lists all knowledge sources available for a search service.

PagedIterable<KnowledgeSource> listKnowledgeSources(RequestOptions requestOptions)

Lists all knowledge sources available for a search service.

PagedIterable<String> listSynonymMapNames()

Lists the names of all synonym maps available for a search service.

PagedIterable<SynonymMap> listSynonymMaps()

Lists all synonym maps available for a search service.

Methods inherited from java.lang.Object

Method Details

analyzeText

public AnalyzeResult analyzeText(String name, AnalyzeTextOptions request)

Shows how an analyzer breaks text into tokens.

Parameters:

name - The name of the index.
request - The text and analyzer or analysis components to test.

Returns:

the result of testing an analyzer on text.

analyzeTextWithResponse

public Response<AnalyzeResult> analyzeTextWithResponse(String name, AnalyzeTextOptions request, RequestOptions requestOptions)

Shows how an analyzer breaks text into tokens.

Parameters:

name - The name of the index.
request - The text and analyzer or analysis components to test.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

the result of testing an analyzer on text along with Response<T>.

buildSearchFields

public static List<SearchField> buildSearchFields(Class<?> model)

Convenience method to convert a Class's Fields and Methods annotated with either BasicField or ComplexField into SearchField to help aid the creation of a SearchField which represents the Class.

This helper only inspects fields and methods declared by the model, and uses the following rules for creating SearchField:

If the type of the field or return type of the method is an array or Iterable it will be considered a collection(SearchFieldDataType dataType) type. Nested collection(SearchFieldDataType dataType) aren't allowed and will throw an exception, ex. String[][], List>, List, List[], etc.

| Java type                                                                                        | <xref uid="com.azure.search.documents.indexes.models.SearchFieldDataType" data-throw-if-not-resolved="false" data-raw-source="SearchFieldDataType"></xref>                                             |
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `byte`                                                                                           | <xref uid="com.azure.search.documents.indexes.models.SearchFieldDataType.SBYTE" data-throw-if-not-resolved="false" data-raw-source="SearchFieldDataType#SBYTE"></xref>                                 |
| <xref uid="" data-throw-if-not-resolved="false" data-raw-source="Byte"></xref>                   | <xref uid="com.azure.search.documents.indexes.models.SearchFieldDataType.SBYTE" data-throw-if-not-resolved="false" data-raw-source="SearchFieldDataType#SBYTE"></xref>                                 |
| `boolean`                                                                                        | <xref uid="com.azure.search.documents.indexes.models.SearchFieldDataType.BOOLEAN" data-throw-if-not-resolved="false" data-raw-source="SearchFieldDataType#BOOLEAN"></xref>                             |
| <xref uid="" data-throw-if-not-resolved="false" data-raw-source="Boolean"></xref>                | <xref uid="com.azure.search.documents.indexes.models.SearchFieldDataType.BOOLEAN" data-throw-if-not-resolved="false" data-raw-source="SearchFieldDataType#BOOLEAN"></xref>                             |
| `short`                                                                                          | <xref uid="com.azure.search.documents.indexes.models.SearchFieldDataType.INT16" data-throw-if-not-resolved="false" data-raw-source="SearchFieldDataType#INT16"></xref>                                 |
| <xref uid="" data-throw-if-not-resolved="false" data-raw-source="Short"></xref>                  | <xref uid="com.azure.search.documents.indexes.models.SearchFieldDataType.INT16" data-throw-if-not-resolved="false" data-raw-source="SearchFieldDataType#INT16"></xref>                                 |
| `int`                                                                                            | <xref uid="com.azure.search.documents.indexes.models.SearchFieldDataType.INT32" data-throw-if-not-resolved="false" data-raw-source="SearchFieldDataType#INT32"></xref>                                 |
| <xref uid="" data-throw-if-not-resolved="false" data-raw-source="Integer"></xref>                | <xref uid="com.azure.search.documents.indexes.models.SearchFieldDataType.INT32" data-throw-if-not-resolved="false" data-raw-source="SearchFieldDataType#INT32"></xref>                                 |
| `long`                                                                                           | <xref uid="com.azure.search.documents.indexes.models.SearchFieldDataType.INT64" data-throw-if-not-resolved="false" data-raw-source="SearchFieldDataType#INT64"></xref>                                 |
| <xref uid="java.lang.Long" data-throw-if-not-resolved="false" data-raw-source="Long"></xref>     | <xref uid="com.azure.search.documents.indexes.models.SearchFieldDataType.INT64" data-throw-if-not-resolved="false" data-raw-source="SearchFieldDataType#INT64"></xref>                                 |
| `float`                                                                                          | <xref uid="com.azure.search.documents.indexes.models.SearchFieldDataType.SINGLE" data-throw-if-not-resolved="false" data-raw-source="SearchFieldDataType#SINGLE"></xref>                               |
| <xref uid="" data-throw-if-not-resolved="false" data-raw-source="Float"></xref>                  | <xref uid="com.azure.search.documents.indexes.models.SearchFieldDataType.SINGLE" data-throw-if-not-resolved="false" data-raw-source="SearchFieldDataType#SINGLE"></xref>                               |
| `double`                                                                                         | <xref uid="com.azure.search.documents.indexes.models.SearchFieldDataType.DOUBLE" data-throw-if-not-resolved="false" data-raw-source="SearchFieldDataType#DOUBLE"></xref>                               |
| <xref uid="" data-throw-if-not-resolved="false" data-raw-source="Double"></xref>                 | <xref uid="com.azure.search.documents.indexes.models.SearchFieldDataType.DOUBLE" data-throw-if-not-resolved="false" data-raw-source="SearchFieldDataType#DOUBLE"></xref>                               |
| `char`                                                                                           | <xref uid="com.azure.search.documents.indexes.models.SearchFieldDataType.STRING" data-throw-if-not-resolved="false" data-raw-source="SearchFieldDataType#STRING"></xref>                               |
| <xref uid="" data-throw-if-not-resolved="false" data-raw-source="Character"></xref>              | <xref uid="com.azure.search.documents.indexes.models.SearchFieldDataType.STRING" data-throw-if-not-resolved="false" data-raw-source="SearchFieldDataType#STRING"></xref>                               |
| <xref uid="" data-throw-if-not-resolved="false" data-raw-source="CharSequence"></xref>           | <xref uid="com.azure.search.documents.indexes.models.SearchFieldDataType.STRING" data-throw-if-not-resolved="false" data-raw-source="SearchFieldDataType#STRING"></xref>                               |
| <xref uid="java.lang.String" data-throw-if-not-resolved="false" data-raw-source="String"></xref> | <xref uid="com.azure.search.documents.indexes.models.SearchFieldDataType.STRING" data-throw-if-not-resolved="false" data-raw-source="SearchFieldDataType#STRING"></xref>                               |
| <xref uid="" data-throw-if-not-resolved="false" data-raw-source="Date"></xref>                   | <xref uid="com.azure.search.documents.indexes.models.SearchFieldDataType.DATE_TIME_OFFSET" data-throw-if-not-resolved="false" data-raw-source="SearchFieldDataType#DATE_TIME_OFFSET"></xref>           |
| <xref uid="" data-throw-if-not-resolved="false" data-raw-source="OffsetDateTime"></xref>         | <xref uid="com.azure.search.documents.indexes.models.SearchFieldDataType.DATE_TIME_OFFSET" data-throw-if-not-resolved="false" data-raw-source="SearchFieldDataType#DATE_TIME_OFFSET"></xref>           |
| <xref uid="" data-throw-if-not-resolved="false" data-raw-source="GeoPoint"></xref>               | <xref uid="com.azure.search.documents.indexes.models.SearchFieldDataType.GEOGRAPHY_POINT" data-throw-if-not-resolved="false" data-raw-source="SearchFieldDataType#GEOGRAPHY_POINT"></xref>             |
| Any other type                                                                                   | Attempted to be consumed as <xref uid="com.azure.search.documents.indexes.models.SearchFieldDataType.COMPLEX" data-throw-if-not-resolved="false" data-raw-source="SearchFieldDataType#COMPLEX"></xref> |

HALF and BYTE aren't supported by Field given there isn't a built-in Java type that represents them.

When generating SearchField there is a maximum class depth limit of 1000 before an exception will be thrown.

This helper method performs a few basic validation on the created SearchField, they are the following:

Parameters:

model - The model Class that will have SearchField generated from its structure.

Returns:

A list SearchField which represent the model Class.

createAlias

public SearchAlias createAlias(SearchAlias alias)

Creates a new search alias.

Parameters:

alias - The definition of the alias to create.

Returns:

represents an index alias, which describes a mapping from the alias name to an index.

createAliasWithResponse

public Response<SearchAlias> createAliasWithResponse(SearchAlias alias, RequestOptions requestOptions)

Creates a new search alias.

Parameters:

alias - The definition of the alias to create.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

represents an index alias, which describes a mapping from the alias name to an index along with Response<T>.

createIndex

public SearchIndex createIndex(SearchIndex index)

Creates a new search index.

Parameters:

index - The definition of the index to create.

Returns:

represents a search index definition, which describes the fields and search behavior of an index.

createIndexWithResponse

public Response<SearchIndex> createIndexWithResponse(SearchIndex index, RequestOptions requestOptions)

Creates a new search index.

Parameters:

index - The definition of the index to create.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

represents a search index definition, which describes the fields and search behavior of an index along with Response<T>.

createKnowledgeBase

public KnowledgeBase createKnowledgeBase(KnowledgeBase knowledgeBase)

Creates a new knowledge base.

Parameters:

knowledgeBase - The definition of the knowledge base to create.

Returns:

represents a knowledge base definition.

createKnowledgeBaseWithResponse

public Response<KnowledgeBase> createKnowledgeBaseWithResponse(KnowledgeBase knowledgeBase, RequestOptions requestOptions)

Creates a new knowledge base.

Parameters:

knowledgeBase - The definition of the knowledge base to create.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

represents a knowledge base definition along with Response<T>.

createKnowledgeSource

public KnowledgeSource createKnowledgeSource(KnowledgeSource knowledgeSource)

Creates a new knowledge source.

Parameters:

knowledgeSource - The definition of the knowledge source to create.

Returns:

represents a knowledge source definition.

createKnowledgeSourceWithResponse

public Response<KnowledgeSource> createKnowledgeSourceWithResponse(KnowledgeSource knowledgeSource, RequestOptions requestOptions)

Creates a new knowledge source.

Parameters:

knowledgeSource - The definition of the knowledge source to create.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

represents a knowledge source definition along with Response<T>.

createOrUpdateAlias

public SearchAlias createOrUpdateAlias(SearchAlias alias)

Creates a new search alias or updates an alias if it already exists.

Parameters:

alias - The definition of the alias to create or update.

Returns:

represents an index alias, which describes a mapping from the alias name to an index.

createOrUpdateAliasWithResponse

public Response<SearchAlias> createOrUpdateAliasWithResponse(SearchAlias alias, RequestOptions requestOptions)

Creates a new search alias or updates an alias if it already exists.

Header Parameters

| ------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Name          | Type   | Required | Description                                                                                                                    |
| If-Match      | String | No       | Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value.             |
| If-None-Match | String | No       | Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value. |

You can add these to a request with RequestOptions#addHeader

Parameters:

alias - The definition of the alias to create or update.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

represents an index alias, which describes a mapping from the alias name to an index along with Response<T>.

createOrUpdateIndex

public SearchIndex createOrUpdateIndex(SearchIndex index)

Creates a new search index or updates an index if it already exists.

Parameters:

index - The definition of the index to create or update.

Returns:

represents a search index definition, which describes the fields and search behavior of an index.

createOrUpdateIndexWithResponse

public Response<SearchIndex> createOrUpdateIndexWithResponse(SearchIndex index, RequestOptions requestOptions)

Creates a new search index or updates an index if it already exists.

Query Parameters

| ------------------ | ------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Name               | Type    | Required | Description                                                                                                                                                                                                                                                                                                                                                     |
| allowIndexDowntime | Boolean | No       | Allows new analyzers, tokenizers, token filters, or char filters to be added to an index by taking the index offline for at least a few seconds. This temporarily causes indexing and query requests to fail. Performance and write availability of the index can be impaired for several minutes after the index is updated, or longer for very large indexes. |

You can add these to a request with RequestOptions#addQueryParam

Header Parameters

| ------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Name          | Type   | Required | Description                                                                                                                    |
| If-Match      | String | No       | Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value.             |
| If-None-Match | String | No       | Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value. |

You can add these to a request with RequestOptions#addHeader

Parameters:

index - The definition of the index to create or update.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

represents a search index definition, which describes the fields and search behavior of an index along with Response<T>.

createOrUpdateKnowledgeBase

public KnowledgeBase createOrUpdateKnowledgeBase(KnowledgeBase knowledgeBase)

Creates a new knowledge base or updates a knowledge base if it already exists.

Parameters:

knowledgeBase - The definition of the knowledge base to create or update.

Returns:

represents a knowledge base definition.

createOrUpdateKnowledgeBaseWithResponse

public Response<KnowledgeBase> createOrUpdateKnowledgeBaseWithResponse(KnowledgeBase knowledgeBase, RequestOptions requestOptions)

Creates a new knowledge base or updates a knowledge base if it already exists.

Header Parameters

| ------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Name          | Type   | Required | Description                                                                                                                    |
| If-Match      | String | No       | Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value.             |
| If-None-Match | String | No       | Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value. |

You can add these to a request with RequestOptions#addHeader

Parameters:

knowledgeBase - The definition of the knowledge base to create or update.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

represents a knowledge base definition along with Response<T>.

createOrUpdateKnowledgeSource

public KnowledgeSource createOrUpdateKnowledgeSource(KnowledgeSource knowledgeSource)

Creates a new knowledge source or updates an knowledge source if it already exists.

Parameters:

knowledgeSource - The definition of the knowledge source to create or update.

Returns:

represents a knowledge source definition.

createOrUpdateKnowledgeSourceWithResponse

public Response<KnowledgeSource> createOrUpdateKnowledgeSourceWithResponse(KnowledgeSource knowledgeSource, RequestOptions requestOptions)

Creates a new knowledge source or updates an knowledge source if it already exists.

Header Parameters

| ------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Name          | Type   | Required | Description                                                                                                                    |
| If-Match      | String | No       | Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value.             |
| If-None-Match | String | No       | Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value. |

You can add these to a request with RequestOptions#addHeader

Parameters:

knowledgeSource - The definition of the knowledge source to create or update.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

represents a knowledge source definition along with Response<T>.

createOrUpdateSynonymMap

public SynonymMap createOrUpdateSynonymMap(SynonymMap synonymMap)

Creates a new synonym map or updates a synonym map if it already exists.

Parameters:

synonymMap - The definition of the synonym map to create or update.

Returns:

represents a synonym map definition.

createOrUpdateSynonymMapWithResponse

public Response<SynonymMap> createOrUpdateSynonymMapWithResponse(SynonymMap synonymMap, RequestOptions requestOptions)

Creates a new synonym map or updates a synonym map if it already exists.

Header Parameters

| ------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Name          | Type   | Required | Description                                                                                                                    |
| If-Match      | String | No       | Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value.             |
| If-None-Match | String | No       | Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value. |

You can add these to a request with RequestOptions#addHeader

Parameters:

synonymMap - The definition of the synonym map to create or update.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

represents a synonym map definition along with Response<T>.

createSynonymMap

public SynonymMap createSynonymMap(SynonymMap synonymMap)

Creates a new synonym map.

Parameters:

synonymMap - The definition of the synonym map to create.

Returns:

represents a synonym map definition.

createSynonymMapWithResponse

public Response<SynonymMap> createSynonymMapWithResponse(SynonymMap synonymMap, RequestOptions requestOptions)

Creates a new synonym map.

Parameters:

synonymMap - The definition of the synonym map to create.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

represents a synonym map definition along with Response<T>.

deleteAlias

public void deleteAlias(String name)

Deletes a search alias and its associated mapping to an index. This operation is permanent, with no recovery option. The mapped index is untouched by this operation.

Parameters:

name - The name of the alias.

deleteAlias

public void deleteAlias(String name, MatchConditions matchConditions)

Deletes a search alias and its associated mapping to an index. This operation is permanent, with no recovery option. The mapped index is untouched by this operation.

Parameters:

name - The name of the alias.
matchConditions - Specifies HTTP options for conditional requests.

deleteAliasWithResponse

public Response<Void> deleteAliasWithResponse(String name, RequestOptions requestOptions)

Deletes a search alias and its associated mapping to an index. This operation is permanent, with no recovery option. The mapped index is untouched by this operation.

Header Parameters

| ------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Name          | Type   | Required | Description                                                                                                                    |
| If-Match      | String | No       | Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value.             |
| If-None-Match | String | No       | Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value. |

You can add these to a request with RequestOptions#addHeader

Parameters:

name - The name of the alias.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

deleteIndex

public void deleteIndex(String name)

Deletes a search index and all the documents it contains. This operation is permanent, with no recovery option. Make sure you have a master copy of your index definition, data ingestion code, and a backup of the primary data source in case you need to re-build the index.

Parameters:

name - The name of the index.

deleteIndex

public void deleteIndex(String name, MatchConditions matchConditions)

Deletes a search index and all the documents it contains. This operation is permanent, with no recovery option. Make sure you have a master copy of your index definition, data ingestion code, and a backup of the primary data source in case you need to re-build the index.

Parameters:

name - The name of the index.
matchConditions - Specifies HTTP options for conditional requests.

deleteIndexWithResponse

public Response<Void> deleteIndexWithResponse(String name, RequestOptions requestOptions)

Deletes a search index and all the documents it contains. This operation is permanent, with no recovery option. Make sure you have a master copy of your index definition, data ingestion code, and a backup of the primary data source in case you need to re-build the index.

Header Parameters

| ------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Name          | Type   | Required | Description                                                                                                                    |
| If-Match      | String | No       | Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value.             |
| If-None-Match | String | No       | Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value. |

You can add these to a request with RequestOptions#addHeader

Parameters:

name - The name of the index.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

deleteKnowledgeBase

public void deleteKnowledgeBase(String name)

Deletes a knowledge base.

Parameters:

name - The name of the knowledge base.

deleteKnowledgeBase

public void deleteKnowledgeBase(String name, MatchConditions matchConditions)

Deletes a knowledge base.

Parameters:

name - The name of the knowledge base.
matchConditions - Specifies HTTP options for conditional requests.

deleteKnowledgeBaseWithResponse

public Response<Void> deleteKnowledgeBaseWithResponse(String name, RequestOptions requestOptions)

Deletes a knowledge base.

Header Parameters

| ------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Name          | Type   | Required | Description                                                                                                                    |
| If-Match      | String | No       | Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value.             |
| If-None-Match | String | No       | Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value. |

You can add these to a request with RequestOptions#addHeader

Parameters:

name - The name of the knowledge base.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

deleteKnowledgeSource

public void deleteKnowledgeSource(String name)

Deletes an existing knowledge source.

Parameters:

name - The name of the knowledge source.

deleteKnowledgeSource

public void deleteKnowledgeSource(String name, MatchConditions matchConditions)

Deletes an existing knowledge source.

Parameters:

name - The name of the knowledge source.
matchConditions - Specifies HTTP options for conditional requests.

deleteKnowledgeSourceWithResponse

public Response<Void> deleteKnowledgeSourceWithResponse(String name, RequestOptions requestOptions)

Deletes an existing knowledge source.

Header Parameters

| ------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Name          | Type   | Required | Description                                                                                                                    |
| If-Match      | String | No       | Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value.             |
| If-None-Match | String | No       | Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value. |

You can add these to a request with RequestOptions#addHeader

Parameters:

name - The name of the knowledge source.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

deleteSynonymMap

public void deleteSynonymMap(String name)

Deletes a synonym map.

Parameters:

name - The name of the synonym map.

deleteSynonymMap

public void deleteSynonymMap(String name, MatchConditions matchConditions)

Deletes a synonym map.

Parameters:

name - The name of the synonym map.
matchConditions - Specifies HTTP options for conditional requests.

deleteSynonymMapWithResponse

public Response<Void> deleteSynonymMapWithResponse(String name, RequestOptions requestOptions)

Deletes a synonym map.

Header Parameters

| ------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Name          | Type   | Required | Description                                                                                                                    |
| If-Match      | String | No       | Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value.             |
| If-None-Match | String | No       | Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value. |

You can add these to a request with RequestOptions#addHeader

Parameters:

name - The name of the synonym map.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

getAlias

public SearchAlias getAlias(String name)

Retrieves an alias definition.

Parameters:

name - The name of the alias.

Returns:

represents an index alias, which describes a mapping from the alias name to an index.

getAliasWithResponse

public Response<SearchAlias> getAliasWithResponse(String name, RequestOptions requestOptions)

Retrieves an alias definition.

Parameters:

name - The name of the alias.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

represents an index alias, which describes a mapping from the alias name to an index along with Response<T>.

getEndpoint

public String getEndpoint()

Gets the endpoint used to communicate with the Azure AI Search service.

Returns:

The endpoint.

getIndex

public SearchIndex getIndex(String name)

Retrieves an index definition.

Parameters:

name - The name of the index.

Returns:

represents a search index definition, which describes the fields and search behavior of an index.

getIndexStatistics

public GetIndexStatisticsResult getIndexStatistics(String name)

Returns statistics for the given index, including a document count and storage usage.

Parameters:

name - The name of the index.

Returns:

statistics for a given index.

getIndexStatisticsWithResponse

public Response<GetIndexStatisticsResult> getIndexStatisticsWithResponse(String name, RequestOptions requestOptions)

Returns statistics for the given index, including a document count and storage usage.

Parameters:

name - The name of the index.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

statistics for a given index along with Response<T>.

getIndexWithResponse

public Response<SearchIndex> getIndexWithResponse(String name, RequestOptions requestOptions)

Retrieves an index definition.

Parameters:

name - The name of the index.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

represents a search index definition, which describes the fields and search behavior of an index along with Response<T>.

getKnowledgeBase

public KnowledgeBase getKnowledgeBase(String name)

Retrieves a knowledge base definition.

Parameters:

name - The name of the knowledge base.

Returns:

represents a knowledge base definition.

getKnowledgeBaseWithResponse

public Response<KnowledgeBase> getKnowledgeBaseWithResponse(String name, RequestOptions requestOptions)

Retrieves a knowledge base definition.

Parameters:

name - The name of the knowledge base.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

represents a knowledge base definition along with Response<T>.

getKnowledgeSource

public KnowledgeSource getKnowledgeSource(String name)

Retrieves a knowledge source definition.

Parameters:

name - The name of the knowledge source.

Returns:

represents a knowledge source definition.

getKnowledgeSourceStatus

public KnowledgeSourceStatus getKnowledgeSourceStatus(String name)

Retrieves the status of a knowledge source.

Parameters:

name - The name of the knowledge source.

Returns:

represents the status and synchronization history of a knowledge source.

getKnowledgeSourceStatusWithResponse

public Response<KnowledgeSourceStatus> getKnowledgeSourceStatusWithResponse(String name, RequestOptions requestOptions)

Retrieves the status of a knowledge source.

Parameters:

name - The name of the knowledge source.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

represents the status and synchronization history of a knowledge source along with Response<T>.

getKnowledgeSourceWithResponse

public Response<KnowledgeSource> getKnowledgeSourceWithResponse(String name, RequestOptions requestOptions)

Retrieves a knowledge source definition.

Parameters:

name - The name of the knowledge source.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

represents a knowledge source definition along with Response<T>.

getSearchClient

public SearchClient getSearchClient(String indexName)

Initializes a new SearchClient using the given index name and the same configuration as the SearchIndexClient.

Parameters:

indexName - the name of the index for the client

Returns:

a SearchClient created from the SearchIndexClient configuration

getServiceStatistics

public SearchServiceStatistics getServiceStatistics()

Gets service level statistics for a search service.

Returns:

service level statistics for a search service.

getServiceStatisticsWithResponse

public Response<SearchServiceStatistics> getServiceStatisticsWithResponse(RequestOptions requestOptions)

Gets service level statistics for a search service.

Parameters:

requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

service level statistics for a search service along with Response<T>.

getServiceVersion

public SearchServiceVersion getServiceVersion()

Gets the SearchServiceVersion used to communicate with the Azure AI Search service.

Returns:

The service version.

getSynonymMap

public SynonymMap getSynonymMap(String name)

Retrieves a synonym map definition.

Parameters:

name - The name of the synonym map.

Returns:

represents a synonym map definition.

getSynonymMapWithResponse

public Response<SynonymMap> getSynonymMapWithResponse(String name, RequestOptions requestOptions)

Retrieves a synonym map definition.

Parameters:

name - The name of the synonym map.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

represents a synonym map definition along with Response<T>.

listAliases

public PagedIterable<SearchAlias> listAliases()

Lists all aliases available for a search service.

Returns:

response from a List Aliases request as paginated response with PagedIterable<T>.

listAliases

public PagedIterable<SearchAlias> listAliases(RequestOptions requestOptions)

Lists all aliases available for a search service.

Parameters:

requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

response from a List Aliases request as paginated response with PagedIterable<T>.

listIndexes

public PagedIterable<SearchIndex> listIndexes()

Lists all indexes available for a search service.

Returns:

response from a List Indexes request as paginated response with PagedIterable<T>.

listIndexes

public PagedIterable<SearchIndex> listIndexes(RequestOptions requestOptions)

Lists all indexes available for a search service.

Query Parameters

| ------- | ------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Name    | Type         | Required | Description                                                                                                                                                                                                 |
| $select | List<String> | No       | Selects which top-level properties to retrieve. Specified as a comma-separated list of JSON property names, or '\*' for all properties. The default is all properties. In the form of "," separated string. |

You can add these to a request with RequestOptions#addQueryParam

Parameters:

requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

response from a List Indexes request as paginated response with PagedIterable<T>.

listIndexesWithSelectedProperties

public PagedIterable<SearchIndexResponse> listIndexesWithSelectedProperties()

Lists all indexes available for a search service.

Returns:

response from a List Indexes request as paginated response with PagedIterable<T>.

listIndexesWithSelectedProperties

public PagedIterable<SearchIndexResponse> listIndexesWithSelectedProperties(List<String> select)

Lists all indexes available for a search service.

Parameters:

select - Selects which top-level properties to retrieve. Specified as a comma-separated list of JSON property names, or '*' for all properties. The default is all properties.

Returns:

response from a List Indexes request as paginated response with PagedIterable<T>.

listIndexNames

public PagedIterable<String> listIndexNames()

Lists the names all indexes available for a search service.

Returns:

response from a List Indexes request as paginated response with PagedIterable<T>.

listKnowledgeBases

public PagedIterable<KnowledgeBase> listKnowledgeBases()

Lists all knowledge bases available for a search service.

Returns:

result from listing knowledge bases as paginated response with PagedIterable<T>.

listKnowledgeBases

public PagedIterable<KnowledgeBase> listKnowledgeBases(RequestOptions requestOptions)

Lists all knowledge bases available for a search service.

Parameters:

requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

result from listing knowledge bases as paginated response with PagedIterable<T>.

listKnowledgeSources

public PagedIterable<KnowledgeSource> listKnowledgeSources()

Lists all knowledge sources available for a search service.

Returns:

result from listing knowledge sources as paginated response with PagedIterable<T>.

listKnowledgeSources

public PagedIterable<KnowledgeSource> listKnowledgeSources(RequestOptions requestOptions)

Lists all knowledge sources available for a search service.

Parameters:

requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

result from listing knowledge sources as paginated response with PagedIterable<T>.

listSynonymMapNames

public PagedIterable<String> listSynonymMapNames()

Lists the names of all synonym maps available for a search service.

Returns:

the names of all synonym maps as paginated response with PagedIterable<T>.

listSynonymMaps

public PagedIterable<SynonymMap> listSynonymMaps()

Lists all synonym maps available for a search service.

Returns:

all synonym maps as paginated response with PagedIterable<T>.

Applies to