SearchIndexClient class

فئة لتنفيذ عمليات لإدارة (إنشاء، تحديث، قائمة/حذف) الفهارس، & المرادفات.

المنشئون

SearchIndexClient(string, KeyCredential | TokenCredential, SearchIndexClientOptions)

إنشاء مثيل SearchIndexClient.

مثال على الاستخدام:

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

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

الخصائص

apiVersion

إصدار واجهة برمجة التطبيقات لاستخدامه عند الاتصال بالخدمة.

endpoint

نقطة نهاية خدمة البحث

pipeline

مرجع إلى مسار HTTP الداخلي للاستخدام مع الطلبات الأولية

serviceVersion

إصدار واجهة برمجة التطبيقات لاستخدامه عند الاتصال بالخدمة.

الأساليب

analyzeText(string, AnalyzeTextOptions)

استدعاء محلل أو رمز مميز يدويا على النص المقدم.

beginIngestKnowledgeSourceFile(string, UploadKnowledgeSourceFileMultipartRequest, IngestKnowledgeSourceFileOptions)

يبدأ الاستيراد غير المتزامن لملف جديد ويعيد عملية الاستطلاع الخاصة به.

beginReplaceKnowledgeSourceFile(string, string, UpdateKnowledgeSourceFileRequest, IngestKnowledgeSourceFileOptions)

يبدأ الاستبدال غير المتزامن لملف ويعيد عملية الاستطلاع الخاصة به.

createAlias(SearchAlias, OperationOptions)

إنشاء اسم بحث بديل جديد.

createIndex(SearchIndexInput | SearchIndex, OperationOptions)

إنشاء فهرس جديد.

createKnowledgeBase(KnowledgeBase | KnowledgeBaseInput, CreateKnowledgeBaseOptions)

يخلق قاعدة معرفية جديدة.

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

إنشاء مصدر معرفة جديد.

createOrUpdateAlias(SearchAlias, CreateOrUpdateAliasOptions)

إنشاء اسم مستعار جديد للبحث أو تحديث اسم مستعار إذا كان موجودا بالفعل.

createOrUpdateIndex(SearchIndexInput | SearchIndex, CreateOrUpdateIndexOptions)

إنشاء فهرس جديد أو تعديل فهرس موجود.

createOrUpdateKnowledgeBase(KnowledgeBase | KnowledgeBaseInput, CreateOrUpdateKnowledgeBaseOptions)

ينشئ قاعدة معرفة جديدة أو يحدث قاعدة معرفة إذا كانت موجودة بالفعل.

createOrUpdateKnowledgeBase(string, KnowledgeBase | KnowledgeBaseInput, CreateOrUpdateKnowledgeBaseOptions)

ينشئ أو يحدث قاعدة معرفة باستخدام اسم صريح.

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

إنشاء خريطة مرادف جديدة أو تعديل مرادف موجود.

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)

حذف مصدر موجود.

deleteKnowledgeSourceFile(string, string, DeleteKnowledgeSourceFileOptions)

يحذف ملفا من مصدر معرفة الملف ويزيل كل المحتوى المفهرس المستخرج منه.

deleteSynonymMap(string | SynonymMap, DeleteSynonymMapOptions)

حذف خريطة مرادف موجودة.

getAlias(string, OperationOptions)

يسترجع تعريف الاسم المستعار.

getIndex(string, OperationOptions)

استرداد معلومات حول فهرس.

getIndexStatistics(string, OperationOptions)

استرداد إحصائيات حول فهرس، مثل عدد المستندات وحجم تخزين الفهرس.

getKnowledgeBase(string, GetKnowledgeBaseOptions)

يسترجع تعريف قاعدة المعرفة.

getKnowledgeRetrievalClient(string, KnowledgeRetrievalClientOptions)

استرداد KnowledgeRetrievalClient المقابل ل SearchIndexClient هذا

getKnowledgeSource(string, GetKnowledgeSourceOptions)

استرداد تعريف مصدر المعرفة.

getKnowledgeSourceFileIngestionOperation(string, string, OperationOptions)

يسترجع حالة ونتيجة عملية استيراد الملف.

getKnowledgeSourceStatus(string, GetKnowledgeSourceStatusOptions)

يعيد الحالة الحالية وتاريخ التزامن لمصدر معرفة.

getSearchClient<TModel>(string, SearchClientOptions)

استرداد SearchClient المطابق لهذا SearchIndexClient

getServiceStatistics(OperationOptions)

استرداد إحصائيات حول الخدمة، مثل عدد المستندات والفهرس وما إلى ذلك.

getSynonymMap(string, OperationOptions)

استرداد معلومات حول SynonymMap.

listAliases(ListAliasesOptions)

يسرد جميع الأسماء المستعارة المتاحة لخدمة البحث.

listIndexes(ResourceListingOptions)

استرداد قائمة الفهارس الموجودة في الخدمة.

listIndexesNames(ResourceListingOptions)

استرداد قائمة بأسماء الفهارس الموجودة في الخدمة.

listIndexStatsSummary(ListIndexStatsSummaryOptions)

يسترجع ملخصا للإحصائيات لجميع الفهارس في خدمة البحث.

listKnowledgeBases(ListKnowledgeBasesOptions)

يسترجع قائمة بقواعد المعرفة الموجودة في الخدمة.

listKnowledgeSourceFileIngestionOperations(string, OperationOptions)

يعرض عمليات الاستيراد المحتفظ بها لمصدر معرفة الملف.

listKnowledgeSourceFiles(string, ListKnowledgeSourceFilesOptions)

يسرد جميع الملفات في مصدر معرفة الملف.

listKnowledgeSources(ListKnowledgeSourcesOptions)

استرداد قائمة بمصادر المعرفة الموجودة في الخدمة.

listSynonymMaps(ResourceListingOptions)

استرداد قائمة ب SynonymMaps الموجودة في الخدمة.

listSynonymMapsNames(ResourceListingOptions)

استرداد قائمة بأسماء SynonymMaps الموجودة في الخدمة.

updateKnowledgeSourceFile(string, string, UpdateKnowledgeSourceFileRequest, UpdateKnowledgeSourceFileOptions)

يستبدل الملف الموجود وبياناته الوصفية في مصدر معرفة الملف.

مثال

رفع وتحديث ملف مصدر معرفة الملف.

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)

يرفع ملفا إلى مصدر معرفة ملف للمعالجة والفهرسة.

uploadKnowledgeSourceFileMultipart(string, UploadKnowledgeSourceFileMultipartRequest, UploadKnowledgeSourceFileMultipartOptions)

يرفع ملفا وبياناته الوصفية إلى مصدر معرفة الملف باستخدام بيانات نماذج متعددة الأجزاء.

مثال

ارفع ملفا يحتوي على بيانات وصفية منظمة.

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);
}

تفاصيل المنشئ

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

تحذير

واجهة برمجة التطبيقات هذه مهملة الآن.

use {@Link serviceVersion} instead

إصدار واجهة برمجة التطبيقات لاستخدامه عند الاتصال بالخدمة.

apiVersion: string

قيمة الخاصية

string

endpoint

نقطة نهاية خدمة البحث

endpoint: string

قيمة الخاصية

string

pipeline

مرجع إلى مسار HTTP الداخلي للاستخدام مع الطلبات الأولية

pipeline: Pipeline

قيمة الخاصية

serviceVersion

إصدار واجهة برمجة التطبيقات لاستخدامه عند الاتصال بالخدمة.

serviceVersion: string

قيمة الخاصية

string

تفاصيل الأسلوب

analyzeText(string, AnalyzeTextOptions)

استدعاء محلل أو رمز مميز يدويا على النص المقدم.

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

المعلمات

indexName

string

اسم الفهرس الذي يحتوي على الحقل المراد تحليله

options
AnalyzeTextOptions

وسيطات إضافية

المرتجعات

Promise<AnalyzeResult>

beginIngestKnowledgeSourceFile(string, UploadKnowledgeSourceFileMultipartRequest, IngestKnowledgeSourceFileOptions)

يبدأ الاستيراد غير المتزامن لملف جديد ويعيد عملية الاستطلاع الخاصة به.

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

المعلمات

name

string

اسم مصدر معرفة الملف.

body
UploadKnowledgeSourceFileMultipartRequest

محتويات الملف والبيانات الوصفية.

options
IngestKnowledgeSourceFileOptions

خيارات الاستطلاع والطلب.

المرتجعات

beginReplaceKnowledgeSourceFile(string, string, UpdateKnowledgeSourceFileRequest, IngestKnowledgeSourceFileOptions)

يبدأ الاستبدال غير المتزامن لملف ويعيد عملية الاستطلاع الخاصة به.

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

المعلمات

name

string

اسم مصدر معرفة الملف.

fileId

string

الملف الذي سيتم استبداله.

body
UpdateKnowledgeSourceFileRequest

محتويات الملف البديل والبيانات الوصفية.

options
IngestKnowledgeSourceFileOptions

خيارات الاستطلاع والطلب.

المرتجعات

createAlias(SearchAlias, OperationOptions)

إنشاء اسم بحث بديل جديد.

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

المعلمات

alias
SearchAlias

تعريف الاسم المستعار المراد إنشاؤه.

options
OperationOptions

معلمات الخيارات.

المرتجعات

Promise<SearchAlias>

createIndex(SearchIndexInput | SearchIndex, OperationOptions)

إنشاء فهرس جديد.

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

المعلمات

index

SearchIndexInput | SearchIndex

المعلومات التي تصف الفهرس الذي سيتم إنشاؤه.

options
OperationOptions

وسيطات اختيارية إضافية.

المرتجعات

Promise<SearchIndex>

createKnowledgeBase(KnowledgeBase | KnowledgeBaseInput, CreateKnowledgeBaseOptions)

يخلق قاعدة معرفية جديدة.

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

المعلمات

knowledgeBase

KnowledgeBase | KnowledgeBaseInput

تعريف قاعدة المعرفة التي يجب إنشاؤها.

options
CreateKnowledgeBaseOptions

معلمات الخيارات.

المرتجعات

Promise<KnowledgeBase>

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

إنشاء مصدر معرفة جديد.

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>

المعلمات

options
CreateKnowledgeSourceOptions

معلمات الخيارات.

المرتجعات

Promise<KnowledgeSource>

createOrUpdateAlias(SearchAlias, CreateOrUpdateAliasOptions)

إنشاء اسم مستعار جديد للبحث أو تحديث اسم مستعار إذا كان موجودا بالفعل.

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

المعلمات

alias
SearchAlias

تعريف الاسم المستعار المراد إنشاؤه أو تحديثه.

options
CreateOrUpdateAliasOptions

معلمات الخيارات.

المرتجعات

Promise<SearchAlias>

createOrUpdateIndex(SearchIndexInput | SearchIndex, CreateOrUpdateIndexOptions)

إنشاء فهرس جديد أو تعديل فهرس موجود.

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

المعلمات

index

SearchIndexInput | SearchIndex

المعلومات التي تصف الفهرس الذي سيتم إنشاؤه.

options
CreateOrUpdateIndexOptions

وسيطات اختيارية إضافية.

المرتجعات

Promise<SearchIndex>

createOrUpdateKnowledgeBase(KnowledgeBase | KnowledgeBaseInput, CreateOrUpdateKnowledgeBaseOptions)

ينشئ قاعدة معرفة جديدة أو يحدث قاعدة معرفة إذا كانت موجودة بالفعل.

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

المعلمات

knowledgeBase

KnowledgeBase | KnowledgeBaseInput

تعريف قاعدة المعرفة التي يجب إنشاؤها أو تحديثها.

options
CreateOrUpdateKnowledgeBaseOptions

معلمات الخيارات.

المرتجعات

Promise<KnowledgeBase>

قاعدة المعرفة التي تم إنشاؤها أو تحديثها.

createOrUpdateKnowledgeBase(string, KnowledgeBase | KnowledgeBaseInput, CreateOrUpdateKnowledgeBaseOptions)

تحذير

واجهة برمجة التطبيقات هذه مهملة الآن.

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

ينشئ أو يحدث قاعدة معرفة باستخدام اسم صريح.

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

المعلمات

knowledgeBaseName

string

المرتجعات

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>

المعلمات

المرتجعات

Promise<KnowledgeSource>

createOrUpdateSynonymMap(SynonymMap, CreateOrUpdateSynonymMapOptions)

إنشاء خريطة مرادف جديدة أو تعديل مرادف موجود.

function createOrUpdateSynonymMap(synonymMap: SynonymMap, options?: CreateOrUpdateSynonymMapOptions): Promise<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

معلمات الخيارات.

المرتجعات

Promise<void>

deleteKnowledgeBase(string, DeleteKnowledgeBaseOptions)

يحذف قاعدة معرفة موجودة.

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

المعلمات

knowledgeBaseName

string

اسم قاعدة المعرفة التي يجب حذفها.

options
DeleteKnowledgeBaseOptions

معلمات الخيارات.

المرتجعات

Promise<void>

deleteKnowledgeSource(KnowledgeSource, DeleteKnowledgeSourceOptions)

حذف مصدر موجود.

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

المعلمات

source
KnowledgeSource

مصدر المعرفة المراد حذفه.

options
DeleteKnowledgeSourceOptions

معلمات الخيارات.

المرتجعات

Promise<void>

deleteKnowledgeSource(string, DeleteKnowledgeSourceOptions)

حذف مصدر موجود.

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

المعلمات

sourceName

string

اسم مصدر المعرفة المراد حذفه.

options
DeleteKnowledgeSourceOptions

معلمات الخيارات.

المرتجعات

Promise<void>

deleteKnowledgeSourceFile(string, string, DeleteKnowledgeSourceFileOptions)

يحذف ملفا من مصدر معرفة الملف ويزيل كل المحتوى المفهرس المستخرج منه.

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

المعلمات

name

string

اسم مصدر المعرفة.

fileId

string

معرف الملف.

options
DeleteKnowledgeSourceFileOptions

معلمات الخيارات.

المرتجعات

Promise<void>

deleteSynonymMap(string | SynonymMap, DeleteSynonymMapOptions)

حذف خريطة مرادف موجودة.

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

وسيطات اختيارية إضافية.

المرتجعات

getKnowledgeBase(string, GetKnowledgeBaseOptions)

يسترجع تعريف قاعدة المعرفة.

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

المعلمات

knowledgeBaseName

string

اسم قاعدة المعرفة التي يجب استرجاعها.

options
GetKnowledgeBaseOptions

معلمات الخيارات.

المرتجعات

Promise<KnowledgeBase>

getKnowledgeRetrievalClient(string, KnowledgeRetrievalClientOptions)

استرداد KnowledgeRetrievalClient المقابل ل SearchIndexClient هذا

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

المعلمات

knowledgeBaseName

string

اسم قاعدة المعرفة

options
KnowledgeRetrievalClientOptions

KnowledgeRetrievalخيارات العميل

المرتجعات

getKnowledgeSource(string, GetKnowledgeSourceOptions)

استرداد تعريف مصدر المعرفة.

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

المعلمات

sourceName

string

اسم مصدر المعرفة المراد استرداده.

options
GetKnowledgeSourceOptions

معلمات الخيارات.

المرتجعات

Promise<KnowledgeSource>

getKnowledgeSourceFileIngestionOperation(string, string, OperationOptions)

يسترجع حالة ونتيجة عملية استيراد الملف.

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

المعلمات

name

string

اسم مصدر معرفة الملف.

operationId

string

معرف العملية.

options
OperationOptions

خيارات الطلب.

المرتجعات

getKnowledgeSourceStatus(string, GetKnowledgeSourceStatusOptions)

يعيد الحالة الحالية وتاريخ التزامن لمصدر معرفة.

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

المعلمات

sourceName

string

اسم مصدر المعرفة الذي يجب استرجاع الحالة من أجله.

options
GetKnowledgeSourceStatusOptions

معلمات الخيارات.

المرتجعات

getSearchClient<TModel>(string, SearchClientOptions)

استرداد SearchClient المطابق لهذا SearchIndexClient

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(ListAliasesOptions)

يسرد جميع الأسماء المستعارة المتاحة لخدمة البحث.

function listAliases(options?: ListAliasesOptions): AliasIterator

المعلمات

options
ListAliasesOptions

معلمات الخيارات.

المرتجعات

listIndexes(ResourceListingOptions)

استرداد قائمة الفهارس الموجودة في الخدمة.

function listIndexes(options?: ResourceListingOptions): IndexIterator

المعلمات

options
ResourceListingOptions

خيارات لعملية فهرس القائمة.

المرتجعات

listIndexesNames(ResourceListingOptions)

استرداد قائمة بأسماء الفهارس الموجودة في الخدمة.

function listIndexesNames(options?: ResourceListingOptions): IndexNameIterator

المعلمات

options
ResourceListingOptions

خيارات لعملية فهرس القائمة.

المرتجعات

listIndexStatsSummary(ListIndexStatsSummaryOptions)

يسترجع ملخصا للإحصائيات لجميع الفهارس في خدمة البحث.

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

المعلمات

options
ListIndexStatsSummaryOptions

خيارات لملخص إحصائيات القائمة في القائمة.

المرتجعات

listKnowledgeBases(ListKnowledgeBasesOptions)

يسترجع قائمة بقواعد المعرفة الموجودة في الخدمة.

function listKnowledgeBases(options?: ListKnowledgeBasesOptions): KnowledgeBaseIterator

المعلمات

options
ListKnowledgeBasesOptions

خيارات لتشغيل قواعد المعرفة القائمة.

المرتجعات

listKnowledgeSourceFileIngestionOperations(string, OperationOptions)

يعرض عمليات الاستيراد المحتفظ بها لمصدر معرفة الملف.

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

المعلمات

name

string

اسم مصدر معرفة الملف.

options
OperationOptions

خيارات الطلب.

المرتجعات

listKnowledgeSourceFiles(string, ListKnowledgeSourceFilesOptions)

يسرد جميع الملفات في مصدر معرفة الملف.

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

المعلمات

name

string

اسم مصدر المعرفة.

options
ListKnowledgeSourceFilesOptions

معلمات الخيارات.

المرتجعات

listKnowledgeSources(ListKnowledgeSourcesOptions)

استرداد قائمة بمصادر المعرفة الموجودة في الخدمة.

function listKnowledgeSources(options?: ListKnowledgeSourcesOptions): KnowledgeSourceIterator

المعلمات

options
ListKnowledgeSourcesOptions

خيارات لعملية قائمة مصادر المعرفة.

المرتجعات

listSynonymMaps(ResourceListingOptions)

استرداد قائمة ب SynonymMaps الموجودة في الخدمة.

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

المعلمات

options
ResourceListingOptions

خيارات لقائمة عملية SynonymMaps.

المرتجعات

Promise<SynonymMap[]>

listSynonymMapsNames(ResourceListingOptions)

استرداد قائمة بأسماء SynonymMaps الموجودة في الخدمة.

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

المعلمات

options
ResourceListingOptions

خيارات لقائمة عملية SynonymMaps.

المرتجعات

Promise<string[]>

updateKnowledgeSourceFile(string, string, UpdateKnowledgeSourceFileRequest, UpdateKnowledgeSourceFileOptions)

يستبدل الملف الموجود وبياناته الوصفية في مصدر معرفة الملف.

مثال

رفع وتحديث ملف مصدر معرفة الملف.

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>

المعلمات

name

string

اسم مصدر المعرفة.

fileId

string

معرف الملف.

body
UpdateKnowledgeSourceFileRequest

محتوى الملف البديل والبيانات الوصفية.

options
UpdateKnowledgeSourceFileOptions

معلمات الخيارات.

المرتجعات

تحديث البيانات الوصفية للملف.

uploadKnowledgeSourceFile(string, Uint8Array, string, UploadKnowledgeSourceFileOptions)

يرفع ملفا إلى مصدر معرفة ملف للمعالجة والفهرسة.

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

المعلمات

name

string

اسم مصدر المعرفة.

file

Uint8Array

محتويات الملف.

contentDisposition

string

قيمة رأس توزيع المحتوى (مثلا، 'attachment؛ filename="example.pdf"').

options
UploadKnowledgeSourceFileOptions

معلمات الخيارات.

المرتجعات

البيانات الوصفية للملف المرفوع.

uploadKnowledgeSourceFileMultipart(string, UploadKnowledgeSourceFileMultipartRequest, UploadKnowledgeSourceFileMultipartOptions)

يرفع ملفا وبياناته الوصفية إلى مصدر معرفة الملف باستخدام بيانات نماذج متعددة الأجزاء.

مثال

ارفع ملفا يحتوي على بيانات وصفية منظمة.

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>

المعلمات

name

string

اسم مصدر المعرفة.

body
UploadKnowledgeSourceFileMultipartRequest

محتوى الملف والبيانات الوصفية.

options
UploadKnowledgeSourceFileMultipartOptions

معلمات الخيارات.

المرتجعات

البيانات الوصفية للملف المرفوع.