共用方式為


SearchIndexClient class

用來執行作業的類別,以管理(建立、更新、列出/刪除)索引,& 同義字對應。

建構函式

SearchIndexClient(string, KeyCredential | TokenCredential, SearchIndexClientOptions)

建立 SearchIndexClient 的實例。

範例用法:

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

const indexClient = new SearchIndexClient("<endpoint>", new AzureKeyCredential("<apiKey>"));

屬性

apiVersion

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

endpoint

搜尋服務的端點

pipeline

對用於原始請求的內部 HTTP 管道的引用

serviceVersion

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

方法

analyzeText(string, AnalyzeTextOptions)

在提供的文字上手動呼叫分析器或 Tokenizer。

createAlias(SearchAlias, OperationOptions)

建立新的搜尋別名。

createIndex(SearchIndex, OperationOptions)

建立新的索引。

createKnowledgeBase(KnowledgeBase, CreateKnowledgeBaseOptions)

建立新的知識庫。

createKnowledgeSource(KnowledgeSource, CreateKnowledgeSourceOptions)

建立新的知識來源。

createOrUpdateAlias(SearchAlias, CreateOrUpdateAliasOptions)

建立新的搜尋別名,或更新已經存在的別名。

createOrUpdateIndex(SearchIndex, CreateOrUpdateIndexOptions)

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

createOrUpdateKnowledgeBase(string, KnowledgeBase, CreateOrUpdateKnowledgeBaseOptions)

建立新的知識庫,或如果已有的知識庫會更新。

createOrUpdateKnowledgeSource(string, KnowledgeSource, CreateOrUpdateKnowledgeSourceOptions)
createOrUpdateSynonymMap(SynonymMap, CreateOrUpdateSynonymMapOptions)

建立新的 SynonymMap 或修改現有的同義字對應。

createSynonymMap(SynonymMap, OperationOptions)

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

deleteAlias(SearchAlias, DeleteAliasOptions)

刪除搜尋別名及其與索引的關聯對應。 這項作業是永久性的,沒有復原選項。 此作業不會觸及對應的索引。

deleteAlias(string, DeleteAliasOptions)

刪除搜尋別名及其與索引的關聯對應。 這項作業是永久性的,沒有復原選項。 此作業不會觸及對應的索引。

deleteIndex(SearchIndex, DeleteIndexOptions)

刪除現有的索引。

deleteIndex(string, DeleteIndexOptions)

刪除現有的索引。

deleteKnowledgeBase(KnowledgeBase, DeleteKnowledgeBaseOptions)

刪除現有的知識庫。

deleteKnowledgeBase(string, DeleteKnowledgeBaseOptions)

刪除現有的知識庫。

deleteKnowledgeSource(KnowledgeSource, DeleteKnowledgeSourceOptions)

刪除現有來源。

deleteKnowledgeSource(string, DeleteKnowledgeSourceOptions)

刪除現有來源。

deleteSynonymMap(string | SynonymMap, DeleteSynonymMapOptions)

刪除現有的 SynonymMap。

getAlias(string, OperationOptions)

擷取別名定義。

getIndex(string, OperationOptions)

擷取索引的相關信息。

getIndexStatistics(string, OperationOptions)

擷取索引的相關統計數據,例如文件計數和索引記憶體的大小。

getIndexStatsSummary(GetIndexStatsSummaryOptions)

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

getKnowledgeBase(string, GetKnowledgeBaseOptions)

取得知識庫定義。

getKnowledgeRetrievalClient(string, KnowledgeRetrievalClientOptions)

擷取對應至此 SearchIndexClient 的 KnowledgeRetrievalClient

getKnowledgeSource(string, GetKnowledgeSourceOptions)

擷取知識來源定義。

getKnowledgeSourceStatus(string, GetKnowledgeSourceStatusOptions)

傳回知識來源的目前狀態和同步處理歷程記錄。

getSearchClient<TModel>(string, SearchClientOptions)

擷取對應至此 SearchIndexClient 的 SearchClient

getServiceStatistics(OperationOptions)

擷取服務的相關統計數據,例如文件計數、索引等。

getSynonymMap(string, OperationOptions)

擷取 SynonymMap 的相關信息。

listAliases(OperationOptions)

列出搜尋服務可用的所有別名。

listIndexes(OperationOptions)

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

listIndexesNames(OperationOptions)

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

listKnowledgeBases(ListKnowledgeBasesOptions)

檢索服務中現有知識庫的清單。

listKnowledgeSources(ListKnowledgeSourcesOptions)

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

listSynonymMaps(OperationOptions)

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

listSynonymMapsNames(OperationOptions)

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

建構函式詳細資料

SearchIndexClient(string, KeyCredential | TokenCredential, SearchIndexClientOptions)

建立 SearchIndexClient 的實例。

範例用法:

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

const indexClient = new SearchIndexClient("<endpoint>", new AzureKeyCredential("<apiKey>"));
new SearchIndexClient(endpoint: string, credential: KeyCredential | TokenCredential, options?: SearchIndexClientOptions)

參數

endpoint

string

搜尋服務的端點

credential

KeyCredential | TokenCredential

用來驗證服務的要求。

options
SearchIndexClientOptions

用來設定搜尋索引用戶端。

屬性詳細資料

apiVersion

警告

此 API 現已淘汰。

use {@Link serviceVersion} instead

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

apiVersion: string

屬性值

string

endpoint

搜尋服務的端點

endpoint: string

屬性值

string

pipeline

對用於原始請求的內部 HTTP 管道的引用

pipeline: Pipeline

屬性值

serviceVersion

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

serviceVersion: string

屬性值

string

方法詳細資料

analyzeText(string, AnalyzeTextOptions)

在提供的文字上手動呼叫分析器或 Tokenizer。

function analyzeText(indexName: string, options: AnalyzeTextOptions): Promise<AnalyzeResult>

參數

indexName

string

包含要分析之欄位的索引名稱

options
AnalyzeTextOptions

其他自變數

傳回

Promise<AnalyzeResult>

createAlias(SearchAlias, OperationOptions)

建立新的搜尋別名。

function createAlias(alias: SearchAlias, options?: OperationOptions): Promise<SearchAlias>

參數

alias
SearchAlias

要創建的別名的定義。

options
OperationOptions

選項參數。

傳回

Promise<SearchAlias>

createIndex(SearchIndex, OperationOptions)

建立新的索引。

function createIndex(index: SearchIndex, options?: OperationOptions): Promise<SearchIndex>

參數

index
SearchIndex

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

options
OperationOptions

其他選擇性自變數。

傳回

Promise<SearchIndex>

createKnowledgeBase(KnowledgeBase, CreateKnowledgeBaseOptions)

建立新的知識庫。

function createKnowledgeBase(knowledgeBase: KnowledgeBase, options?: CreateKnowledgeBaseOptions): Promise<KnowledgeBase>

參數

knowledgeBase
KnowledgeBase

建立知識庫的定義。

options
CreateKnowledgeBaseOptions

options 參數。

傳回

Promise<KnowledgeBase>

createKnowledgeSource(KnowledgeSource, CreateKnowledgeSourceOptions)

建立新的知識來源。

function createKnowledgeSource(knowledgeSource: KnowledgeSource, options?: CreateKnowledgeSourceOptions): Promise<KnowledgeSource>

參數

knowledgeSource
KnowledgeSource

要建立的知識來源的定義。

options
CreateKnowledgeSourceOptions

選項參數。

傳回

Promise<KnowledgeSource>

createOrUpdateAlias(SearchAlias, CreateOrUpdateAliasOptions)

建立新的搜尋別名,或更新已經存在的別名。

function createOrUpdateAlias(alias: SearchAlias, options?: CreateOrUpdateAliasOptions): Promise<SearchAlias>

參數

alias
SearchAlias

要建立或更新之別名的定義。

options
CreateOrUpdateAliasOptions

選項參數。

傳回

Promise<SearchAlias>

createOrUpdateIndex(SearchIndex, CreateOrUpdateIndexOptions)

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

function createOrUpdateIndex(index: SearchIndex, options?: CreateOrUpdateIndexOptions): Promise<SearchIndex>

參數

index
SearchIndex

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

options
CreateOrUpdateIndexOptions

其他選擇性自變數。

傳回

Promise<SearchIndex>

createOrUpdateKnowledgeBase(string, KnowledgeBase, CreateOrUpdateKnowledgeBaseOptions)

建立新的知識庫,或如果已有的知識庫會更新。

function createOrUpdateKnowledgeBase(knowledgeBaseName: string, knowledgeBase: KnowledgeBase, options?: CreateOrUpdateKnowledgeBaseOptions): Promise<KnowledgeBase>

參數

knowledgeBaseName

string

要建立或更新的知識庫名稱。

knowledgeBase
KnowledgeBase

定義知識庫以建立或更新。

options
CreateOrUpdateKnowledgeBaseOptions

options 參數。

傳回

Promise<KnowledgeBase>

createOrUpdateKnowledgeSource(string, KnowledgeSource, CreateOrUpdateKnowledgeSourceOptions)

function createOrUpdateKnowledgeSource(sourceName: string, knowledgeSource: KnowledgeSource, options?: CreateOrUpdateKnowledgeSourceOptions): Promise<KnowledgeSource>

參數

sourceName

string

knowledgeSource
KnowledgeSource

傳回

Promise<KnowledgeSource>

createOrUpdateSynonymMap(SynonymMap, CreateOrUpdateSynonymMapOptions)

建立新的 SynonymMap 或修改現有的同義字對應。

function createOrUpdateSynonymMap(synonymMap: SynonymMap, options?: CreateOrUpdateSynonymMapOptions): Promise<SynonymMap>

參數

synonymMap
SynonymMap

描述要建立之 SynonymMap 的資訊。

options
CreateOrUpdateSynonymMapOptions

其他選擇性自變數。

傳回

Promise<SynonymMap>

createSynonymMap(SynonymMap, OperationOptions)

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

function createSynonymMap(synonymMap: SynonymMap, options?: OperationOptions): Promise<SynonymMap>

參數

synonymMap
SynonymMap

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

options
OperationOptions

其他選擇性自變數。

傳回

Promise<SynonymMap>

deleteAlias(SearchAlias, DeleteAliasOptions)

刪除搜尋別名及其與索引的關聯對應。 這項作業是永久性的,沒有復原選項。 此作業不會觸及對應的索引。

function deleteAlias(alias: SearchAlias, options?: DeleteAliasOptions): Promise<void>

參數

alias
SearchAlias

要刪除的別名。

options
DeleteAliasOptions

其他選擇性自變數。

傳回

Promise<void>

deleteAlias(string, DeleteAliasOptions)

刪除搜尋別名及其與索引的關聯對應。 這項作業是永久性的,沒有復原選項。 此作業不會觸及對應的索引。

function deleteAlias(aliasName: string, options?: DeleteAliasOptions): Promise<void>

參數

aliasName

string

要刪除的別名名稱。

options
DeleteAliasOptions

其他選擇性自變數。

傳回

Promise<void>

deleteIndex(SearchIndex, DeleteIndexOptions)

刪除現有的索引。

function deleteIndex(index: SearchIndex, options?: DeleteIndexOptions): Promise<void>

參數

index
SearchIndex

要刪除的索引。

options
DeleteIndexOptions

其他選擇性自變數。

傳回

Promise<void>

deleteIndex(string, DeleteIndexOptions)

刪除現有的索引。

function deleteIndex(indexName: string, options?: DeleteIndexOptions): Promise<void>

參數

indexName

string

要刪除的索引名稱。

options
DeleteIndexOptions

其他選擇性自變數。

傳回

Promise<void>

deleteKnowledgeBase(KnowledgeBase, DeleteKnowledgeBaseOptions)

刪除現有的知識庫。

function deleteKnowledgeBase(knowledgeBase: KnowledgeBase, options?: DeleteKnowledgeBaseOptions): Promise<void>

參數

knowledgeBase
KnowledgeBase

刪除知識庫。

options
DeleteKnowledgeBaseOptions

options 參數。

傳回

Promise<void>

deleteKnowledgeBase(string, DeleteKnowledgeBaseOptions)

刪除現有的知識庫。

function deleteKnowledgeBase(knowledgeBaseName: string, options?: DeleteKnowledgeBaseOptions): Promise<void>

參數

knowledgeBaseName

string

要刪除的知識庫名稱。

options
DeleteKnowledgeBaseOptions

options 參數。

傳回

Promise<void>

deleteKnowledgeSource(KnowledgeSource, DeleteKnowledgeSourceOptions)

刪除現有來源。

function deleteKnowledgeSource(source: KnowledgeSource, options?: DeleteKnowledgeSourceOptions): Promise<void>

參數

source
KnowledgeSource

要刪除的知識來源。

options
DeleteKnowledgeSourceOptions

options 參數。

傳回

Promise<void>

deleteKnowledgeSource(string, DeleteKnowledgeSourceOptions)

刪除現有來源。

function deleteKnowledgeSource(sourceName: string, options?: DeleteKnowledgeSourceOptions): Promise<void>

參數

sourceName

string

要刪除的知識來源名稱。

options
DeleteKnowledgeSourceOptions

options 參數。

傳回

Promise<void>

deleteSynonymMap(string | SynonymMap, DeleteSynonymMapOptions)

刪除現有的 SynonymMap。

function deleteSynonymMap(synonymMap: string | SynonymMap, options?: DeleteSynonymMapOptions): Promise<void>

參數

synonymMap

string | SynonymMap

options
DeleteSynonymMapOptions

其他選擇性自變數。

傳回

Promise<void>

getAlias(string, OperationOptions)

擷取別名定義。

function getAlias(aliasName: string, options?: OperationOptions): Promise<SearchAlias>

參數

aliasName

string

要擷取的別名名稱。

options
OperationOptions

選項參數。

傳回

Promise<SearchAlias>

getIndex(string, OperationOptions)

擷取索引的相關信息。

function getIndex(indexName: string, options?: OperationOptions): Promise<SearchIndex>

參數

indexName

string

索引的名稱。

options
OperationOptions

其他選擇性自變數。

傳回

Promise<SearchIndex>

getIndexStatistics(string, OperationOptions)

擷取索引的相關統計數據,例如文件計數和索引記憶體的大小。

function getIndexStatistics(indexName: string, options?: OperationOptions): Promise<SearchIndexStatistics>

參數

indexName

string

索引的名稱。

options
OperationOptions

其他選擇性自變數。

傳回

getIndexStatsSummary(GetIndexStatsSummaryOptions)

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

function getIndexStatsSummary(options?: GetIndexStatsSummaryOptions): IndexStatisticsSummaryIterator

參數

options
GetIndexStatsSummaryOptions

清單索引作業的選項。

傳回

getKnowledgeBase(string, GetKnowledgeBaseOptions)

取得知識庫定義。

function getKnowledgeBase(knowledgeBaseName: string, options?: GetKnowledgeBaseOptions): Promise<KnowledgeBase>

參數

knowledgeBaseName

string

要取回的知識庫名稱。

options
GetKnowledgeBaseOptions

options 參數。

傳回

Promise<KnowledgeBase>

getKnowledgeRetrievalClient(string, KnowledgeRetrievalClientOptions)

擷取對應至此 SearchIndexClient 的 KnowledgeRetrievalClient

function getKnowledgeRetrievalClient(knowledgeBaseName: string, options?: KnowledgeRetrievalClientOptions): KnowledgeRetrievalClient

參數

knowledgeBaseName

string

知識庫名稱

options
KnowledgeRetrievalClientOptions

KnowledgeRetrievalClient 選項

傳回

getKnowledgeSource(string, GetKnowledgeSourceOptions)

擷取知識來源定義。

function getKnowledgeSource(sourceName: string, options?: GetKnowledgeSourceOptions): Promise<KnowledgeSource>

參數

sourceName

string

要擷取的知識來源名稱。

options
GetKnowledgeSourceOptions

選項參數。

傳回

Promise<KnowledgeSource>

getKnowledgeSourceStatus(string, GetKnowledgeSourceStatusOptions)

傳回知識來源的目前狀態和同步處理歷程記錄。

function getKnowledgeSourceStatus(sourceName: string, options?: GetKnowledgeSourceStatusOptions): Promise<KnowledgeSourceStatus>

參數

sourceName

string

要擷取狀態的知識來源名稱。

options
GetKnowledgeSourceStatusOptions

選項參數。

傳回

getSearchClient<TModel>(string, SearchClientOptions)

擷取對應至此 SearchIndexClient 的 SearchClient

function getSearchClient<TModel>(indexName: string, options?: SearchClientOptions): SearchClient<TModel>

參數

indexName

string

索引的名稱

options
SearchClientOptions

SearchClient 選項

傳回

SearchClient<TModel>

getServiceStatistics(OperationOptions)

擷取服務的相關統計數據,例如文件計數、索引等。

function getServiceStatistics(options?: OperationOptions): Promise<SearchServiceStatistics>

參數

options
OperationOptions

其他選擇性自變數。

傳回

getSynonymMap(string, OperationOptions)

擷取 SynonymMap 的相關信息。

function getSynonymMap(synonymMapName: string, options?: OperationOptions): Promise<SynonymMap>

參數

synonymMapName

string

SynonymMap 的名稱。

options
OperationOptions

其他選擇性自變數。

傳回

Promise<SynonymMap>

listAliases(OperationOptions)

列出搜尋服務可用的所有別名。

function listAliases(options?: OperationOptions): AliasIterator

參數

options
OperationOptions

選項參數。

傳回

listIndexes(OperationOptions)

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

function listIndexes(options?: OperationOptions): IndexIterator

參數

options
OperationOptions

清單索引作業的選項。

傳回

listIndexesNames(OperationOptions)

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

function listIndexesNames(options?: OperationOptions): IndexNameIterator

參數

options
OperationOptions

清單索引作業的選項。

傳回

listKnowledgeBases(ListKnowledgeBasesOptions)

檢索服務中現有知識庫的清單。

function listKnowledgeBases(options?: ListKnowledgeBasesOptions): KnowledgeBaseIterator

參數

options
ListKnowledgeBasesOptions

清單知識庫操作的選項。

傳回

listKnowledgeSources(ListKnowledgeSourcesOptions)

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

function listKnowledgeSources(options?: ListKnowledgeSourcesOptions): KnowledgeSourceIterator

參數

options
ListKnowledgeSourcesOptions

列出知識來源作業的選項。

傳回

listSynonymMaps(OperationOptions)

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

function listSynonymMaps(options?: OperationOptions): Promise<SynonymMap[]>

參數

options
OperationOptions

清單 SynonymMaps 作業的選項。

傳回

Promise<SynonymMap[]>

listSynonymMapsNames(OperationOptions)

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

function listSynonymMapsNames(options?: OperationOptions): Promise<string[]>

參數

options
OperationOptions

清單 SynonymMaps 作業的選項。

傳回

Promise<string[]>