SearchIndexerClient Class

A client to interact with Azure search service Indexers.

Inheritance
azure.search.documents._headers_mixin.HeadersMixin
SearchIndexerClient

Constructor

SearchIndexerClient(endpoint: str, credential: AzureKeyCredential, **kwargs: Any)

Parameters

endpoint
str
Required

The URL endpoint of an Azure search service

credential
AzureKeyCredential
Required

A credential to authorize search client requests

api_version
str

The Search API version to use for requests.

Methods

close

Close the SearchIndexerClient session.

create_data_source_connection

Creates a new data source connection.

create_indexer

Creates a new SearchIndexer.

create_or_update_data_source_connection

Creates a new data source connection or updates a data source connection if it already exists. :param data_source_connection: The definition of the data source connection to create or update. :type data_source_connection: ~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection :keyword match_condition: The match condition to use upon the etag :type match_condition: ~azure.core.MatchConditions :return: The created SearchIndexerDataSourceConnection :rtype: ~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection

create_or_update_indexer

Creates a new indexer or updates a indexer if it already exists.

create_or_update_skillset

Create a new SearchIndexerSkillset in an Azure Search service, or update an existing one.

create_skillset

Create a new SearchIndexerSkillset in an Azure Search service

delete_data_source_connection

Deletes a data source connection. To use access conditions, the SearchIndexerDataSourceConnection model must be provided instead of the name. It is enough to provide the name of the data source connection to delete unconditionally

delete_indexer

Deletes an indexer. To use access conditions, the SearchIndexer model must be provided instead of the name. It is enough to provide the name of the indexer to delete unconditionally.

delete_skillset

Delete a named SearchIndexerSkillset in an Azure Search service. To use access conditions, the SearchIndexerSkillset model must be provided instead of the name. It is enough to provide the name of the skillset to delete unconditionally

get_data_source_connection

Retrieves a data source connection 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 a indexer definition.

get_indexer_names

Lists all indexer names available for a search service.

get_indexer_status

Get the status of the indexer.

get_indexers

Lists all indexers available for a search service.

get_skillset

Retrieve a named SearchIndexerSkillset in an Azure Search service

get_skillset_names

List the SearchIndexerSkillset names in an Azure Search service.

get_skillsets

List the SearchIndexerSkillsets in an Azure Search service.

reset_indexer

Resets the change tracking state associated with an indexer.

run_indexer

Run an indexer.

close

Close the SearchIndexerClient session.

close() -> None

create_data_source_connection

Creates a new data source connection.

create_data_source_connection(data_source_connection: SearchIndexerDataSourceConnection, **kwargs: Any) -> SearchIndexerDataSourceConnection

Parameters

data_source_connection
SearchIndexerDataSourceConnection
Required

The definition of the data source connection to create.

Returns

The created SearchIndexerDataSourceConnection

Return type

Examples

Create a Data Source


   container = SearchIndexerDataContainer(name='searchcontainer')
   data_source_connection = SearchIndexerDataSourceConnection(
       name="sample-data-source-connection",
       type="azureblob",
       connection_string=connection_string,
       container=container
   )
   result = client.create_data_source_connection(data_source_connection)
   print(result)
   print("Create new Data Source Connection - sample-data-source-connection")

create_indexer

Creates a new SearchIndexer.

create_indexer(indexer: SearchIndexer, **kwargs: Any) -> SearchIndexer

Parameters

indexer
SearchIndexer
Required

The definition of the indexer to create.

Returns

The created SearchIndexer

Return type

create_or_update_data_source_connection

Creates a new data source connection or updates a data source connection if it already exists. :param data_source_connection: The definition of the data source connection to create or update. :type data_source_connection: ~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection :keyword match_condition: The match condition to use upon the etag :type match_condition: ~azure.core.MatchConditions :return: The created SearchIndexerDataSourceConnection :rtype: ~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection

create_or_update_data_source_connection(data_source_connection: SearchIndexerDataSourceConnection, **kwargs: Any) -> SearchIndexerDataSourceConnection

create_or_update_indexer

Creates a new indexer or updates a indexer if it already exists.

create_or_update_indexer(indexer: SearchIndexer, **kwargs: Any) -> SearchIndexer

Parameters

indexer
SearchIndexer
Required

The definition of the indexer to create or update.

Returns

The created IndexSearchIndexerer

Return type

create_or_update_skillset

Create a new SearchIndexerSkillset in an Azure Search service, or update an existing one.

create_or_update_skillset(skillset: SearchIndexerSkillset, **kwargs: Any) -> SearchIndexerSkillset

Parameters

skillset
SearchIndexerSkillset
Required

The SearchIndexerSkillset object to create or update

match_condition

The match condition to use upon the etag

Returns

The created or updated SearchIndexerSkillset

Return type

create_skillset

Create a new SearchIndexerSkillset in an Azure Search service

create_skillset(skillset: SearchIndexerSkillset, **kwargs: Any) -> SearchIndexerSkillset

Parameters

skillset
SearchIndexerSkillset
Required

The SearchIndexerSkillset object to create

Returns

The created SearchIndexerSkillset

Return type

delete_data_source_connection

Deletes a data source connection. To use access conditions, the SearchIndexerDataSourceConnection model must be provided instead of the name. It is enough to provide the name of the data source connection to delete unconditionally

delete_data_source_connection(data_source_connection: Union[str, SearchIndexerDataSourceConnection], **kwargs: Any) -> None

Parameters

data_source_connection
str or SearchIndexerDataSourceConnection
Required

The data source connection to delete.

match_condition

The match condition to use upon the etag

Returns

None

Return type

Examples

Delete a SearchIndexerDataSourceConnection


   client.delete_data_source_connection("sample-data-source-connection")
   print("Data Source Connection 'sample-data-source-connection' successfully deleted")

delete_indexer

Deletes an indexer. To use access conditions, the SearchIndexer model must be provided instead of the name. It is enough to provide the name of the indexer to delete unconditionally.

delete_indexer(indexer: Union[str, SearchIndexer], **kwargs: Any) -> None

Parameters

indexer
str or SearchIndexer
Required

The indexer to delete.

match_condition

The match condition to use upon the etag

Returns

None

Return type

delete_skillset

Delete a named SearchIndexerSkillset in an Azure Search service. To use access conditions, the SearchIndexerSkillset model must be provided instead of the name. It is enough to provide the name of the skillset to delete unconditionally

delete_skillset(skillset: Union[str, SearchIndexerSkillset], **kwargs: Any) -> None

Parameters

name
str or SearchIndexerSkillset
Required

The SearchIndexerSkillset to delete

match_condition

The match condition to use upon the etag

get_data_source_connection

Retrieves a data source connection definition.

get_data_source_connection(name: str, **kwargs: Any) -> SearchIndexerDataSourceConnection

Parameters

name
str
Required

The name of the data source connection to retrieve.

Returns

The SearchIndexerDataSourceConnection that is fetched.

Return type

Examples

Retrieve a SearchIndexerDataSourceConnection


   result = client.get_data_source_connection("sample-data-source-connection")
   print("Retrived Data Source Connection 'sample-data-source-connection'")

get_data_source_connection_names

Lists all data source connection names available for a search service.

get_data_source_connection_names(**kwargs: Any) -> Sequence[str]

Returns

List of all the data source connection names.

Return type

<xref:*list>[str]<xref:*>

get_data_source_connections

Lists all data source connections available for a search service.

get_data_source_connections(**kwargs: Any) -> Sequence[SearchIndexerDataSourceConnection]

Returns

List of all the data source connections.

Return type

<xref:*list>[SearchIndexerDataSourceConnection]<xref:*>

Examples

List all the SearchIndexerDataSourceConnections


   result = client.get_data_source_connections()
   names = [ds.name for ds in result]
   print("Found {} Data Source Connections in the service: {}".format(len(result), ", ".join(names)))

get_indexer

Retrieves a indexer definition.

get_indexer(name: str, **kwargs: Any) -> SearchIndexer

Parameters

name
str
Required

The name of the indexer to retrieve.

Returns

The SearchIndexer that is fetched.

Return type

get_indexer_names

Lists all indexer names available for a search service.

get_indexer_names(**kwargs: Any) -> Sequence[str]

Returns

List of all the SearchIndexers.

Return type

<xref:*list>[str]<xref:*>

get_indexer_status

Get the status of the indexer.

get_indexer_status(name: str, **kwargs: Any) -> SearchIndexerStatus

Parameters

name
str
Required

The name of the indexer to fetch the status.

Returns

SearchIndexerStatus

Return type

get_indexers

Lists all indexers available for a search service.

get_indexers(**kwargs: Any) -> Sequence[SearchIndexer]

Returns

List of all the SearchIndexers.

Return type

<xref:*list>[SearchIndexer]<xref:*>

get_skillset

Retrieve a named SearchIndexerSkillset in an Azure Search service

get_skillset(name: str, **kwargs: Any) -> SearchIndexerSkillset

Parameters

name
str
Required

The name of the SearchIndexerSkillset to get

Returns

The retrieved SearchIndexerSkillset

Return type

Exceptions

get_skillset_names

List the SearchIndexerSkillset names in an Azure Search service.

get_skillset_names(**kwargs: Any) -> List[str]

Returns

List of SearchIndexerSkillset names

Return type

Exceptions

get_skillsets

List the SearchIndexerSkillsets in an Azure Search service.

get_skillsets(**kwargs: Any) -> List[SearchIndexerSkillset]

Returns

List of SearchIndexerSkillsets

Return type

Exceptions

reset_indexer

Resets the change tracking state associated with an indexer.

reset_indexer(name: str, **kwargs: Any) -> None

Parameters

name
str
Required

The name of the indexer to reset.

Returns

None

Return type

run_indexer

Run an indexer.

run_indexer(name: str, **kwargs: Any) -> None

Parameters

name
str
Required

The name of the indexer to run.

Returns

None

Return type