SearchIndexerClient class

用來執行作業的類別,以管理(建立、更新、列出/刪除)索引器、數據源 & 技能集。

建構函式

SearchIndexerClient(string, KeyCredential | TokenCredential, SearchIndexerClientOptions)

建立 SearchIndexerClient 的實例。

範例用法:

import { SearchIndexerClient, AzureKeyCredential } from "@azure/search-documents";

const indexerClient = new SearchIndexerClient("<endpoint>", new AzureKeyCredential("<apiKey>"));

屬性

apiVersion

與服務通訊時要使用的 API 版本。

endpoint

搜尋服務的端點

pipeline

內部 HTTP 管線的參考,以與原始請求搭配使用

serviceVersion

與服務通訊時要使用的 API 版本。

方法

createDataSourceConnection(SearchIndexerDataSourceConnection, OperationOptions)

在搜尋服務中建立新的 DataSource。

createIndexer(SearchIndexer, OperationOptions)

在搜尋服務中建立新的索引器。

createOrUpdateDataSourceConnection(SearchIndexerDataSourceConnection, CreateOrUpdateDataSourceConnectionOptions)

建立新的數據源或修改現有的數據源。

createOrUpdateIndexer(SearchIndexer, CreateOrUpdateIndexerOptions)

建立新的索引器或修改現有的索引器。

createOrUpdateSkillset(SearchIndexerSkillset, CreateOrUpdateSkillsetOptions)

建立新的 Skillset 或修改現有的技能集。

createSkillset(SearchIndexerSkillset, OperationOptions)

在搜尋服務中建立新的技能集。

deleteDataSourceConnection(string | SearchIndexerDataSourceConnection, DeleteDataSourceConnectionOptions)

刪除現有的數據源。

deleteIndexer(string | SearchIndexer, DeleteIndexerOptions)

刪除現有的索引器。

deleteSkillset(string | SearchIndexerSkillset, DeleteSkillsetOptions)

刪除現有的 Skillset。

getDataSourceConnection(string, OperationOptions)

擷取 DataSource 的相關信息

getIndexer(string, OperationOptions)

擷取索引器的相關信息。

getIndexerStatus(string, OperationOptions)

傳回索引器目前的狀態和執行歷程記錄。

getSkillset(string, OperationOptions)

擷取 Skillset 的相關信息。

listDataSourceConnections(ResourceListingOptions)

擷取服務中現有數據源的清單。

listDataSourceConnectionsNames(ResourceListingOptions)

擷取服務中現有數據源的名稱清單。

listIndexers(ResourceListingOptions)

擷取服務中現有的索引器清單。

listIndexersNames(ResourceListingOptions)

擷取服務中現有索引器的名稱清單。

listSkillsets(ResourceListingOptions)

擷取服務中現有的 Skillsets 清單。

listSkillsetsNames(ResourceListingOptions)

擷取服務中現有 Skillsets 的名稱清單。

resetIndexer(string, OperationOptions)

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

resyncIndexer(string, ResyncIndexerOptions)

從資料來源重新同步處理選擇性選項,以由索引子重新擷取。

runIndexer(string, OperationOptions)

視需要執行索引器。

建構函式詳細資料

SearchIndexerClient(string, KeyCredential | TokenCredential, SearchIndexerClientOptions)

建立 SearchIndexerClient 的實例。

範例用法:

import { SearchIndexerClient, AzureKeyCredential } from "@azure/search-documents";

const indexerClient = new SearchIndexerClient("<endpoint>", new AzureKeyCredential("<apiKey>"));
new SearchIndexerClient(endpoint: string, credential: KeyCredential | TokenCredential, options?: SearchIndexerClientOptions)

參數

endpoint

string

搜尋服務的端點

credential

KeyCredential | TokenCredential

用來驗證服務的要求。

options
SearchIndexerClientOptions

用來設定搜尋用戶端。

屬性詳細資料

apiVersion

警告

此 API 現已淘汰。

use {@Link serviceVersion} instead

與服務通訊時要使用的 API 版本。

apiVersion: string

屬性值

string

endpoint

搜尋服務的端點

endpoint: string

屬性值

string

pipeline

內部 HTTP 管線的參考,以與原始請求搭配使用

pipeline: Pipeline

屬性值

serviceVersion

與服務通訊時要使用的 API 版本。

serviceVersion: string

屬性值

string

方法詳細資料

createDataSourceConnection(SearchIndexerDataSourceConnection, OperationOptions)

在搜尋服務中建立新的 DataSource。

function createDataSourceConnection(dataSourceConnection: SearchIndexerDataSourceConnection, options?: OperationOptions): Promise<SearchIndexerDataSourceConnection>

參數

dataSourceConnection
SearchIndexerDataSourceConnection

在搜尋服務中建立的 dataSource 定義。

options
OperationOptions

其他選擇性自變數。

傳回

createIndexer(SearchIndexer, OperationOptions)

在搜尋服務中建立新的索引器。

function createIndexer(indexer: SearchIndexer, options?: OperationOptions): Promise<SearchIndexer>

參數

indexer
SearchIndexer

在搜尋服務中建立的索引器定義。

options
OperationOptions

其他選擇性自變數。

傳回

Promise<SearchIndexer>

createOrUpdateDataSourceConnection(SearchIndexerDataSourceConnection, CreateOrUpdateDataSourceConnectionOptions)

建立新的數據源或修改現有的數據源。

function createOrUpdateDataSourceConnection(dataSourceConnection: SearchIndexerDataSourceConnection, options?: CreateOrUpdateDataSourceConnectionOptions): Promise<SearchIndexerDataSourceConnection>

參數

dataSourceConnection
SearchIndexerDataSourceConnection

描述要建立/更新之數據源的資訊。

options
@azure/search-documents.CreateOrUpdateDataSourceConnectionOptions

其他選擇性自變數。

傳回

createOrUpdateIndexer(SearchIndexer, CreateOrUpdateIndexerOptions)

建立新的索引器或修改現有的索引器。

function createOrUpdateIndexer(indexer: SearchIndexer, options?: CreateOrUpdateIndexerOptions): Promise<SearchIndexer>

參數

indexer
SearchIndexer

描述要建立/更新之索引器的資訊。

options
@azure/search-documents.CreateOrUpdateIndexerOptions

其他選擇性自變數。

傳回

Promise<SearchIndexer>

createOrUpdateSkillset(SearchIndexerSkillset, CreateOrUpdateSkillsetOptions)

建立新的 Skillset 或修改現有的技能集。

function createOrUpdateSkillset(skillset: SearchIndexerSkillset, options?: CreateOrUpdateSkillsetOptions): Promise<SearchIndexerSkillset>

參數

skillset
SearchIndexerSkillset

描述要建立之索引的資訊。

options
CreateOrUpdateSkillsetOptions

其他選擇性自變數。

傳回

createSkillset(SearchIndexerSkillset, OperationOptions)

在搜尋服務中建立新的技能集。

function createSkillset(skillset: SearchIndexerSkillset, options?: OperationOptions): Promise<SearchIndexerSkillset>

參數

skillset
SearchIndexerSkillset

技能集,其中包含在搜尋服務中建立的一或多個技能。

options
OperationOptions

其他選擇性自變數。

傳回

deleteDataSourceConnection(string | SearchIndexerDataSourceConnection, DeleteDataSourceConnectionOptions)

刪除現有的數據源。

function deleteDataSourceConnection(dataSourceConnection: string | SearchIndexerDataSourceConnection, options?: DeleteDataSourceConnectionOptions): Promise<void>

參數

dataSourceConnection

string | SearchIndexerDataSourceConnection

options
DeleteDataSourceConnectionOptions

其他選擇性自變數。

傳回

Promise<void>

deleteIndexer(string | SearchIndexer, DeleteIndexerOptions)

刪除現有的索引器。

function deleteIndexer(indexer: string | SearchIndexer, options?: DeleteIndexerOptions): Promise<void>

參數

indexer

string | SearchIndexer

要刪除之索引器/索引器的名稱。

options
DeleteIndexerOptions

其他選擇性自變數。

傳回

Promise<void>

deleteSkillset(string | SearchIndexerSkillset, DeleteSkillsetOptions)

刪除現有的 Skillset。

function deleteSkillset(skillset: string | SearchIndexerSkillset, options?: DeleteSkillsetOptions): Promise<void>

參數

skillset

string | SearchIndexerSkillset

要刪除之 Skillset/Skillset 的名稱。

options
DeleteSkillsetOptions

其他選擇性自變數。

傳回

Promise<void>

getDataSourceConnection(string, OperationOptions)

擷取 DataSource 的相關信息

function getDataSourceConnection(dataSourceConnectionName: string, options?: OperationOptions): Promise<SearchIndexerDataSourceConnection>

參數

dataSourceConnectionName

string

options
OperationOptions

其他選擇性自變數

傳回

getIndexer(string, OperationOptions)

擷取索引器的相關信息。

function getIndexer(indexerName: string, options?: OperationOptions): Promise<SearchIndexer>

參數

indexerName

string

Indexer 的名稱。

options
OperationOptions

其他選擇性自變數。

傳回

Promise<SearchIndexer>

getIndexerStatus(string, OperationOptions)

傳回索引器目前的狀態和執行歷程記錄。

function getIndexerStatus(indexerName: string, options?: OperationOptions): Promise<SearchIndexerStatus>

參數

indexerName

string

索引器的名稱。

options
OperationOptions

其他選擇性自變數。

傳回

getSkillset(string, OperationOptions)

擷取 Skillset 的相關信息。

function getSkillset(skillsetName: string, options?: OperationOptions): Promise<SearchIndexerSkillset>

參數

skillsetName

string

options
OperationOptions

其他選擇性自變數。

傳回

listDataSourceConnections(ResourceListingOptions)

擷取服務中現有數據源的清單。

function listDataSourceConnections(options?: ResourceListingOptions): Promise<SearchIndexerDataSourceConnection[]>

參數

options
ResourceListingOptions

清單索引器作業的選項。

傳回

listDataSourceConnectionsNames(ResourceListingOptions)

擷取服務中現有數據源的名稱清單。

function listDataSourceConnectionsNames(options?: ResourceListingOptions): Promise<string[]>

參數

options
ResourceListingOptions

清單索引器作業的選項。

傳回

Promise<string[]>

listIndexers(ResourceListingOptions)

擷取服務中現有的索引器清單。

function listIndexers(options?: ResourceListingOptions): Promise<SearchIndexer[]>

參數

options
ResourceListingOptions

清單索引器作業的選項。

傳回

Promise<SearchIndexer[]>

listIndexersNames(ResourceListingOptions)

擷取服務中現有索引器的名稱清單。

function listIndexersNames(options?: ResourceListingOptions): Promise<string[]>

參數

options
ResourceListingOptions

清單索引器作業的選項。

傳回

Promise<string[]>

listSkillsets(ResourceListingOptions)

擷取服務中現有的 Skillsets 清單。

function listSkillsets(options?: ResourceListingOptions): Promise<SearchIndexerSkillset[]>

參數

options
ResourceListingOptions

清單技能集作業的選項。

傳回

listSkillsetsNames(ResourceListingOptions)

擷取服務中現有 Skillsets 的名稱清單。

function listSkillsetsNames(options?: ResourceListingOptions): Promise<string[]>

參數

options
ResourceListingOptions

清單技能集作業的選項。

傳回

Promise<string[]>

resetIndexer(string, OperationOptions)

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

function resetIndexer(indexerName: string, options?: OperationOptions): Promise<void>

參數

indexerName

string

要重設之索引器的名稱。

options
OperationOptions

其他選擇性自變數。

傳回

Promise<void>

resyncIndexer(string, ResyncIndexerOptions)

從資料來源重新同步處理選擇性選項,以由索引子重新擷取。

function resyncIndexer(indexerName: string, options?: ResyncIndexerOptions): Promise<void>

參數

indexerName

string

要重新同步的索引器的名稱。

options
ResyncIndexerOptions

其他可選參數,包括要執行的重新同步選項。

傳回

Promise<void>

runIndexer(string, OperationOptions)

視需要執行索引器。

function runIndexer(indexerName: string, options?: OperationOptions): Promise<void>

參數

indexerName

string

要執行的索引器名稱。

options
OperationOptions

其他選擇性自變數。

傳回

Promise<void>