通过


你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

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)

检索服务中现有知识源的列表。

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)

检索服务中现有知识源的列表。

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[]>