SearchIndexClient class

Třída pro provádění operací pro správu indexů (vytváření, aktualizace, výpis/odstranění) & synonyma.

Konstruktory

SearchIndexClient(string, KeyCredential | TokenCredential, SearchIndexClientOptions)

Vytvoří instanci SearchIndexClient.

Příklad použití:

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

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

Vlastnosti

apiVersion

Verze rozhraní API, která se má použít při komunikaci se službou.

endpoint

Koncový bod vyhledávací služby

pipeline

Odkaz na interní kanál HTTP pro použití s nezpracovanými požadavky

serviceVersion

Verze rozhraní API, která se má použít při komunikaci se službou.

Metody

analyzeText(string, AnalyzeTextOptions)

Volání analyzátoru nebo tokenizátoru ručně pro zadaný text.

beginIngestKnowledgeSourceFile(string, UploadKnowledgeSourceFileMultipartRequest, IngestKnowledgeSourceFileOptions)

Zahajuje asynchronní ingestování nového souboru a vrací jeho operaci dotazování.

beginReplaceKnowledgeSourceFile(string, string, UpdateKnowledgeSourceFileRequest, IngestKnowledgeSourceFileOptions)

Zahajuje asynchronní nahrazování souboru a vrací jeho operaci dotazování.

createAlias(SearchAlias, OperationOptions)

Vytvoří nový alias hledání.

createIndex(SearchIndexInput | SearchIndex, OperationOptions)

Vytvoří nový index.

createKnowledgeBase(KnowledgeBase | KnowledgeBaseInput, CreateKnowledgeBaseOptions)

Vytváří novou znalostní základnu.

createKnowledgeSource(AzureBlobKnowledgeSourceInput | AzureBlobKnowledgeSource | BaseKnowledgeSource | IndexedOneLakeKnowledgeSourceInput | IndexedOneLakeKnowledgeSource | IndexedSharePointKnowledgeSourceInput | IndexedSharePointKnowledgeSource | IndexedSqlKnowledgeSourceInput | IndexedSqlKnowledgeSource | FileKnowledgeSourceInput | FileKnowledgeSource | RemoteSharePointKnowledgeSourceInput | FabricDataAgentKnowledgeSourceInput | FabricOntologyKnowledgeSourceInput | WorkIQKnowledgeSourceInput | McpServerKnowledgeSourceInput | SearchIndexKnowledgeSource | WebKnowledgeSource, CreateKnowledgeSourceOptions)

Vytvoří nový zdroj znalostí.

createOrUpdateAlias(SearchAlias, CreateOrUpdateAliasOptions)

Vytvoří nový alias vyhledávání nebo aktualizuje alias, pokud už existuje.

createOrUpdateIndex(SearchIndexInput | SearchIndex, CreateOrUpdateIndexOptions)

Vytvoří nový index nebo upraví existující index.

createOrUpdateKnowledgeBase(KnowledgeBase | KnowledgeBaseInput, CreateOrUpdateKnowledgeBaseOptions)

Vytváří novou znalostní bázi nebo aktualizuje znalostní bázi, pokud už existuje.

createOrUpdateKnowledgeBase(string, KnowledgeBase | KnowledgeBaseInput, CreateOrUpdateKnowledgeBaseOptions)

Vytváří nebo aktualizuje znalostní bázi s explicitním názvem.

createOrUpdateKnowledgeSource(AzureBlobKnowledgeSourceInput | AzureBlobKnowledgeSource | BaseKnowledgeSource | IndexedOneLakeKnowledgeSourceInput | IndexedOneLakeKnowledgeSource | IndexedSharePointKnowledgeSourceInput | IndexedSharePointKnowledgeSource | IndexedSqlKnowledgeSourceInput | IndexedSqlKnowledgeSource | FileKnowledgeSourceInput | FileKnowledgeSource | RemoteSharePointKnowledgeSourceInput | FabricDataAgentKnowledgeSourceInput | FabricOntologyKnowledgeSourceInput | WorkIQKnowledgeSourceInput | McpServerKnowledgeSourceInput | SearchIndexKnowledgeSource | WebKnowledgeSource, CreateOrUpdateKnowledgeSourceOptions)
createOrUpdateSynonymMap(SynonymMap, CreateOrUpdateSynonymMapOptions)

Vytvoří novou mapu synonym nebo upraví existující.

createSynonymMap(SynonymMap, OperationOptions)

Vytvoří novou mapu synonym ve vyhledávací službě.

deleteAlias(SearchAlias, DeleteAliasOptions)

Odstraní alias vyhledávání a jeho přidružené mapování na index. Tato operace je trvalá bez možnosti obnovení. Namapovaný index není touto operací nedotčen.

deleteAlias(string, DeleteAliasOptions)

Odstraní alias vyhledávání a jeho přidružené mapování na index. Tato operace je trvalá bez možnosti obnovení. Namapovaný index není touto operací nedotčen.

deleteIndex(SearchIndex, DeleteIndexOptions)

Odstraní existující index.

deleteIndex(string, DeleteIndexOptions)

Odstraní existující index.

deleteKnowledgeBase(KnowledgeBase, DeleteKnowledgeBaseOptions)

Odstraní existující znalostní bázi.

deleteKnowledgeBase(string, DeleteKnowledgeBaseOptions)

Odstraní existující znalostní bázi.

deleteKnowledgeSource(KnowledgeSource, DeleteKnowledgeSourceOptions)

Odstraní existující zdroj.

deleteKnowledgeSource(string, DeleteKnowledgeSourceOptions)

Odstraní existující zdroj.

deleteKnowledgeSourceFile(string, string, DeleteKnowledgeSourceFileOptions)

Smaže soubor ze zdroje znalostí souboru a odstraní veškerý indexovaný obsah odvozený z něj.

deleteSynonymMap(string | SynonymMap, DeleteSynonymMapOptions)

Odstraní existující mapu synonym.

getAlias(string, OperationOptions)

Načte definici aliasu.

getIndex(string, OperationOptions)

Načte informace o indexu.

getIndexStatistics(string, OperationOptions)

Načte statistiky o indexu, například počet dokumentů a velikost úložiště indexů.

getKnowledgeBase(string, GetKnowledgeBaseOptions)

Získává definici znalostní báze.

getKnowledgeRetrievalClient(string, KnowledgeRetrievalClientOptions)

Načte KnowledgeRetrievalClient odpovídající tomuto SearchIndexClient

getKnowledgeSource(string, GetKnowledgeSourceOptions)

Načte definici zdroje znalostí.

getKnowledgeSourceFileIngestionOperation(string, string, OperationOptions)

Získá stav a výsledek operace ingestování souboru.

getKnowledgeSourceStatus(string, GetKnowledgeSourceStatusOptions)

Vrací aktuální stav a historii synchronizace zdroje znalostí.

getSearchClient<TModel>(string, SearchClientOptions)

Načte SearchClient odpovídající tomuto SearchIndexClient.

getServiceStatistics(OperationOptions)

Načte statistiky o službě, například počet dokumentů, index atd.

getSynonymMap(string, OperationOptions)

Načte informace o objektu SynonymMap.

listAliases(ListAliasesOptions)

Zobrazí seznam všech aliasů dostupných pro vyhledávací službu.

listIndexes(ResourceListingOptions)

Načte seznam existujících indexů ve službě.

listIndexesNames(ResourceListingOptions)

Načte seznam názvů existujících indexů ve službě.

listIndexStatsSummary(ListIndexStatsSummaryOptions)

Načte souhrn statistik pro všechny indexy ve vyhledávací službě.

listKnowledgeBases(ListKnowledgeBasesOptions)

Získá seznam existujících KnowledgeBases ve službě.

listKnowledgeSourceFileIngestionOperations(string, OperationOptions)

Uvádí zachované ingestní operace pro zdroj znalostí souboru.

listKnowledgeSourceFiles(string, ListKnowledgeSourceFilesOptions)

Uvádí všechny soubory ve zdroji znalostí souboru.

listKnowledgeSources(ListKnowledgeSourcesOptions)

Načte seznam existujících zdrojů znalostí ve službě.

listSynonymMaps(ResourceListingOptions)

Načte seznam existujících synonymMap ve službě.

listSynonymMapsNames(ResourceListingOptions)

Načte seznam názvů existujících objektů SynonymMap ve službě.

updateKnowledgeSourceFile(string, string, UpdateKnowledgeSourceFileRequest, UpdateKnowledgeSourceFileOptions)

Nahrazuje existující soubor a jeho metadata ve zdroji znalostí souboru.

Příklad

Nahrajte a aktualizujte zdrojový soubor znalostí.

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

const client = new SearchIndexClient("<endpoint>", new AzureKeyCredential("<apiKey>"));
const body = {
  metadata: { fileName: "manuals/example.txt", metadata: { category: "manual" } },
  content: {
    contents: new TextEncoder().encode("Azure AI Search retrieves relevant information."),
    contentType: "text/plain",
    filename: "example.txt",
  },
};

const uploaded = await client.uploadKnowledgeSourceFileMultipart("<knowledgeSourceName>", body);
if (!uploaded.fileId) {
  throw new Error("The service did not return an uploaded file ID.");
}

await client.updateKnowledgeSourceFile("<knowledgeSourceName>", uploaded.fileId, {
  ...body,
  metadata: { ...body.metadata, metadata: { category: "updated-manual" } },
});
for await (const file of client.listKnowledgeSourceFiles("<knowledgeSourceName>", {
  prefix: "manuals/",
  pageSize: 10,
})) {
  console.log(file.fileName, file.parsingMode, file.extractionMode);
}
uploadKnowledgeSourceFile(string, Uint8Array, string, UploadKnowledgeSourceFileOptions)

Nahraje soubor do zdroje znalostí souboru pro zpracování a indexování.

uploadKnowledgeSourceFileMultipart(string, UploadKnowledgeSourceFileMultipartRequest, UploadKnowledgeSourceFileMultipartOptions)

Nahraje soubor a jeho metadata do zdroje znalostí souboru pomocí vícedílných formulářových dat.

Příklad

Nahrajte soubor se strukturovanými metadaty.

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

const client = new SearchIndexClient("<endpoint>", new AzureKeyCredential("<apiKey>"));
const body = {
  metadata: { fileName: "manuals/example.txt", metadata: { category: "manual" } },
  content: {
    contents: new TextEncoder().encode("Azure AI Search retrieves relevant information."),
    contentType: "text/plain",
    filename: "example.txt",
  },
};

const uploaded = await client.uploadKnowledgeSourceFileMultipart("<knowledgeSourceName>", body);
if (!uploaded.fileId) {
  throw new Error("The service did not return an uploaded file ID.");
}

await client.updateKnowledgeSourceFile("<knowledgeSourceName>", uploaded.fileId, {
  ...body,
  metadata: { ...body.metadata, metadata: { category: "updated-manual" } },
});
for await (const file of client.listKnowledgeSourceFiles("<knowledgeSourceName>", {
  prefix: "manuals/",
  pageSize: 10,
})) {
  console.log(file.fileName, file.parsingMode, file.extractionMode);
}

Podrobnosti konstruktoru

SearchIndexClient(string, KeyCredential | TokenCredential, SearchIndexClientOptions)

Vytvoří instanci SearchIndexClient.

Příklad použití:

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

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

Parametry

endpoint

string

Koncový bod vyhledávací služby

credential

KeyCredential | TokenCredential

Používá se k ověřování požadavků na službu.

options
SearchIndexClientOptions

Slouží ke konfiguraci klienta indexu vyhledávání.

Podrobnosti vlastnosti

apiVersion

Upozornění

Toto rozhraní API je teď zastaralé.

use {@Link serviceVersion} instead

Verze rozhraní API, která se má použít při komunikaci se službou.

apiVersion: string

Hodnota vlastnosti

string

endpoint

Koncový bod vyhledávací služby

endpoint: string

Hodnota vlastnosti

string

pipeline

Odkaz na interní kanál HTTP pro použití s nezpracovanými požadavky

pipeline: Pipeline

Hodnota vlastnosti

serviceVersion

Verze rozhraní API, která se má použít při komunikaci se službou.

serviceVersion: string

Hodnota vlastnosti

string

Podrobnosti metody

analyzeText(string, AnalyzeTextOptions)

Volání analyzátoru nebo tokenizátoru ručně pro zadaný text.

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

Parametry

indexName

string

Název indexu, který obsahuje pole k analýze

options
AnalyzeTextOptions

Další argumenty

Návraty

Promise<AnalyzeResult>

beginIngestKnowledgeSourceFile(string, UploadKnowledgeSourceFileMultipartRequest, IngestKnowledgeSourceFileOptions)

Zahajuje asynchronní ingestování nového souboru a vrací jeho operaci dotazování.

function beginIngestKnowledgeSourceFile(name: string, body: UploadKnowledgeSourceFileMultipartRequest, options?: IngestKnowledgeSourceFileOptions): KnowledgeSourceFileIngestionPoller

Parametry

name

string

Název zdroje znalostí souboru.

body
UploadKnowledgeSourceFileMultipartRequest

Obsah souboru a metadata.

options
IngestKnowledgeSourceFileOptions

Možnosti dotazování a žádostí.

Návraty

beginReplaceKnowledgeSourceFile(string, string, UpdateKnowledgeSourceFileRequest, IngestKnowledgeSourceFileOptions)

Zahajuje asynchronní nahrazování souboru a vrací jeho operaci dotazování.

function beginReplaceKnowledgeSourceFile(name: string, fileId: string, body: UpdateKnowledgeSourceFileRequest, options?: IngestKnowledgeSourceFileOptions): KnowledgeSourceFileIngestionPoller

Parametry

name

string

Název zdroje znalostí souboru.

fileId

string

Soubor k nahrazení.

body
UpdateKnowledgeSourceFileRequest

Obsah a metadata náhradního souboru.

options
IngestKnowledgeSourceFileOptions

Možnosti dotazování a žádostí.

Návraty

createAlias(SearchAlias, OperationOptions)

Vytvoří nový alias hledání.

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

Parametry

alias
SearchAlias

Definice aliasu, který chcete vytvořit.

options
OperationOptions

Parametry možností.

Návraty

Promise<SearchAlias>

createIndex(SearchIndexInput | SearchIndex, OperationOptions)

Vytvoří nový index.

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

Parametry

index

SearchIndexInput | SearchIndex

Informace popisující index, který se má vytvořit.

options
OperationOptions

Další volitelné argumenty.

Návraty

Promise<SearchIndex>

createKnowledgeBase(KnowledgeBase | KnowledgeBaseInput, CreateKnowledgeBaseOptions)

Vytváří novou znalostní základnu.

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

Parametry

knowledgeBase

KnowledgeBase | KnowledgeBaseInput

Definice znalostní báze, kterou je třeba vytvářet.

options
CreateKnowledgeBaseOptions

parametry možností.

Návraty

Promise<KnowledgeBase>

createKnowledgeSource(AzureBlobKnowledgeSourceInput | AzureBlobKnowledgeSource | BaseKnowledgeSource | IndexedOneLakeKnowledgeSourceInput | IndexedOneLakeKnowledgeSource | IndexedSharePointKnowledgeSourceInput | IndexedSharePointKnowledgeSource | IndexedSqlKnowledgeSourceInput | IndexedSqlKnowledgeSource | FileKnowledgeSourceInput | FileKnowledgeSource | RemoteSharePointKnowledgeSourceInput | FabricDataAgentKnowledgeSourceInput | FabricOntologyKnowledgeSourceInput | WorkIQKnowledgeSourceInput | McpServerKnowledgeSourceInput | SearchIndexKnowledgeSource | WebKnowledgeSource, CreateKnowledgeSourceOptions)

Vytvoří nový zdroj znalostí.

function createKnowledgeSource(knowledgeSource: AzureBlobKnowledgeSourceInput | AzureBlobKnowledgeSource | BaseKnowledgeSource | IndexedOneLakeKnowledgeSourceInput | IndexedOneLakeKnowledgeSource | IndexedSharePointKnowledgeSourceInput | IndexedSharePointKnowledgeSource | IndexedSqlKnowledgeSourceInput | IndexedSqlKnowledgeSource | FileKnowledgeSourceInput | FileKnowledgeSource | RemoteSharePointKnowledgeSourceInput | FabricDataAgentKnowledgeSourceInput | FabricOntologyKnowledgeSourceInput | WorkIQKnowledgeSourceInput | McpServerKnowledgeSourceInput | SearchIndexKnowledgeSource | WebKnowledgeSource, options?: CreateKnowledgeSourceOptions): Promise<KnowledgeSource>

Parametry

options
CreateKnowledgeSourceOptions

Parametry možností.

Návraty

Promise<KnowledgeSource>

createOrUpdateAlias(SearchAlias, CreateOrUpdateAliasOptions)

Vytvoří nový alias vyhledávání nebo aktualizuje alias, pokud už existuje.

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

Parametry

alias
SearchAlias

Definice aliasu pro vytvoření nebo aktualizaci

options
CreateOrUpdateAliasOptions

Parametry možností.

Návraty

Promise<SearchAlias>

createOrUpdateIndex(SearchIndexInput | SearchIndex, CreateOrUpdateIndexOptions)

Vytvoří nový index nebo upraví existující index.

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

Parametry

index

SearchIndexInput | SearchIndex

Informace popisující index, který se má vytvořit.

options
CreateOrUpdateIndexOptions

Další volitelné argumenty.

Návraty

Promise<SearchIndex>

createOrUpdateKnowledgeBase(KnowledgeBase | KnowledgeBaseInput, CreateOrUpdateKnowledgeBaseOptions)

Vytváří novou znalostní bázi nebo aktualizuje znalostní bázi, pokud už existuje.

function createOrUpdateKnowledgeBase(knowledgeBase: KnowledgeBase | KnowledgeBaseInput, options?: CreateOrUpdateKnowledgeBaseOptions): Promise<KnowledgeBase>

Parametry

knowledgeBase

KnowledgeBase | KnowledgeBaseInput

Definice znalostní báze, kterou je třeba vytvořit nebo aktualizovat.

options
CreateOrUpdateKnowledgeBaseOptions

parametry možností.

Návraty

Promise<KnowledgeBase>

Vytvořená nebo aktualizovaná znalostní báze.

createOrUpdateKnowledgeBase(string, KnowledgeBase | KnowledgeBaseInput, CreateOrUpdateKnowledgeBaseOptions)

Upozornění

Toto rozhraní API je teď zastaralé.

Pass the knowledge base model first; its name property identifies the resource.

Vytváří nebo aktualizuje znalostní bázi s explicitním názvem.

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

Parametry

knowledgeBaseName

string

Návraty

Promise<KnowledgeBase>

createOrUpdateKnowledgeSource(AzureBlobKnowledgeSourceInput | AzureBlobKnowledgeSource | BaseKnowledgeSource | IndexedOneLakeKnowledgeSourceInput | IndexedOneLakeKnowledgeSource | IndexedSharePointKnowledgeSourceInput | IndexedSharePointKnowledgeSource | IndexedSqlKnowledgeSourceInput | IndexedSqlKnowledgeSource | FileKnowledgeSourceInput | FileKnowledgeSource | RemoteSharePointKnowledgeSourceInput | FabricDataAgentKnowledgeSourceInput | FabricOntologyKnowledgeSourceInput | WorkIQKnowledgeSourceInput | McpServerKnowledgeSourceInput | SearchIndexKnowledgeSource | WebKnowledgeSource, CreateOrUpdateKnowledgeSourceOptions)

function createOrUpdateKnowledgeSource(knowledgeSource: AzureBlobKnowledgeSourceInput | AzureBlobKnowledgeSource | BaseKnowledgeSource | IndexedOneLakeKnowledgeSourceInput | IndexedOneLakeKnowledgeSource | IndexedSharePointKnowledgeSourceInput | IndexedSharePointKnowledgeSource | IndexedSqlKnowledgeSourceInput | IndexedSqlKnowledgeSource | FileKnowledgeSourceInput | FileKnowledgeSource | RemoteSharePointKnowledgeSourceInput | FabricDataAgentKnowledgeSourceInput | FabricOntologyKnowledgeSourceInput | WorkIQKnowledgeSourceInput | McpServerKnowledgeSourceInput | SearchIndexKnowledgeSource | WebKnowledgeSource, options?: CreateOrUpdateKnowledgeSourceOptions): Promise<KnowledgeSource>

Parametry

Návraty

Promise<KnowledgeSource>

createOrUpdateSynonymMap(SynonymMap, CreateOrUpdateSynonymMapOptions)

Vytvoří novou mapu synonym nebo upraví existující.

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

Parametry

synonymMap
SynonymMap

Informace popisující mapu synonym, která se má vytvořit.

options
CreateOrUpdateSynonymMapOptions

Další volitelné argumenty.

Návraty

Promise<SynonymMap>

createSynonymMap(SynonymMap, OperationOptions)

Vytvoří novou mapu synonym ve vyhledávací službě.

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

Parametry

synonymMap
SynonymMap

Definice synonymMap pro vytvoření ve vyhledávací službě.

options
OperationOptions

Další volitelné argumenty.

Návraty

Promise<SynonymMap>

deleteAlias(SearchAlias, DeleteAliasOptions)

Odstraní alias vyhledávání a jeho přidružené mapování na index. Tato operace je trvalá bez možnosti obnovení. Namapovaný index není touto operací nedotčen.

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

Parametry

alias
SearchAlias

Alias, který chcete odstranit.

options
DeleteAliasOptions

Další volitelné argumenty.

Návraty

Promise<void>

deleteAlias(string, DeleteAliasOptions)

Odstraní alias vyhledávání a jeho přidružené mapování na index. Tato operace je trvalá bez možnosti obnovení. Namapovaný index není touto operací nedotčen.

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

Parametry

aliasName

string

Název aliasu, který chcete odstranit.

options
DeleteAliasOptions

Další volitelné argumenty.

Návraty

Promise<void>

deleteIndex(SearchIndex, DeleteIndexOptions)

Odstraní existující index.

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

Parametry

index
SearchIndex

Index, který chcete odstranit.

options
DeleteIndexOptions

Další volitelné argumenty.

Návraty

Promise<void>

deleteIndex(string, DeleteIndexOptions)

Odstraní existující index.

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

Parametry

indexName

string

Název indexu, který chcete odstranit.

options
DeleteIndexOptions

Další volitelné argumenty.

Návraty

Promise<void>

deleteKnowledgeBase(KnowledgeBase, DeleteKnowledgeBaseOptions)

Odstraní existující znalostní bázi.

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

Parametry

knowledgeBase
KnowledgeBase

Znalostní bázi, kterou je třeba smazat.

options
DeleteKnowledgeBaseOptions

parametry možností.

Návraty

Promise<void>

deleteKnowledgeBase(string, DeleteKnowledgeBaseOptions)

Odstraní existující znalostní bázi.

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

Parametry

knowledgeBaseName

string

název znalostní báze k smazání.

options
DeleteKnowledgeBaseOptions

parametry možností.

Návraty

Promise<void>

deleteKnowledgeSource(KnowledgeSource, DeleteKnowledgeSourceOptions)

Odstraní existující zdroj.

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

Parametry

source
KnowledgeSource

zdroj znalostí, který chcete odstranit.

options
DeleteKnowledgeSourceOptions

parametry možností.

Návraty

Promise<void>

deleteKnowledgeSource(string, DeleteKnowledgeSourceOptions)

Odstraní existující zdroj.

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

Parametry

sourceName

string

Název zdroje znalostí, který chcete odstranit.

options
DeleteKnowledgeSourceOptions

parametry možností.

Návraty

Promise<void>

deleteKnowledgeSourceFile(string, string, DeleteKnowledgeSourceFileOptions)

Smaže soubor ze zdroje znalostí souboru a odstraní veškerý indexovaný obsah odvozený z něj.

function deleteKnowledgeSourceFile(name: string, fileId: string, options?: DeleteKnowledgeSourceFileOptions): Promise<void>

Parametry

name

string

Název zdroje znalostí.

fileId

string

Identifikátor souboru.

options
DeleteKnowledgeSourceFileOptions

Parametry možností.

Návraty

Promise<void>

deleteSynonymMap(string | SynonymMap, DeleteSynonymMapOptions)

Odstraní existující mapu synonym.

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

Parametry

synonymMap

string | SynonymMap

options
DeleteSynonymMapOptions

Další volitelné argumenty.

Návraty

Promise<void>

getAlias(string, OperationOptions)

Načte definici aliasu.

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

Parametry

aliasName

string

Název aliasu, který se má načíst.

options
OperationOptions

Parametry možností.

Návraty

Promise<SearchAlias>

getIndex(string, OperationOptions)

Načte informace o indexu.

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

Parametry

indexName

string

Název indexu.

options
OperationOptions

Další volitelné argumenty.

Návraty

Promise<SearchIndex>

getIndexStatistics(string, OperationOptions)

Načte statistiky o indexu, například počet dokumentů a velikost úložiště indexů.

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

Parametry

indexName

string

Název indexu.

options
OperationOptions

Další volitelné argumenty.

Návraty

getKnowledgeBase(string, GetKnowledgeBaseOptions)

Získává definici znalostní báze.

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

Parametry

knowledgeBaseName

string

název znalostní báze k získání.

options
GetKnowledgeBaseOptions

parametry možností.

Návraty

Promise<KnowledgeBase>

getKnowledgeRetrievalClient(string, KnowledgeRetrievalClientOptions)

Načte KnowledgeRetrievalClient odpovídající tomuto SearchIndexClient

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

Parametry

knowledgeBaseName

string

Název znalostní báze

options
KnowledgeRetrievalClientOptions

KnowledgeRetrievalClient Možnosti

Návraty

getKnowledgeSource(string, GetKnowledgeSourceOptions)

Načte definici zdroje znalostí.

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

Parametry

sourceName

string

Název zdroje znalostí, který chcete načíst.

options
GetKnowledgeSourceOptions

Parametry možností.

Návraty

Promise<KnowledgeSource>

getKnowledgeSourceFileIngestionOperation(string, string, OperationOptions)

Získá stav a výsledek operace ingestování souboru.

function getKnowledgeSourceFileIngestionOperation(name: string, operationId: string, options?: OperationOptions): Promise<KnowledgeSourceFileIngestionOperation>

Parametry

name

string

Název zdroje znalostí souboru.

operationId

string

Identifikátor operace.

options
OperationOptions

Požádejte o možnosti.

Návraty

getKnowledgeSourceStatus(string, GetKnowledgeSourceStatusOptions)

Vrací aktuální stav a historii synchronizace zdroje znalostí.

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

Parametry

sourceName

string

Název zdroje znalostí, pro který chcete načíst stav.

options
GetKnowledgeSourceStatusOptions

Parametry možností.

Návraty

getSearchClient<TModel>(string, SearchClientOptions)

Načte SearchClient odpovídající tomuto SearchIndexClient.

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

Parametry

indexName

string

Název indexu

options
SearchClientOptions

Možnosti SearchClient

Návraty

SearchClient<TModel>

getServiceStatistics(OperationOptions)

Načte statistiky o službě, například počet dokumentů, index atd.

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

Parametry

options
OperationOptions

Další volitelné argumenty.

Návraty

getSynonymMap(string, OperationOptions)

Načte informace o objektu SynonymMap.

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

Parametry

synonymMapName

string

Název SynonymMap.

options
OperationOptions

Další volitelné argumenty.

Návraty

Promise<SynonymMap>

listAliases(ListAliasesOptions)

Zobrazí seznam všech aliasů dostupných pro vyhledávací službu.

function listAliases(options?: ListAliasesOptions): AliasIterator

Parametry

options
ListAliasesOptions

Parametry možností.

Návraty

listIndexes(ResourceListingOptions)

Načte seznam existujících indexů ve službě.

function listIndexes(options?: ResourceListingOptions): IndexIterator

Parametry

options
ResourceListingOptions

Možnosti operace indexu seznamu

Návraty

listIndexesNames(ResourceListingOptions)

Načte seznam názvů existujících indexů ve službě.

function listIndexesNames(options?: ResourceListingOptions): IndexNameIterator

Parametry

options
ResourceListingOptions

Možnosti operace indexu seznamu

Návraty

listIndexStatsSummary(ListIndexStatsSummaryOptions)

Načte souhrn statistik pro všechny indexy ve vyhledávací službě.

function listIndexStatsSummary(options?: ListIndexStatsSummaryOptions): PagedAsyncIterableIterator<IndexStatisticsSummary, IndexStatisticsSummary[], PageSettings>

Parametry

options
ListIndexStatsSummaryOptions

Možnosti pro souhrn statistik indexu seznamu.

Návraty

listKnowledgeBases(ListKnowledgeBasesOptions)

Získá seznam existujících KnowledgeBases ve službě.

function listKnowledgeBases(options?: ListKnowledgeBasesOptions): KnowledgeBaseIterator

Parametry

options
ListKnowledgeBasesOptions

Možnosti pro operaci znalostních báz seznamu.

Návraty

listKnowledgeSourceFileIngestionOperations(string, OperationOptions)

Uvádí zachované ingestní operace pro zdroj znalostí souboru.

function listKnowledgeSourceFileIngestionOperations(name: string, options?: OperationOptions): PagedAsyncIterableIterator<KnowledgeSourceFileIngestionOperation, KnowledgeSourceFileIngestionOperation[], PageSettings>

Parametry

name

string

Název zdroje znalostí souboru.

options
OperationOptions

Požádejte o možnosti.

Návraty

listKnowledgeSourceFiles(string, ListKnowledgeSourceFilesOptions)

Uvádí všechny soubory ve zdroji znalostí souboru.

function listKnowledgeSourceFiles(name: string, options?: ListKnowledgeSourceFilesOptions): PagedAsyncIterableIterator<KnowledgeSourceFile, KnowledgeSourceFile[], PageSettings>

Parametry

name

string

Název zdroje znalostí.

options
ListKnowledgeSourceFilesOptions

Parametry možností.

Návraty

listKnowledgeSources(ListKnowledgeSourcesOptions)

Načte seznam existujících zdrojů znalostí ve službě.

function listKnowledgeSources(options?: ListKnowledgeSourcesOptions): KnowledgeSourceIterator

Parametry

options
ListKnowledgeSourcesOptions

Možnosti operace se seznamem zdrojů znalostí.

Návraty

listSynonymMaps(ResourceListingOptions)

Načte seznam existujících synonymMap ve službě.

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

Parametry

options
ResourceListingOptions

Možnosti operace SynonymMaps seznamu

Návraty

Promise<SynonymMap[]>

listSynonymMapsNames(ResourceListingOptions)

Načte seznam názvů existujících objektů SynonymMap ve službě.

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

Parametry

options
ResourceListingOptions

Možnosti operace SynonymMaps seznamu

Návraty

Promise<string[]>

updateKnowledgeSourceFile(string, string, UpdateKnowledgeSourceFileRequest, UpdateKnowledgeSourceFileOptions)

Nahrazuje existující soubor a jeho metadata ve zdroji znalostí souboru.

Příklad

Nahrajte a aktualizujte zdrojový soubor znalostí.

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

const client = new SearchIndexClient("<endpoint>", new AzureKeyCredential("<apiKey>"));
const body = {
  metadata: { fileName: "manuals/example.txt", metadata: { category: "manual" } },
  content: {
    contents: new TextEncoder().encode("Azure AI Search retrieves relevant information."),
    contentType: "text/plain",
    filename: "example.txt",
  },
};

const uploaded = await client.uploadKnowledgeSourceFileMultipart("<knowledgeSourceName>", body);
if (!uploaded.fileId) {
  throw new Error("The service did not return an uploaded file ID.");
}

await client.updateKnowledgeSourceFile("<knowledgeSourceName>", uploaded.fileId, {
  ...body,
  metadata: { ...body.metadata, metadata: { category: "updated-manual" } },
});
for await (const file of client.listKnowledgeSourceFiles("<knowledgeSourceName>", {
  prefix: "manuals/",
  pageSize: 10,
})) {
  console.log(file.fileName, file.parsingMode, file.extractionMode);
}
function updateKnowledgeSourceFile(name: string, fileId: string, body: UpdateKnowledgeSourceFileRequest, options?: UpdateKnowledgeSourceFileOptions): Promise<KnowledgeSourceFile>

Parametry

name

string

Název zdroje znalostí.

fileId

string

Identifikátor souboru.

body
UpdateKnowledgeSourceFileRequest

Obsah a metadata nahrazovacího souboru.

options
UpdateKnowledgeSourceFileOptions

Parametry možností.

Návraty

Aktualizována metadata souboru.

uploadKnowledgeSourceFile(string, Uint8Array, string, UploadKnowledgeSourceFileOptions)

Nahraje soubor do zdroje znalostí souboru pro zpracování a indexování.

function uploadKnowledgeSourceFile(name: string, file: Uint8Array, contentDisposition: string, options?: UploadKnowledgeSourceFileOptions): Promise<KnowledgeSourceFile>

Parametry

name

string

Název zdroje znalostí.

file

Uint8Array

Obsah souboru.

contentDisposition

string

Hodnota hlavičky content-disposition (např. 'attachment; filename="example.pdf"').

options
UploadKnowledgeSourceFileOptions

Parametry možností.

Návraty

Metadata pro nahraný soubor.

uploadKnowledgeSourceFileMultipart(string, UploadKnowledgeSourceFileMultipartRequest, UploadKnowledgeSourceFileMultipartOptions)

Nahraje soubor a jeho metadata do zdroje znalostí souboru pomocí vícedílných formulářových dat.

Příklad

Nahrajte soubor se strukturovanými metadaty.

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

const client = new SearchIndexClient("<endpoint>", new AzureKeyCredential("<apiKey>"));
const body = {
  metadata: { fileName: "manuals/example.txt", metadata: { category: "manual" } },
  content: {
    contents: new TextEncoder().encode("Azure AI Search retrieves relevant information."),
    contentType: "text/plain",
    filename: "example.txt",
  },
};

const uploaded = await client.uploadKnowledgeSourceFileMultipart("<knowledgeSourceName>", body);
if (!uploaded.fileId) {
  throw new Error("The service did not return an uploaded file ID.");
}

await client.updateKnowledgeSourceFile("<knowledgeSourceName>", uploaded.fileId, {
  ...body,
  metadata: { ...body.metadata, metadata: { category: "updated-manual" } },
});
for await (const file of client.listKnowledgeSourceFiles("<knowledgeSourceName>", {
  prefix: "manuals/",
  pageSize: 10,
})) {
  console.log(file.fileName, file.parsingMode, file.extractionMode);
}
function uploadKnowledgeSourceFileMultipart(name: string, body: UploadKnowledgeSourceFileMultipartRequest, options?: UploadKnowledgeSourceFileMultipartOptions): Promise<KnowledgeSourceFile>

Parametry

name

string

Název zdroje znalostí.

body
UploadKnowledgeSourceFileMultipartRequest

Obsah souboru a metadata.

options
UploadKnowledgeSourceFileMultipartOptions

Parametry možností.

Návraty

Metadata pro nahraný soubor.