SearchIndexerClient Class
SearchIndexerClient.
Constructor
SearchIndexerClient(endpoint: str, credential: AzureKeyCredential | TokenCredential, **kwargs: Any)
Parameters
| Name | Description |
|---|---|
|
endpoint
Required
|
The endpoint URL of the search service. Required. |
|
credential
Required
|
Credential used to authenticate requests to the service. Is either a key credential type or a token credential type. Required. |
Keyword-Only Parameters
| Name | Description |
|---|---|
|
api_version
|
The API version to use for this operation. Known values are "2026-04-01" and None. Default value is "2026-04-01". Note that overriding this default value may result in unsupported behavior. |
|
audience
|
Sets the Audience to use for authentication with Microsoft Entra ID. The audience is not considered when using a shared key. If audience is not provided, the public cloud audience will be assumed. |
Methods
| close | |
| create_data_source_connection |
Creates a new datasource. |
| create_indexer |
Creates a new indexer. |
| create_or_update_data_source_connection |
Creates a new data source connection or updates a data source connection if it already exists. |
| create_or_update_indexer |
Creates a new indexer or updates an indexer if it already exists. |
| create_or_update_skillset |
Creates a new skillset in a search service or updates the skillset if it already exists. |
| create_skillset |
Creates a new skillset in a search service. |
| delete_data_source_connection |
Deletes a data source connection. |
| delete_indexer |
Deletes an indexer. |
| delete_skillset |
Deletes a skillset. |
| get_data_source_connection |
Retrieves a datasource definition. |
| get_data_source_connection_names |
Lists all data source connection names available for a search service. |
| get_data_source_connections |
Lists all data source connections available for a search service. |
| get_indexer |
Retrieves an indexer definition. |
| get_indexer_names |
Lists all indexer names available for a search service. |
| get_indexer_status |
Returns the current status and execution history of an indexer. |
| get_indexers |
Lists all indexers available for a search service. |
| get_skillset |
Retrieves a skillset in a search service. |
| get_skillset_names |
List the SearchIndexerSkillset names in an Azure Search service. |
| get_skillsets |
Lists all skillsets available for a search service. |
| reset_indexer |
Resets the change tracking state associated with an indexer. |
| run_indexer |
Runs an indexer on-demand. |
| send_request |
Runs the network request through the client's chained policies.
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request |
close
close() -> None
create_data_source_connection
Creates a new datasource.
create_data_source_connection(data_source_connection: SearchIndexerDataSourceConnection | MutableMapping[str, Any] | IO[bytes], **kwargs: Any) -> SearchIndexerDataSourceConnection
Parameters
| Name | Description |
|---|---|
|
data_source_connection
Required
|
The definition of the datasource to create. Is one of the following types: SearchIndexerDataSourceConnection, JSON, IO[bytes] Required. |
Returns
| Type | Description |
|---|---|
|
SearchIndexerDataSourceConnection. The SearchIndexerDataSourceConnection is compatible with MutableMapping |
Exceptions
| Type | Description |
|---|---|
create_indexer
Creates a new indexer.
create_indexer(indexer: SearchIndexer | MutableMapping[str, Any] | IO[bytes], **kwargs: Any) -> SearchIndexer
Parameters
| Name | Description |
|---|---|
|
indexer
Required
|
The definition of the indexer to create. Is one of the following types: SearchIndexer, JSON, IO[bytes] Required. |
Returns
| Type | Description |
|---|---|
|
SearchIndexer. The SearchIndexer is compatible with MutableMapping |
Exceptions
| Type | Description |
|---|---|
create_or_update_data_source_connection
Creates a new data source connection or updates a data source connection if it already exists.
create_or_update_data_source_connection(data_source_connection: SearchIndexerDataSourceConnection | MutableMapping[str, Any], *, match_condition: MatchConditions = MatchConditions.Unconditionally, **kwargs: Any) -> SearchIndexerDataSourceConnection
Parameters
| Name | Description |
|---|---|
|
data_source_connection
Required
|
SearchIndexerDataSourceConnection or
<xref:JSON>
The SearchIndexerDataSourceConnection object to create or update. Required. |
Keyword-Only Parameters
| Name | Description |
|---|---|
|
match_condition
|
The match condition to use upon the etag. Default value is None. Default value: MatchConditions.Unconditionally
|
Returns
| Type | Description |
|---|---|
|
SearchIndexerDataSourceConnection |
Exceptions
| Type | Description |
|---|---|
create_or_update_indexer
Creates a new indexer or updates an indexer if it already exists.
create_or_update_indexer(indexer: SearchIndexer | MutableMapping[str, Any], *, match_condition: MatchConditions = MatchConditions.Unconditionally, **kwargs: Any) -> SearchIndexer
Parameters
| Name | Description |
|---|---|
|
indexer
Required
|
SearchIndexer or
<xref:JSON>
The SearchIndexer object to create or update. Required. |
Keyword-Only Parameters
| Name | Description |
|---|---|
|
match_condition
|
The match condition to use upon the etag. Default value is None. Default value: MatchConditions.Unconditionally
|
Returns
| Type | Description |
|---|---|
|
SearchIndexer |
Exceptions
| Type | Description |
|---|---|
create_or_update_skillset
Creates a new skillset in a search service or updates the skillset if it already exists.
create_or_update_skillset(skillset: SearchIndexerSkillset | MutableMapping[str, Any], *, match_condition: MatchConditions = MatchConditions.Unconditionally, **kwargs: Any) -> SearchIndexerSkillset
Parameters
| Name | Description |
|---|---|
|
skillset
Required
|
SearchIndexerSkillset or
<xref:JSON>
The SearchIndexerSkillset object to create or update. Required. |
Keyword-Only Parameters
| Name | Description |
|---|---|
|
match_condition
|
The match condition to use upon the etag. Default value is None. Default value: MatchConditions.Unconditionally
|
Returns
| Type | Description |
|---|---|
|
SearchIndexerSkillset |
Exceptions
| Type | Description |
|---|---|
create_skillset
Creates a new skillset in a search service.
create_skillset(skillset: SearchIndexerSkillset | MutableMapping[str, Any] | IO[bytes], **kwargs: Any) -> SearchIndexerSkillset
Parameters
| Name | Description |
|---|---|
|
skillset
Required
|
The skillset containing one or more skills to create in a search service. Is one of the following types: SearchIndexerSkillset, JSON, IO[bytes] Required. |
Returns
| Type | Description |
|---|---|
|
SearchIndexerSkillset. The SearchIndexerSkillset is compatible with MutableMapping |
Exceptions
| Type | Description |
|---|---|
delete_data_source_connection
Deletes a data source connection.
delete_data_source_connection(data_source_connection: str | SearchIndexerDataSourceConnection, *, match_condition: MatchConditions = MatchConditions.Unconditionally, **kwargs: Any) -> None
Parameters
| Name | Description |
|---|---|
|
data_source_connection
Required
|
The name of the data source connection to delete or a SearchIndexerDataSourceConnection object. Required. |
Keyword-Only Parameters
| Name | Description |
|---|---|
|
match_condition
|
The match condition to use upon the etag. Default value is None. Default value: MatchConditions.Unconditionally
|
Returns
| Type | Description |
|---|---|
|
None |
Exceptions
| Type | Description |
|---|---|
delete_indexer
Deletes an indexer.
delete_indexer(indexer: str | SearchIndexer, *, match_condition: MatchConditions = MatchConditions.Unconditionally, **kwargs: Any) -> None
Parameters
| Name | Description |
|---|---|
|
indexer
Required
|
str or
SearchIndexer
The name of the indexer to delete or a SearchIndexer object. Required. |
Keyword-Only Parameters
| Name | Description |
|---|---|
|
match_condition
|
The match condition to use upon the etag. Default value is None. Default value: MatchConditions.Unconditionally
|
Returns
| Type | Description |
|---|---|
|
None |
Exceptions
| Type | Description |
|---|---|
delete_skillset
Deletes a skillset.
delete_skillset(skillset: str | SearchIndexerSkillset, *, match_condition: MatchConditions = MatchConditions.Unconditionally, **kwargs: Any) -> None
Parameters
| Name | Description |
|---|---|
|
skillset
Required
|
The name of the skillset to delete or a SearchIndexerSkillset object. Required. |
Keyword-Only Parameters
| Name | Description |
|---|---|
|
match_condition
|
The match condition to use upon the etag. Default value is None. Default value: MatchConditions.Unconditionally
|
Returns
| Type | Description |
|---|---|
|
None |
Exceptions
| Type | Description |
|---|---|
get_data_source_connection
Retrieves a datasource definition.
get_data_source_connection(name: str, **kwargs: Any) -> SearchIndexerDataSourceConnection
Parameters
| Name | Description |
|---|---|
|
name
Required
|
The name of the datasource. Required. |
Returns
| Type | Description |
|---|---|
|
SearchIndexerDataSourceConnection. The SearchIndexerDataSourceConnection is compatible with MutableMapping |
Exceptions
| Type | Description |
|---|---|
get_data_source_connection_names
get_data_source_connections
Lists all data source connections available for a search service.
get_data_source_connections(*, select: List[str] | None = None, **kwargs: Any) -> List[SearchIndexerDataSourceConnection]
Keyword-Only Parameters
| Name | Description |
|---|---|
|
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. Default value is None. Default value: None
|
Returns
| Type | Description |
|---|---|
|
List of all the data source connections. |
Exceptions
| Type | Description |
|---|---|
get_indexer
Retrieves an indexer definition.
get_indexer(name: str, **kwargs: Any) -> SearchIndexer
Parameters
| Name | Description |
|---|---|
|
name
Required
|
The name of the indexer. Required. |
Returns
| Type | Description |
|---|---|
|
SearchIndexer. The SearchIndexer is compatible with MutableMapping |
Exceptions
| Type | Description |
|---|---|
get_indexer_names
Lists all indexer names available for a search service.
get_indexer_names(**kwargs: Any) -> Sequence[str]
Returns
| Type | Description |
|---|---|
|
List of all the SearchIndexers. |
Examples
List all the SearchIndexers
from azure.core.credentials import AzureKeyCredential
from azure.search.documents.indexes import SearchIndexerClient
indexer_client = SearchIndexerClient(service_endpoint, AzureKeyCredential(key))
result = indexer_client.get_indexers()
names = [x.name for x in result]
print(f"Indexers ({len(result)}): {', '.join(names)}")
get_indexer_status
Returns the current status and execution history of an indexer.
get_indexer_status(name: str, **kwargs: Any) -> SearchIndexerStatus
Parameters
| Name | Description |
|---|---|
|
name
Required
|
The name of the indexer. Required. |
Returns
| Type | Description |
|---|---|
|
SearchIndexerStatus. The SearchIndexerStatus is compatible with MutableMapping |
Exceptions
| Type | Description |
|---|---|
get_indexers
Lists all indexers available for a search service.
get_indexers(*, select: List[str] | None = None, **kwargs: Any) -> List[SearchIndexer]
Keyword-Only Parameters
| Name | Description |
|---|---|
|
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. Default value is None. Default value: None
|
Returns
| Type | Description |
|---|---|
|
List of all the SearchIndexers. |
Exceptions
| Type | Description |
|---|---|
get_skillset
Retrieves a skillset in a search service.
get_skillset(name: str, **kwargs: Any) -> SearchIndexerSkillset
Parameters
| Name | Description |
|---|---|
|
name
Required
|
The name of the skillset. Required. |
Returns
| Type | Description |
|---|---|
|
SearchIndexerSkillset. The SearchIndexerSkillset is compatible with MutableMapping |
Exceptions
| Type | Description |
|---|---|
get_skillset_names
List the SearchIndexerSkillset names in an Azure Search service.
get_skillset_names(**kwargs: Any) -> List[str]
Returns
| Type | Description |
|---|---|
|
List of SearchIndexerSkillset names |
Exceptions
| Type | Description |
|---|---|
|
If there is an error in the REST request. |
get_skillsets
Lists all skillsets available for a search service.
get_skillsets(*, select: List[str] | None = None, **kwargs: Any) -> List[SearchIndexerSkillset]
Keyword-Only Parameters
| Name | Description |
|---|---|
|
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. Default value is None. Default value: None
|
Returns
| Type | Description |
|---|---|
|
List of all the SearchIndexerSkillsets. |
Exceptions
| Type | Description |
|---|---|
reset_indexer
Resets the change tracking state associated with an indexer.
reset_indexer(name: str, **kwargs: Any) -> None
Parameters
| Name | Description |
|---|---|
|
name
Required
|
The name of the indexer. Required. |
Returns
| Type | Description |
|---|---|
|
None |
Exceptions
| Type | Description |
|---|---|
run_indexer
Runs an indexer on-demand.
run_indexer(name: str, **kwargs: Any) -> None
Parameters
| Name | Description |
|---|---|
|
name
Required
|
The name of the indexer. Required. |
Returns
| Type | Description |
|---|---|
|
None |
Exceptions
| Type | Description |
|---|---|
send_request
Runs the network request through the client's chained policies.
>>> from azure.core.rest import HttpRequest
>>> request = HttpRequest("GET", "https://www.example.org/")
<HttpRequest [GET], url: 'https://www.example.org/'>
>>> response = client.send_request(request)
<HttpResponse: 200 OK>
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
send_request(request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse
Parameters
| Name | Description |
|---|---|
|
request
Required
|
The network request you want to make. Required. |
Keyword-Only Parameters
| Name | Description |
|---|---|
|
stream
|
Whether the response payload will be streamed. Defaults to False. Default value: False
|
Returns
| Type | Description |
|---|---|
|
The response of your network call. Does not do error handling on your response. |