SearchIndexerClient Class
A client to interact with Azure search service Indexers.
- Inheritance
-
azure.search.documents._headers_mixin.HeadersMixinSearchIndexerClient
Constructor
SearchIndexerClient(endpoint: str, credential: AzureKeyCredential, **kwargs: Any)
Parameters
- 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
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
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
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
- 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
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
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
- 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
- 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
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
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
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
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
get_indexer_status
Get the status of the indexer.
get_indexer_status(name: str, **kwargs: Any) -> SearchIndexerStatus
Parameters
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
get_skillset
Retrieve a named SearchIndexerSkillset in an Azure Search service
get_skillset(name: str, **kwargs: Any) -> SearchIndexerSkillset
Parameters
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
Returns
None
Return type
run_indexer
Saran dan Komentar
Kirim dan lihat umpan balik untuk