SearchIndexerClient 類別

要與 Azure 搜尋服務索引子互動的用戶端。

繼承
azure.search.documents._headers_mixin.HeadersMixin
SearchIndexerClient

建構函式

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

參數

endpoint
str
必要

Azure 搜尋服務的 URL 端點

credential
AzureKeyCredentialTokenCredential
必要

用來授權搜尋用戶端要求的認證

api_version
str

要用於要求的搜尋 API 版本。

audience
str

會設定要用於 Azure Active Directory (AAD) 驗證的物件。 使用共用金鑰時,不會考慮物件。 如果未提供物件,則會假設公用雲端物件。

方法

close

SearchIndexerClient關閉會話。

create_data_source_connection

建立新的資料來源連接。

create_indexer

建立新的 SearchIndexer。

create_or_update_data_source_connection

建立新的資料來源連接,或在資料來源連接已經存在時更新資料來源連接。 :p aram data_source_connection:要建立或更新的資料來源連線定義。 :type data_source_connection: ~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection :keyword match_condition: 要在 etag :p aramtype match_condition上使用的比對條件: ~azure.core.MatchConditions :return: 建立的 SearchIndexerDataSourceConnection :rtype: ~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection

create_or_update_indexer

建立新的索引子,或在索引子已經存在時更新索引子。

create_or_update_skillset

在 Azure 搜尋服務中建立新的 SearchIndexerSkillset,或更新現有的 SearchIndexerSkillset。

create_skillset

在 Azure 搜尋服務中建立新的 SearchIndexerSkillset

delete_data_source_connection

刪除資料來源連接。 若要使用存取條件,必須提供 SearchIndexerDataSourceConnection 模型,而不是名稱。 它足以提供資料來源連接的名稱,以無條件地刪除

delete_indexer

刪除索引子。 若要使用存取條件,必須提供 SearchIndexer 模型,而不是名稱。 它足以提供索引子的名稱,以無條件刪除。

delete_skillset

刪除 Azure 搜尋服務中名為 SearchIndexerSkillset 的 。 若要使用存取條件,必須提供 SearchIndexerSkillset 模型,而不是名稱。 它足以提供技能集的名稱,以無條件地刪除

get_data_source_connection

擷取資料來源連接定義。

get_data_source_connection_names

列出可供搜尋服務使用的所有資料來源連接名稱。

get_data_source_connections

列出可供搜尋服務使用的所有資料來源連線。

get_indexer

擷取索引子定義。

get_indexer_names

列出可供搜尋服務使用的所有索引子名稱。

get_indexer_status

取得索引子的狀態。

get_indexers

列出可供搜尋服務使用的所有索引子。

get_skillset

在 Azure 搜尋服務中擷取具名 SearchIndexerSkillset

get_skillset_names

列出 Azure 搜尋服務中的 SearchIndexerSkillset 名稱。

get_skillsets

列出 Azure 搜尋服務中的 SearchIndexerSkillsets。

reset_indexer

重設與索引子相關聯的變更追蹤狀態。

run_indexer

執行索引子。

close

SearchIndexerClient關閉會話。

close() -> None

create_data_source_connection

建立新的資料來源連接。

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

參數

data_source_connection
SearchIndexerDataSourceConnection
必要

要建立之資料來源連接的定義。

傳回

已建立的 SearchIndexerDataSourceConnection

傳回類型

範例

建立資料來源


   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

建立新的 SearchIndexer。

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

參數

indexer
SearchIndexer
必要

要建立的索引子的定義。

傳回

已建立的 SearchIndexer

傳回類型

create_or_update_data_source_connection

建立新的資料來源連接,或在資料來源連接已經存在時更新資料來源連接。 :p aram data_source_connection:要建立或更新的資料來源連線定義。 :type data_source_connection: ~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection :keyword match_condition: 要在 etag :p aramtype match_condition上使用的比對條件: ~azure.core.MatchConditions :return: 建立的 SearchIndexerDataSourceConnection :rtype: ~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection

create_or_update_data_source_connection(data_source_connection: SearchIndexerDataSourceConnection, *, match_condition: MatchConditions = MatchConditions.Unconditionally, **kwargs: Any) -> SearchIndexerDataSourceConnection

create_or_update_indexer

建立新的索引子,或在索引子已經存在時更新索引子。

create_or_update_indexer(indexer: SearchIndexer, *, match_condition: MatchConditions = MatchConditions.Unconditionally, **kwargs: Any) -> SearchIndexer

參數

indexer
SearchIndexer
必要

要建立或更新的索引子的定義。

match_condition
MatchConditions

要用於 etag 的比對條件

傳回

已建立的 SearchIndexer

傳回類型

create_or_update_skillset

在 Azure 搜尋服務中建立新的 SearchIndexerSkillset,或更新現有的 SearchIndexerSkillset。

create_or_update_skillset(skillset: SearchIndexerSkillset, *, match_condition: MatchConditions = MatchConditions.Unconditionally, **kwargs: Any) -> SearchIndexerSkillset

參數

skillset
SearchIndexerSkillset
必要

要建立或更新的 SearchIndexerSkillset 物件

match_condition
MatchConditions

要用於 etag 的比對條件

傳回

已建立或更新的 SearchIndexerSkillset

傳回類型

create_skillset

在 Azure 搜尋服務中建立新的 SearchIndexerSkillset

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

參數

skillset
SearchIndexerSkillset
必要

要建立的 SearchIndexerSkillset 物件

傳回

建立的 SearchIndexerSkillset

傳回類型

delete_data_source_connection

刪除資料來源連接。 若要使用存取條件,必須提供 SearchIndexerDataSourceConnection 模型,而不是名稱。 它足以提供資料來源連接的名稱,以無條件地刪除

delete_data_source_connection(data_source_connection: str | SearchIndexerDataSourceConnection, *, match_condition: MatchConditions = MatchConditions.Unconditionally, **kwargs: Any) -> None

參數

data_source_connection
strSearchIndexerDataSourceConnection
必要

要刪除的資料來源連接。

match_condition
MatchConditions

要用於 etag 的比對條件

傳回

傳回類型

範例

刪除 SearchIndexerDataSourceConnection


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

delete_indexer

刪除索引子。 若要使用存取條件,必須提供 SearchIndexer 模型,而不是名稱。 它足以提供索引子的名稱,以無條件刪除。

delete_indexer(indexer: str | SearchIndexer, *, match_condition: MatchConditions = MatchConditions.Unconditionally, **kwargs: Any) -> None

參數

indexer
strSearchIndexer
必要

要刪除的索引子。

match_condition
MatchConditions

要用於 etag 的比對條件

傳回

傳回類型

delete_skillset

刪除 Azure 搜尋服務中名為 SearchIndexerSkillset 的 。 若要使用存取條件,必須提供 SearchIndexerSkillset 模型,而不是名稱。 它足以提供技能集的名稱,以無條件地刪除

delete_skillset(skillset: str | SearchIndexerSkillset, *, match_condition: MatchConditions = MatchConditions.Unconditionally, **kwargs: Any) -> None

參數

skillset
strSearchIndexerSkillset
必要

要刪除的 SearchIndexerSkillset

match_condition
MatchConditions

要用於 etag 的比對條件

get_data_source_connection

擷取資料來源連接定義。

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

參數

name
str
必要

要擷取的資料來源連接名稱。

傳回

擷取的 SearchIndexerDataSourceConnection。

傳回類型

範例

擷取 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

列出可供搜尋服務使用的所有資料來源連接名稱。

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

傳回

所有資料來源連接名稱的清單。

傳回類型

get_data_source_connections

列出可供搜尋服務使用的所有資料來源連線。

get_data_source_connections(*, select: List[str] | None = None, **kwargs: Any) -> Sequence[SearchIndexerDataSourceConnection]

參數

select
list[str]

選取要擷取之技能集的最上層屬性。 指定為所有屬性的 JSON 屬性名稱清單或 '*'。 預設值為所有屬性。

傳回

所有資料來源連線的清單。

傳回類型

範例

列出所有 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

擷取索引子定義。

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

參數

name
str
必要

要擷取的索引子名稱。

傳回

擷取的 SearchIndexer。

傳回類型

get_indexer_names

列出可供搜尋服務使用的所有索引子名稱。

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

傳回

所有 SearchIndexers 的清單。

傳回類型

get_indexer_status

取得索引子的狀態。

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

參數

name
str
必要

要擷取狀態的索引子名稱。

傳回

SearchIndexerStatus

傳回類型

get_indexers

列出可供搜尋服務使用的所有索引子。

get_indexers(*, select: List[str] | None = None, **kwargs: Any) -> Sequence[SearchIndexer]

參數

select
list[str]

選取要擷取之技能集的最上層屬性。 指定為所有屬性的 JSON 屬性名稱清單或 '*'。 預設值為所有屬性。

傳回

所有 SearchIndexers 的清單。

傳回類型

get_skillset

在 Azure 搜尋服務中擷取具名 SearchIndexerSkillset

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

參數

name
str
必要

要取得的 SearchIndexerSkillset 名稱

傳回

擷取的 SearchIndexerSkillset

傳回類型

例外狀況

get_skillset_names

列出 Azure 搜尋服務中的 SearchIndexerSkillset 名稱。

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

傳回

SearchIndexerSkillset 名稱的清單

傳回類型

例外狀況

get_skillsets

列出 Azure 搜尋服務中的 SearchIndexerSkillsets。

get_skillsets(*, select: List[str] | None = None, **kwargs: Any) -> List[SearchIndexerSkillset]

參數

select
list[str]

選取要擷取之技能集的最上層屬性。 指定為所有屬性的 JSON 屬性名稱清單或 '*'。 預設值為所有屬性。

傳回

SearchIndexerSkillsets 清單

傳回類型

例外狀況

reset_indexer

重設與索引子相關聯的變更追蹤狀態。

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

參數

name
str
必要

要重設的索引子名稱。

傳回

傳回類型

run_indexer

執行索引子。

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

參數

name
str
必要

要執行的索引子名稱。

傳回

傳回類型