@azure/search-documents 12.2.0-beta.1 → 12.2.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +430 -46
- package/dist/index.js.map +1 -1
- package/dist-esm/src/generated/data/models/index.js +26 -14
- package/dist-esm/src/generated/data/models/index.js.map +1 -1
- package/dist-esm/src/generated/data/models/mappers.js +112 -9
- package/dist-esm/src/generated/data/models/mappers.js.map +1 -1
- package/dist-esm/src/generated/data/models/parameters.js +9 -0
- package/dist-esm/src/generated/data/models/parameters.js.map +1 -1
- package/dist-esm/src/generated/data/operations/documents.js +1 -0
- package/dist-esm/src/generated/data/operations/documents.js.map +1 -1
- package/dist-esm/src/generated/data/searchClient.js +1 -1
- package/dist-esm/src/generated/data/searchClient.js.map +1 -1
- package/dist-esm/src/generated/service/models/index.js +62 -6
- package/dist-esm/src/generated/service/models/index.js.map +1 -1
- package/dist-esm/src/generated/service/models/mappers.js +124 -0
- package/dist-esm/src/generated/service/models/mappers.js.map +1 -1
- package/dist-esm/src/generated/service/searchServiceClient.js +1 -1
- package/dist-esm/src/generated/service/searchServiceClient.js.map +1 -1
- package/dist-esm/src/index.js +2 -2
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/indexDocumentsBatch.js.map +1 -1
- package/dist-esm/src/indexModels.js.map +1 -1
- package/dist-esm/src/odataMetadataPolicy.js.map +1 -1
- package/dist-esm/src/searchApiKeyCredentialPolicy.js.map +1 -1
- package/dist-esm/src/searchClient.js +43 -6
- package/dist-esm/src/searchClient.js.map +1 -1
- package/dist-esm/src/searchIndexClient.js +5 -2
- package/dist-esm/src/searchIndexClient.js.map +1 -1
- package/dist-esm/src/searchIndexerClient.js +5 -1
- package/dist-esm/src/searchIndexerClient.js.map +1 -1
- package/dist-esm/src/searchIndexingBufferedSender.js.map +1 -1
- package/dist-esm/src/serviceModels.js.map +1 -1
- package/dist-esm/src/serviceUtils.js +33 -7
- package/dist-esm/src/serviceUtils.js.map +1 -1
- package/dist-esm/src/synonymMapHelper.browser.js.map +1 -1
- package/dist-esm/src/synonymMapHelper.js.map +1 -1
- package/package.json +8 -11
- package/types/search-documents.d.ts +286 -37
|
@@ -33,7 +33,7 @@ export class SearchServiceClient extends coreHttpCompat.ExtendedServiceClient {
|
|
|
33
33
|
const defaults = {
|
|
34
34
|
requestContentType: "application/json; charset=utf-8",
|
|
35
35
|
};
|
|
36
|
-
const packageDetails = `azsdk-js-search-documents/12.2.0-beta.
|
|
36
|
+
const packageDetails = `azsdk-js-search-documents/12.2.0-beta.2`;
|
|
37
37
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
38
38
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
39
39
|
: `${packageDetails}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchServiceClient.js","sourceRoot":"","sources":["../../../../src/generated/service/searchServiceClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,cAAc,MAAM,yBAAyB,CAAC;AAM1D,OAAO,EACL,eAAe,EACf,YAAY,EACZ,aAAa,EACb,eAAe,EACf,WAAW,EACX,WAAW,GACZ,MAAM,cAAc,CAAC;AAStB,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAQ5C,gBAAgB;AAChB,MAAM,OAAO,mBAAoB,SAAQ,cAAc,CAAC,qBAAqB;IAI3E;;;;;OAKG;IACH,YACE,QAAgB,EAChB,UAAqC,EACrC,OAA2C;;QAE3C,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;QAC/C,CAAC;QACD,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;QACjD,CAAC;QAED,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,GAAG,EAAE,CAAC;QACf,CAAC;QACD,MAAM,QAAQ,GAAsC;YAClD,kBAAkB,EAAE,iCAAiC;SACtD,CAAC;QAEF,MAAM,cAAc,GAAG,yCAAyC,CAAC;QACjE,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;YAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,cAAc,EAAE;YACjE,CAAC,CAAC,GAAG,cAAc,EAAE,CAAC;QAE1B,MAAM,mBAAmB,iDACpB,QAAQ,GACR,OAAO,KACV,gBAAgB,EAAE;gBAChB,eAAe;aAChB,EACD,QAAQ,EAAE,MAAA,MAAA,OAAO,CAAC,QAAQ,mCAAI,OAAO,CAAC,OAAO,mCAAI,YAAY,GAC9D,CAAC;QACF,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAC3B,wBAAwB;QACxB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,WAAW,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;QAC7C,IAAI,CAAC,QAAQ,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;QACvC,IAAI,CAAC,SAAS,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,WAAW,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;QAC7C,IAAI,CAAC,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;QACrC,IAAI,CAAC,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;QACrC,IAAI,CAAC,yBAAyB,CAAC,UAAU,CAAC,CAAC;IAC7C,CAAC;IAED,8GAA8G;IACtG,yBAAyB,CAAC,UAAmB;QACnD,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO;QACT,CAAC;QACD,MAAM,gBAAgB,GAAG;YACvB,IAAI,EAAE,wBAAwB;YAC9B,KAAK,CAAC,WAAW,CACf,OAAwB,EACxB,IAAiB;gBAEjB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACrC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACrB,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;wBACjD,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;4BACrC,OAAO,cAAc,GAAG,UAAU,CAAC;wBACrC,CAAC;6BAAM,CAAC;4BACN,OAAO,IAAI,CAAC;wBACd,CAAC;oBACH,CAAC,CAAC,CAAC;oBACH,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACrD,CAAC;gBACD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;SACF,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC5C,CAAC;IAED;;;OAGG;IACH,oBAAoB,CAClB,OAA4C;QAE5C,OAAO,IAAI,CAAC,oBAAoB,CAC9B,EAAE,OAAO,EAAE,EACX,iCAAiC,CAClC,CAAC;IACJ,CAAC;CAQF;AACD,2BAA2B;AAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,iCAAiC,GAA6B;IAClE,IAAI,EAAE,eAAe;IACrB,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,iBAAiB;SACtC;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;IACpC,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport * as coreHttpCompat from \"@azure/core-http-compat\";\nimport {\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\nimport {\n DataSourcesImpl,\n IndexersImpl,\n SkillsetsImpl,\n SynonymMapsImpl,\n IndexesImpl,\n AliasesImpl,\n} from \"./operations\";\nimport {\n DataSources,\n Indexers,\n Skillsets,\n SynonymMaps,\n Indexes,\n Aliases,\n} from \"./operationsInterfaces\";\nimport * as Parameters from \"./models/parameters\";\nimport * as Mappers from \"./models/mappers\";\nimport {\n
|
|
1
|
+
{"version":3,"file":"searchServiceClient.js","sourceRoot":"","sources":["../../../../src/generated/service/searchServiceClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,cAAc,MAAM,yBAAyB,CAAC;AAM1D,OAAO,EACL,eAAe,EACf,YAAY,EACZ,aAAa,EACb,eAAe,EACf,WAAW,EACX,WAAW,GACZ,MAAM,cAAc,CAAC;AAStB,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAQ5C,gBAAgB;AAChB,MAAM,OAAO,mBAAoB,SAAQ,cAAc,CAAC,qBAAqB;IAI3E;;;;;OAKG;IACH,YACE,QAAgB,EAChB,UAAqC,EACrC,OAA2C;;QAE3C,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;QAC/C,CAAC;QACD,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;QACjD,CAAC;QAED,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,GAAG,EAAE,CAAC;QACf,CAAC;QACD,MAAM,QAAQ,GAAsC;YAClD,kBAAkB,EAAE,iCAAiC;SACtD,CAAC;QAEF,MAAM,cAAc,GAAG,yCAAyC,CAAC;QACjE,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;YAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,cAAc,EAAE;YACjE,CAAC,CAAC,GAAG,cAAc,EAAE,CAAC;QAE1B,MAAM,mBAAmB,iDACpB,QAAQ,GACR,OAAO,KACV,gBAAgB,EAAE;gBAChB,eAAe;aAChB,EACD,QAAQ,EAAE,MAAA,MAAA,OAAO,CAAC,QAAQ,mCAAI,OAAO,CAAC,OAAO,mCAAI,YAAY,GAC9D,CAAC;QACF,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAC3B,wBAAwB;QACxB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,WAAW,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;QAC7C,IAAI,CAAC,QAAQ,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;QACvC,IAAI,CAAC,SAAS,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,WAAW,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;QAC7C,IAAI,CAAC,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;QACrC,IAAI,CAAC,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;QACrC,IAAI,CAAC,yBAAyB,CAAC,UAAU,CAAC,CAAC;IAC7C,CAAC;IAED,8GAA8G;IACtG,yBAAyB,CAAC,UAAmB;QACnD,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO;QACT,CAAC;QACD,MAAM,gBAAgB,GAAG;YACvB,IAAI,EAAE,wBAAwB;YAC9B,KAAK,CAAC,WAAW,CACf,OAAwB,EACxB,IAAiB;gBAEjB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACrC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACrB,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;wBACjD,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;4BACrC,OAAO,cAAc,GAAG,UAAU,CAAC;wBACrC,CAAC;6BAAM,CAAC;4BACN,OAAO,IAAI,CAAC;wBACd,CAAC;oBACH,CAAC,CAAC,CAAC;oBACH,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACrD,CAAC;gBACD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;SACF,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC5C,CAAC;IAED;;;OAGG;IACH,oBAAoB,CAClB,OAA4C;QAE5C,OAAO,IAAI,CAAC,oBAAoB,CAC9B,EAAE,OAAO,EAAE,EACX,iCAAiC,CAClC,CAAC;IACJ,CAAC;CAQF;AACD,2BAA2B;AAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,iCAAiC,GAA6B;IAClE,IAAI,EAAE,eAAe;IACrB,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,iBAAiB;SACtC;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;IACpC,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport * as coreHttpCompat from \"@azure/core-http-compat\";\nimport {\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\nimport {\n DataSourcesImpl,\n IndexersImpl,\n SkillsetsImpl,\n SynonymMapsImpl,\n IndexesImpl,\n AliasesImpl,\n} from \"./operations\";\nimport {\n DataSources,\n Indexers,\n Skillsets,\n SynonymMaps,\n Indexes,\n Aliases,\n} from \"./operationsInterfaces\";\nimport * as Parameters from \"./models/parameters\";\nimport * as Mappers from \"./models/mappers\";\nimport {\n ApiVersion20241101Preview,\n SearchServiceClientOptionalParams,\n GetServiceStatisticsOptionalParams,\n GetServiceStatisticsResponse,\n} from \"./models\";\n\n/** @internal */\nexport class SearchServiceClient extends coreHttpCompat.ExtendedServiceClient {\n endpoint: string;\n apiVersion: ApiVersion20241101Preview;\n\n /**\n * Initializes a new instance of the SearchServiceClient class.\n * @param endpoint The endpoint URL of the search service.\n * @param apiVersion Api Version\n * @param options The parameter options\n */\n constructor(\n endpoint: string,\n apiVersion: ApiVersion20241101Preview,\n options?: SearchServiceClientOptionalParams,\n ) {\n if (endpoint === undefined) {\n throw new Error(\"'endpoint' cannot be null\");\n }\n if (apiVersion === undefined) {\n throw new Error(\"'apiVersion' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: SearchServiceClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\",\n };\n\n const packageDetails = `azsdk-js-search-documents/12.2.0-beta.2`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n endpoint: options.endpoint ?? options.baseUri ?? \"{endpoint}\",\n };\n super(optionsWithDefaults);\n // Parameter assignments\n this.endpoint = endpoint;\n this.apiVersion = apiVersion;\n this.dataSources = new DataSourcesImpl(this);\n this.indexers = new IndexersImpl(this);\n this.skillsets = new SkillsetsImpl(this);\n this.synonymMaps = new SynonymMapsImpl(this);\n this.indexes = new IndexesImpl(this);\n this.aliases = new AliasesImpl(this);\n this.addCustomApiVersionPolicy(apiVersion);\n }\n\n /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */\n private addCustomApiVersionPolicy(apiVersion?: string) {\n if (!apiVersion) {\n return;\n }\n const apiVersionPolicy = {\n name: \"CustomApiVersionPolicy\",\n async sendRequest(\n request: PipelineRequest,\n next: SendRequest,\n ): Promise<PipelineResponse> {\n const param = request.url.split(\"?\");\n if (param.length > 1) {\n const newParams = param[1].split(\"&\").map((item) => {\n if (item.indexOf(\"api-version\") > -1) {\n return \"api-version=\" + apiVersion;\n } else {\n return item;\n }\n });\n request.url = param[0] + \"?\" + newParams.join(\"&\");\n }\n return next(request);\n },\n };\n this.pipeline.addPolicy(apiVersionPolicy);\n }\n\n /**\n * Gets service level statistics for a search service.\n * @param options The options parameters.\n */\n getServiceStatistics(\n options?: GetServiceStatisticsOptionalParams,\n ): Promise<GetServiceStatisticsResponse> {\n return this.sendOperationRequest(\n { options },\n getServiceStatisticsOperationSpec,\n );\n }\n\n dataSources: DataSources;\n indexers: Indexers;\n skillsets: Skillsets;\n synonymMaps: SynonymMaps;\n indexes: Indexes;\n aliases: Aliases;\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getServiceStatisticsOperationSpec: coreClient.OperationSpec = {\n path: \"/servicestats\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.ServiceStatistics,\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept],\n serializer,\n};\n"]}
|
package/dist-esm/src/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
export { AzureKeyCredential } from "@azure/core-auth";
|
|
4
|
-
export { KnownHybridCountAndFacetMode, KnownQueryDebugMode, KnownQueryLanguage, KnownQuerySpellerType, KnownSemanticErrorMode, KnownSemanticErrorReason, KnownSemanticFieldState,
|
|
5
|
-
export { KnownAIStudioModelCatalogName, KnownAzureOpenAIModelName, KnownBlobIndexerDataToExtract, KnownBlobIndexerImageAction, KnownBlobIndexerParsingMode, KnownBlobIndexerPDFTextRotationAlgorithm, KnownCustomEntityLookupSkillLanguage, KnownEntityCategory, KnownEntityRecognitionSkillLanguage, KnownImageAnalysisSkillLanguage, KnownImageDetail, KnownIndexerExecutionEnvironment, KnownIndexerExecutionStatusDetail, KnownIndexingMode, KnownIndexProjectionMode, KnownKeyPhraseExtractionSkillLanguage, KnownLexicalAnalyzerName, KnownLexicalNormalizerName, KnownLexicalNormalizerName as KnownNormalizerNames, KnownOcrLineEnding, KnownOcrSkillLanguage, KnownPIIDetectionSkillMaskingMode, KnownRegexFlags, KnownSearchFieldDataType, KnownSearchIndexerDataSourceType, KnownSentimentSkillLanguage, KnownSplitSkillEncoderModelName, KnownSplitSkillLanguage, KnownSplitSkillUnit, KnownTextSplitMode, KnownTextTranslationSkillLanguage, KnownVectorEncodingFormat, KnownVectorSearchAlgorithmKind, KnownVectorSearchAlgorithmMetric, KnownVectorSearchCompressionKind, KnownVectorSearchCompressionTarget, KnownVectorSearchVectorizerKind, KnownVisualFeature, } from "./generated/service/models";
|
|
4
|
+
export { KnownHybridCountAndFacetMode, KnownQueryDebugMode, KnownQueryLanguage, KnownQuerySpellerType as KnownQuerySpeller, KnownSemanticErrorMode, KnownSemanticErrorReason, KnownSemanticFieldState, KnownSemanticQueryRewritesResultType, KnownSemanticSearchResultsType, KnownVectorFilterMode, KnownVectorQueryKind, KnownVectorThresholdKind, } from "./generated/data/models";
|
|
5
|
+
export { KnownAIStudioModelCatalogName, KnownAzureOpenAIModelName, KnownBlobIndexerDataToExtract, KnownBlobIndexerImageAction, KnownBlobIndexerParsingMode, KnownBlobIndexerPDFTextRotationAlgorithm, KnownCustomEntityLookupSkillLanguage, KnownDocumentIntelligenceLayoutSkillMarkdownHeaderDepth, KnownDocumentIntelligenceLayoutSkillOutputMode, KnownEntityCategory, KnownEntityRecognitionSkillLanguage, KnownImageAnalysisSkillLanguage, KnownImageDetail, KnownIndexerExecutionEnvironment, KnownIndexerExecutionStatusDetail, KnownIndexingMode, KnownIndexProjectionMode, KnownKeyPhraseExtractionSkillLanguage, KnownLexicalAnalyzerName, KnownLexicalNormalizerName, KnownLexicalNormalizerName as KnownNormalizerNames, KnownMarkdownHeaderDepth, KnownMarkdownParsingSubmode, KnownOcrLineEnding, KnownOcrSkillLanguage, KnownPIIDetectionSkillMaskingMode, KnownRegexFlags, KnownSearchFieldDataType, KnownSearchIndexerDataSourceType, KnownSentimentSkillLanguage, KnownSplitSkillEncoderModelName, KnownSplitSkillLanguage, KnownSplitSkillUnit, KnownTextSplitMode, KnownTextTranslationSkillLanguage, KnownVectorEncodingFormat, KnownVectorSearchAlgorithmKind, KnownVectorSearchAlgorithmMetric, KnownVectorSearchCompressionKind, KnownVectorSearchCompressionRescoreStorageMethod, KnownVectorSearchCompressionTarget, KnownVectorSearchVectorizerKind, KnownVisualFeature, } from "./generated/service/models";
|
|
6
6
|
export { default as GeographyPoint } from "./geographyPoint";
|
|
7
7
|
export { IndexDocumentsBatch } from "./indexDocumentsBatch";
|
|
8
8
|
export { odata } from "./odata";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAUL,4BAA4B,EAC5B,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EACvB,8BAA8B,EAC9B,YAAY,EACZ,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,GAgBzB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAqDL,6BAA6B,EAC7B,yBAAyB,EACzB,6BAA6B,EAC7B,2BAA2B,EAC3B,2BAA2B,EAC3B,wCAAwC,EACxC,oCAAoC,EACpC,mBAAmB,EACnB,mCAAmC,EACnC,+BAA+B,EAC/B,gBAAgB,EAChB,gCAAgC,EAChC,iCAAiC,EACjC,iBAAiB,EACjB,wBAAwB,EACxB,qCAAqC,EACrC,wBAAwB,EACxB,0BAA0B,EAC1B,0BAA0B,IAAI,oBAAoB,EAClD,kBAAkB,EAClB,qBAAqB,EACrB,iCAAiC,EACjC,eAAe,EACf,wBAAwB,EACxB,gCAAgC,EAChC,2BAA2B,EAC3B,+BAA+B,EAC/B,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EAClB,iCAAiC,EACjC,yBAAyB,EACzB,8BAA8B,EAC9B,gCAAgC,EAChC,gCAAgC,EAChC,kCAAkC,EAClC,+BAA+B,EAC/B,kBAAkB,GA4FnB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAkE5D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAuB,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAA4B,MAAM,qBAAqB,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAA8B,MAAM,uBAAuB,CAAC;AACxF,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EAEnB,4BAA4B,GAC7B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EA0EL,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,GAmEpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport { AzureKeyCredential } from \"@azure/core-auth\";\nexport {\n AutocompleteItem,\n AutocompleteMode,\n AutocompleteResult,\n FacetResult,\n HybridCountAndFacetMode,\n HybridSearch as HybridSearchOptions,\n IndexActionType,\n IndexDocumentsResult,\n IndexingResult,\n KnownHybridCountAndFacetMode,\n KnownQueryDebugMode,\n KnownQueryLanguage,\n KnownQuerySpellerType,\n KnownSemanticErrorMode,\n KnownSemanticErrorReason,\n KnownSemanticFieldState,\n KnownSemanticSearchResultsType,\n KnownSpeller,\n KnownVectorFilterMode,\n KnownVectorQueryKind,\n KnownVectorThresholdKind,\n QueryAnswerResult,\n QueryCaptionResult,\n QueryDebugMode,\n QueryLanguage,\n QueryResultDocumentRerankerInput,\n QueryResultDocumentSubscores,\n QuerySpellerType,\n QueryType,\n ScoringStatistics,\n SearchMode,\n SemanticFieldState,\n SingleVectorFieldResult,\n Speller,\n TextResult,\n VectorsDebugInfo,\n} from \"./generated/data/models\";\nexport {\n AIStudioModelCatalogName,\n AnalyzedTokenInfo,\n AnalyzeResult,\n AsciiFoldingTokenFilter,\n AzureActiveDirectoryApplicationCredentials,\n AzureMachineLearningSkill,\n AzureOpenAIModelName,\n AzureOpenAITokenizerParameters,\n BinaryQuantizationCompression,\n BM25Similarity,\n CharFilter as BaseCharFilter,\n CharFilterName,\n CjkBigramTokenFilter,\n CjkBigramTokenFilterScripts,\n ClassicSimilarity,\n ClassicTokenizer,\n CognitiveServicesAccount as BaseCognitiveServicesAccount,\n CognitiveServicesAccountKey,\n CommonGramTokenFilter,\n ConditionalSkill,\n CorsOptions,\n CustomEntity,\n CustomEntityAlias,\n CustomNormalizer,\n DataChangeDetectionPolicy as BaseDataChangeDetectionPolicy,\n DataDeletionDetectionPolicy as BaseDataDeletionDetectionPolicy,\n DefaultCognitiveServicesAccount,\n DictionaryDecompounderTokenFilter,\n DistanceScoringFunction,\n DistanceScoringParameters,\n DocumentExtractionSkill,\n EdgeNGramTokenFilterSide,\n EdgeNGramTokenizer,\n ElisionTokenFilter,\n EntityLinkingSkill,\n EntityRecognitionSkillV3,\n FieldMapping,\n FieldMappingFunction,\n FreshnessScoringFunction,\n FreshnessScoringParameters,\n HighWaterMarkChangeDetectionPolicy,\n IndexerExecutionResult,\n IndexerExecutionStatus,\n IndexerExecutionStatusDetail,\n IndexerState,\n IndexerStatus,\n IndexingMode,\n IndexingSchedule,\n IndexProjectionMode,\n InputFieldMappingEntry,\n KeepTokenFilter,\n KeywordMarkerTokenFilter,\n KnownAIStudioModelCatalogName,\n KnownAzureOpenAIModelName,\n KnownBlobIndexerDataToExtract,\n KnownBlobIndexerImageAction,\n KnownBlobIndexerParsingMode,\n KnownBlobIndexerPDFTextRotationAlgorithm,\n KnownCustomEntityLookupSkillLanguage,\n KnownEntityCategory,\n KnownEntityRecognitionSkillLanguage,\n KnownImageAnalysisSkillLanguage,\n KnownImageDetail,\n KnownIndexerExecutionEnvironment,\n KnownIndexerExecutionStatusDetail,\n KnownIndexingMode,\n KnownIndexProjectionMode,\n KnownKeyPhraseExtractionSkillLanguage,\n KnownLexicalAnalyzerName,\n KnownLexicalNormalizerName,\n KnownLexicalNormalizerName as KnownNormalizerNames,\n KnownOcrLineEnding,\n KnownOcrSkillLanguage,\n KnownPIIDetectionSkillMaskingMode,\n KnownRegexFlags,\n KnownSearchFieldDataType,\n KnownSearchIndexerDataSourceType,\n KnownSentimentSkillLanguage,\n KnownSplitSkillEncoderModelName,\n KnownSplitSkillLanguage,\n KnownSplitSkillUnit,\n KnownTextSplitMode,\n KnownTextTranslationSkillLanguage,\n KnownVectorEncodingFormat,\n KnownVectorSearchAlgorithmKind,\n KnownVectorSearchAlgorithmMetric,\n KnownVectorSearchCompressionKind,\n KnownVectorSearchCompressionTarget,\n KnownVectorSearchVectorizerKind,\n KnownVisualFeature,\n LanguageDetectionSkill,\n LengthTokenFilter,\n LexicalAnalyzer as BaseLexicalAnalyzer,\n LexicalAnalyzerName,\n LexicalNormalizer as BaseLexicalNormalizer,\n LexicalNormalizerName,\n LexicalTokenizer as BaseLexicalTokenizer,\n LexicalTokenizerName,\n LimitTokenFilter,\n LuceneStandardAnalyzer,\n MagnitudeScoringFunction,\n MagnitudeScoringParameters,\n MappingCharFilter,\n MergeSkill,\n MicrosoftLanguageStemmingTokenizer,\n MicrosoftLanguageTokenizer,\n MicrosoftStemmingTokenizerLanguage,\n MicrosoftTokenizerLanguage,\n NativeBlobSoftDeleteDeletionDetectionPolicy,\n NGramTokenizer,\n OcrLineEnding,\n OutputFieldMappingEntry,\n PathHierarchyTokenizerV2 as PathHierarchyTokenizer,\n PatternCaptureTokenFilter,\n PatternReplaceCharFilter,\n PatternReplaceTokenFilter,\n PhoneticEncoder,\n PhoneticTokenFilter,\n ResourceCounter,\n ScalarQuantizationCompression,\n ScalarQuantizationParameters,\n ScoringFunction as BaseScoringFunction,\n ScoringFunctionAggregation,\n ScoringFunctionInterpolation,\n SearchAlias,\n SearchIndexerDataContainer,\n SearchIndexerDataIdentity as BaseSearchIndexerDataIdentity,\n SearchIndexerDataNoneIdentity,\n SearchIndexerDataUserAssignedIdentity,\n SearchIndexerError,\n SearchIndexerIndexProjectionSelector,\n SearchIndexerKnowledgeStoreBlobProjectionSelector,\n SearchIndexerKnowledgeStoreFileProjectionSelector,\n SearchIndexerKnowledgeStoreObjectProjectionSelector,\n SearchIndexerKnowledgeStoreProjection,\n SearchIndexerKnowledgeStoreProjectionSelector,\n SearchIndexerKnowledgeStoreTableProjectionSelector,\n SearchIndexerLimits,\n SearchIndexerSkill as BaseSearchIndexerSkill,\n SearchIndexerStatus,\n SearchIndexerWarning,\n SemanticConfiguration,\n SemanticField,\n SemanticPrioritizedFields,\n SemanticSearch,\n SentimentSkillV3,\n ServiceCounters,\n ServiceLimits,\n ShaperSkill,\n ShingleTokenFilter,\n Similarity,\n SnowballTokenFilter,\n SnowballTokenFilterLanguage,\n SoftDeleteColumnDeletionDetectionPolicy,\n SplitSkillEncoderModelName,\n SplitSkillUnit,\n SqlIntegratedChangeTrackingPolicy,\n StemmerOverrideTokenFilter,\n StemmerTokenFilter,\n StemmerTokenFilterLanguage,\n StopAnalyzer,\n StopwordsList,\n StopwordsTokenFilter,\n Suggester as SearchSuggester,\n SynonymTokenFilter,\n TagScoringFunction,\n TagScoringParameters,\n TextWeights,\n TokenCharacterKind,\n TokenFilter as BaseTokenFilter,\n TokenFilterName,\n TruncateTokenFilter,\n UaxUrlEmailTokenizer,\n UniqueTokenFilter,\n VectorEncodingFormat,\n VectorSearchCompression as BaseVectorSearchCompression,\n VectorSearchCompressionKind,\n VectorSearchCompressionTarget,\n VectorSearchProfile,\n VectorSearchVectorizerKind,\n WordDelimiterTokenFilter,\n} from \"./generated/service/models\";\nexport { default as GeographyPoint } from \"./geographyPoint\";\nexport { IndexDocumentsBatch } from \"./indexDocumentsBatch\";\nexport {\n AutocompleteOptions,\n AutocompleteRequest,\n BaseSearchRequestOptions,\n BaseVectorQuery,\n BaseVectorThreshold,\n CountDocumentsOptions,\n DeleteDocumentsOptions,\n DocumentDebugInfo,\n ExcludedODataTypes,\n ExtractDocumentKey,\n ExtractiveQueryAnswer,\n ExtractiveQueryCaption,\n GetDocumentOptions,\n IndexDocumentsAction,\n IndexDocumentsOptions,\n ListSearchResultsPageSettings,\n MergeDocumentsOptions,\n MergeOrUploadDocumentsOptions,\n NarrowedModel,\n QueryAnswer,\n QueryCaption,\n QueryResultDocumentSemanticField,\n SearchDocumentsPageResult,\n SearchDocumentsResult,\n SearchDocumentsResultBase,\n SearchFieldArray,\n SearchIndexingBufferedSenderDeleteDocumentsOptions,\n SearchIndexingBufferedSenderFlushDocumentsOptions,\n SearchIndexingBufferedSenderMergeDocumentsOptions,\n SearchIndexingBufferedSenderMergeOrUploadDocumentsOptions,\n SearchIndexingBufferedSenderOptions,\n SearchIndexingBufferedSenderUploadDocumentsOptions,\n SearchIterator,\n SearchOptions,\n SearchPick,\n SearchRequestOptions,\n SearchRequestQueryTypeOptions,\n SearchResult,\n SearchScoreThreshold,\n SelectArray,\n SelectFields,\n SemanticDebugInfo,\n SemanticErrorMode,\n SemanticErrorReason,\n SemanticSearchOptions,\n SemanticSearchResultsType,\n SuggestDocumentsResult,\n SuggestNarrowedModel,\n SuggestOptions,\n SuggestRequest,\n SuggestResult,\n UnionToIntersection,\n UploadDocumentsOptions,\n VectorFilterMode,\n VectorizableImageBinaryQuery,\n VectorizableImageUrlQuery,\n VectorizableTextQuery,\n VectorizedQuery,\n VectorQuery,\n VectorQueryKind,\n VectorSearchOptions,\n VectorSimilarityThreshold,\n VectorThreshold,\n} from \"./indexModels\";\nexport { odata } from \"./odata\";\nexport { KnownSearchAudience } from \"./searchAudience\";\nexport { SearchClient, SearchClientOptions } from \"./searchClient\";\nexport { SearchIndexClient, SearchIndexClientOptions } from \"./searchIndexClient\";\nexport { SearchIndexerClient, SearchIndexerClientOptions } from \"./searchIndexerClient\";\nexport {\n DEFAULT_BATCH_SIZE,\n DEFAULT_FLUSH_WINDOW,\n DEFAULT_RETRY_COUNT,\n IndexDocumentsClient,\n SearchIndexingBufferedSender,\n} from \"./searchIndexingBufferedSender\";\nexport {\n AIServicesVisionParameters,\n AIServicesVisionVectorizer,\n AliasIterator,\n AnalyzeRequest,\n AnalyzeTextOptions,\n AzureMachineLearningVectorizer,\n AzureMachineLearningVectorizerParameters,\n AzureOpenAIEmbeddingSkill,\n AzureOpenAIParameters,\n AzureOpenAIVectorizer,\n BaseAzureMachineLearningVectorizerParameters,\n BaseVectorSearchAlgorithmConfiguration,\n BaseVectorSearchVectorizer,\n BlobIndexerDataToExtract,\n BlobIndexerImageAction,\n BlobIndexerParsingMode,\n BlobIndexerPDFTextRotationAlgorithm,\n CharFilter,\n CognitiveServicesAccount,\n ComplexDataType,\n ComplexField,\n CreateAliasOptions,\n CreateDataSourceConnectionOptions,\n CreateIndexerOptions,\n CreateIndexOptions,\n CreateOrUpdateAliasOptions,\n CreateorUpdateDataSourceConnectionOptions,\n CreateorUpdateIndexerOptions,\n CreateOrUpdateIndexOptions,\n CreateOrUpdateSkillsetOptions,\n CreateOrUpdateSynonymMapOptions,\n CreateSkillsetOptions,\n CreateSynonymMapOptions,\n CustomAnalyzer,\n CustomEntityLookupSkill,\n CustomEntityLookupSkillLanguage,\n DataChangeDetectionPolicy,\n DataDeletionDetectionPolicy,\n DeleteAliasOptions,\n DeleteDataSourceConnectionOptions,\n DeleteIndexerOptions,\n DeleteIndexOptions,\n DeleteSkillsetOptions,\n DeleteSynonymMapOptions,\n EdgeNGramTokenFilter,\n EntityCategory,\n EntityRecognitionSkill,\n EntityRecognitionSkillLanguage,\n ExhaustiveKnnAlgorithmConfiguration,\n ExhaustiveKnnParameters,\n GetAliasOptions,\n GetDataSourceConnectionOptions,\n GetIndexerOptions,\n GetIndexerStatusOptions,\n GetIndexOptions,\n GetIndexStatisticsOptions,\n GetServiceStatisticsOptions,\n GetSkillSetOptions,\n GetSynonymMapsOptions,\n HnswAlgorithmConfiguration,\n HnswParameters,\n ImageAnalysisSkill,\n ImageAnalysisSkillLanguage,\n ImageDetail,\n IndexerExecutionEnvironment,\n IndexingParameters,\n IndexingParametersConfiguration,\n IndexIterator,\n IndexNameIterator,\n KeyAuthAzureMachineLearningVectorizerParameters,\n KeyPhraseExtractionSkill,\n KeyPhraseExtractionSkillLanguage,\n KeywordTokenizer,\n KnownAnalyzerNames,\n KnownCharFilterNames,\n KnownTokenFilterNames,\n KnownTokenizerNames,\n LexicalAnalyzer,\n LexicalNormalizer,\n LexicalTokenizer,\n ListAliasesOptions,\n ListDataSourceConnectionsOptions,\n ListIndexersOptions,\n ListIndexesOptions,\n ListSkillsetsOptions,\n ListSynonymMapsOptions,\n LuceneStandardTokenizer,\n NGramTokenFilter,\n NoAuthAzureMachineLearningVectorizerParameters,\n OcrSkill,\n OcrSkillLanguage,\n PatternAnalyzer,\n PatternTokenizer,\n PIIDetectionSkill,\n PIIDetectionSkillMaskingMode,\n RegexFlags,\n ResetDocumentsOptions,\n ResetIndexerOptions,\n ResetSkillsOptions,\n RunIndexerOptions,\n ScoringFunction,\n ScoringProfile,\n SearchField,\n SearchFieldDataType,\n SearchIndex,\n SearchIndexAlias,\n SearchIndexer,\n SearchIndexerCache,\n SearchIndexerDataIdentity,\n SearchIndexerDataSourceConnection,\n SearchIndexerDataSourceType,\n SearchIndexerIndexProjection,\n SearchIndexerIndexProjectionParameters,\n SearchIndexerKnowledgeStore,\n SearchIndexerKnowledgeStoreParameters,\n SearchIndexerSkill,\n SearchIndexerSkillset,\n SearchIndexStatistics,\n SearchResourceEncryptionKey,\n SearchServiceStatistics,\n SentimentSkill,\n SentimentSkillLanguage,\n SimilarityAlgorithm,\n SimpleField,\n SplitSkill,\n SplitSkillLanguage,\n SynonymMap,\n TextSplitMode,\n TextTranslationSkill,\n TextTranslationSkillLanguage,\n TokenAuthAzureMachineLearningVectorizerParameters,\n TokenFilter,\n VectorSearch,\n VectorSearchAlgorithmConfiguration,\n VectorSearchAlgorithmKind,\n VectorSearchAlgorithmMetric,\n VectorSearchCompression,\n VectorSearchVectorizer,\n VisionVectorizeSkill,\n VisualFeature,\n WebApiParameters,\n WebApiSkill,\n WebApiVectorizer,\n} from \"./serviceModels\";\nexport { createSynonymMapFromFile } from \"./synonymMapHelper\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAWL,4BAA4B,EAC5B,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,IAAI,iBAAiB,EAC1C,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EACvB,oCAAoC,EACpC,8BAA8B,EAC9B,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,GAkBzB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAwDL,6BAA6B,EAC7B,yBAAyB,EACzB,6BAA6B,EAC7B,2BAA2B,EAC3B,2BAA2B,EAC3B,wCAAwC,EACxC,oCAAoC,EACpC,uDAAuD,EACvD,8CAA8C,EAC9C,mBAAmB,EACnB,mCAAmC,EACnC,+BAA+B,EAC/B,gBAAgB,EAChB,gCAAgC,EAChC,iCAAiC,EACjC,iBAAiB,EACjB,wBAAwB,EACxB,qCAAqC,EACrC,wBAAwB,EACxB,0BAA0B,EAC1B,0BAA0B,IAAI,oBAAoB,EAClD,wBAAwB,EACxB,2BAA2B,EAC3B,kBAAkB,EAClB,qBAAqB,EACrB,iCAAiC,EACjC,eAAe,EACf,wBAAwB,EACxB,gCAAgC,EAChC,2BAA2B,EAC3B,+BAA+B,EAC/B,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EAClB,iCAAiC,EACjC,yBAAyB,EACzB,8BAA8B,EAC9B,gCAAgC,EAChC,gCAAgC,EAChC,gDAAgD,EAChD,kCAAkC,EAClC,+BAA+B,EAC/B,kBAAkB,GAgGnB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAoE5D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAuB,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAA4B,MAAM,qBAAqB,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAA8B,MAAM,uBAAuB,CAAC;AACxF,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EAEnB,4BAA4B,GAC7B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EA4EL,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,GAmEpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport { AzureKeyCredential } from \"@azure/core-auth\";\nexport {\n AutocompleteItem,\n AutocompleteMode,\n AutocompleteResult,\n DebugInfo,\n FacetResult,\n HybridCountAndFacetMode,\n HybridSearch as HybridSearchOptions,\n IndexActionType,\n IndexDocumentsResult,\n IndexingResult,\n KnownHybridCountAndFacetMode,\n KnownQueryDebugMode,\n KnownQueryLanguage,\n KnownQuerySpellerType as KnownQuerySpeller,\n KnownSemanticErrorMode,\n KnownSemanticErrorReason,\n KnownSemanticFieldState,\n KnownSemanticQueryRewritesResultType,\n KnownSemanticSearchResultsType,\n KnownVectorFilterMode,\n KnownVectorQueryKind,\n KnownVectorThresholdKind,\n QueryAnswerResult,\n QueryCaptionResult,\n QueryDebugMode,\n QueryLanguage,\n QueryResultDocumentRerankerInput,\n QueryResultDocumentSubscores,\n QueryRewritesDebugInfo,\n QueryRewritesValuesDebugInfo,\n QuerySpellerType as QuerySpeller,\n QueryType,\n ScoringStatistics,\n SearchMode,\n SemanticFieldState,\n SemanticQueryRewritesResultType,\n SingleVectorFieldResult,\n TextResult,\n VectorsDebugInfo,\n} from \"./generated/data/models\";\nexport {\n AIServicesAccountKey,\n AIStudioModelCatalogName,\n AnalyzedTokenInfo,\n AnalyzeResult,\n AsciiFoldingTokenFilter,\n AzureActiveDirectoryApplicationCredentials,\n AzureMachineLearningSkill,\n AzureOpenAIModelName,\n AzureOpenAITokenizerParameters,\n BinaryQuantizationCompression,\n BM25Similarity,\n CharFilter as BaseCharFilter,\n CharFilterName,\n CjkBigramTokenFilter,\n CjkBigramTokenFilterScripts,\n ClassicSimilarity,\n ClassicTokenizer,\n CognitiveServicesAccount as BaseCognitiveServicesAccount,\n CognitiveServicesAccountKey,\n CommonGramTokenFilter,\n ConditionalSkill,\n CorsOptions,\n CustomEntity,\n CustomEntityAlias,\n CustomNormalizer,\n DataChangeDetectionPolicy as BaseDataChangeDetectionPolicy,\n DataDeletionDetectionPolicy as BaseDataDeletionDetectionPolicy,\n DefaultCognitiveServicesAccount,\n DictionaryDecompounderTokenFilter,\n DistanceScoringFunction,\n DistanceScoringParameters,\n DocumentExtractionSkill,\n DocumentIntelligenceLayoutSkillMarkdownHeaderDepth,\n DocumentIntelligenceLayoutSkillOutputMode,\n EdgeNGramTokenFilterSide,\n EdgeNGramTokenizer,\n ElisionTokenFilter,\n EntityLinkingSkill,\n EntityRecognitionSkillV3,\n FieldMapping,\n FieldMappingFunction,\n FreshnessScoringFunction,\n FreshnessScoringParameters,\n HighWaterMarkChangeDetectionPolicy,\n IndexerExecutionResult,\n IndexerExecutionStatus,\n IndexerExecutionStatusDetail,\n IndexerState,\n IndexerStatus,\n IndexingMode,\n IndexingSchedule,\n IndexProjectionMode,\n InputFieldMappingEntry,\n KeepTokenFilter,\n KeywordMarkerTokenFilter,\n KnownAIStudioModelCatalogName,\n KnownAzureOpenAIModelName,\n KnownBlobIndexerDataToExtract,\n KnownBlobIndexerImageAction,\n KnownBlobIndexerParsingMode,\n KnownBlobIndexerPDFTextRotationAlgorithm,\n KnownCustomEntityLookupSkillLanguage,\n KnownDocumentIntelligenceLayoutSkillMarkdownHeaderDepth,\n KnownDocumentIntelligenceLayoutSkillOutputMode,\n KnownEntityCategory,\n KnownEntityRecognitionSkillLanguage,\n KnownImageAnalysisSkillLanguage,\n KnownImageDetail,\n KnownIndexerExecutionEnvironment,\n KnownIndexerExecutionStatusDetail,\n KnownIndexingMode,\n KnownIndexProjectionMode,\n KnownKeyPhraseExtractionSkillLanguage,\n KnownLexicalAnalyzerName,\n KnownLexicalNormalizerName,\n KnownLexicalNormalizerName as KnownNormalizerNames,\n KnownMarkdownHeaderDepth,\n KnownMarkdownParsingSubmode,\n KnownOcrLineEnding,\n KnownOcrSkillLanguage,\n KnownPIIDetectionSkillMaskingMode,\n KnownRegexFlags,\n KnownSearchFieldDataType,\n KnownSearchIndexerDataSourceType,\n KnownSentimentSkillLanguage,\n KnownSplitSkillEncoderModelName,\n KnownSplitSkillLanguage,\n KnownSplitSkillUnit,\n KnownTextSplitMode,\n KnownTextTranslationSkillLanguage,\n KnownVectorEncodingFormat,\n KnownVectorSearchAlgorithmKind,\n KnownVectorSearchAlgorithmMetric,\n KnownVectorSearchCompressionKind,\n KnownVectorSearchCompressionRescoreStorageMethod,\n KnownVectorSearchCompressionTarget,\n KnownVectorSearchVectorizerKind,\n KnownVisualFeature,\n LanguageDetectionSkill,\n LengthTokenFilter,\n LexicalAnalyzer as BaseLexicalAnalyzer,\n LexicalAnalyzerName,\n LexicalNormalizer as BaseLexicalNormalizer,\n LexicalNormalizerName,\n LexicalTokenizer as BaseLexicalTokenizer,\n LexicalTokenizerName,\n LimitTokenFilter,\n LuceneStandardAnalyzer,\n MagnitudeScoringFunction,\n MagnitudeScoringParameters,\n MappingCharFilter,\n MarkdownHeaderDepth,\n MarkdownParsingSubmode,\n MergeSkill,\n MicrosoftLanguageStemmingTokenizer,\n MicrosoftLanguageTokenizer,\n MicrosoftStemmingTokenizerLanguage,\n MicrosoftTokenizerLanguage,\n NativeBlobSoftDeleteDeletionDetectionPolicy,\n NGramTokenizer,\n OcrLineEnding,\n OutputFieldMappingEntry,\n PathHierarchyTokenizerV2 as PathHierarchyTokenizer,\n PatternCaptureTokenFilter,\n PatternReplaceCharFilter,\n PatternReplaceTokenFilter,\n PhoneticEncoder,\n PhoneticTokenFilter,\n RescoringOptions,\n ResourceCounter,\n ScalarQuantizationCompression,\n ScalarQuantizationParameters,\n ScoringFunction as BaseScoringFunction,\n ScoringFunctionAggregation,\n ScoringFunctionInterpolation,\n SearchAlias,\n SearchIndexerDataContainer,\n SearchIndexerDataIdentity as BaseSearchIndexerDataIdentity,\n SearchIndexerDataNoneIdentity,\n SearchIndexerDataUserAssignedIdentity,\n SearchIndexerError,\n SearchIndexerIndexProjectionSelector,\n SearchIndexerKnowledgeStoreBlobProjectionSelector,\n SearchIndexerKnowledgeStoreFileProjectionSelector,\n SearchIndexerKnowledgeStoreObjectProjectionSelector,\n SearchIndexerKnowledgeStoreProjection,\n SearchIndexerKnowledgeStoreProjectionSelector,\n SearchIndexerKnowledgeStoreTableProjectionSelector,\n SearchIndexerLimits,\n SearchIndexerSkill as BaseSearchIndexerSkill,\n SearchIndexerStatus,\n SearchIndexerWarning,\n SemanticConfiguration,\n SemanticField,\n SemanticPrioritizedFields,\n SemanticSearch,\n SentimentSkillV3,\n ServiceCounters,\n ServiceLimits,\n ShaperSkill,\n ShingleTokenFilter,\n Similarity,\n SnowballTokenFilter,\n SnowballTokenFilterLanguage,\n SoftDeleteColumnDeletionDetectionPolicy,\n SplitSkillEncoderModelName,\n SplitSkillUnit,\n SqlIntegratedChangeTrackingPolicy,\n StemmerOverrideTokenFilter,\n StemmerTokenFilter,\n StemmerTokenFilterLanguage,\n StopAnalyzer,\n StopwordsList,\n StopwordsTokenFilter,\n Suggester as SearchSuggester,\n SynonymTokenFilter,\n TagScoringFunction,\n TagScoringParameters,\n TextWeights,\n TokenCharacterKind,\n TokenFilter as BaseTokenFilter,\n TokenFilterName,\n TruncateTokenFilter,\n UaxUrlEmailTokenizer,\n UniqueTokenFilter,\n VectorEncodingFormat,\n VectorSearchCompression as BaseVectorSearchCompression,\n VectorSearchCompressionKind,\n VectorSearchCompressionRescoreStorageMethod,\n VectorSearchCompressionTarget,\n VectorSearchProfile,\n VectorSearchVectorizerKind,\n WordDelimiterTokenFilter,\n} from \"./generated/service/models\";\nexport { default as GeographyPoint } from \"./geographyPoint\";\nexport { IndexDocumentsBatch } from \"./indexDocumentsBatch\";\nexport {\n AutocompleteOptions,\n AutocompleteRequest,\n BaseSearchRequestOptions,\n BaseVectorQuery,\n BaseVectorThreshold,\n CountDocumentsOptions,\n DeleteDocumentsOptions,\n DocumentDebugInfo,\n ExcludedODataTypes,\n ExtractDocumentKey,\n ExtractiveQueryAnswer,\n ExtractiveQueryCaption,\n GenerativeQueryRewrites,\n GetDocumentOptions,\n IndexDocumentsAction,\n IndexDocumentsOptions,\n ListSearchResultsPageSettings,\n MergeDocumentsOptions,\n MergeOrUploadDocumentsOptions,\n NarrowedModel,\n QueryAnswer,\n QueryCaption,\n QueryResultDocumentSemanticField,\n QueryRewrites,\n SearchDocumentsPageResult,\n SearchDocumentsResult,\n SearchDocumentsResultBase,\n SearchFieldArray,\n SearchIndexingBufferedSenderDeleteDocumentsOptions,\n SearchIndexingBufferedSenderFlushDocumentsOptions,\n SearchIndexingBufferedSenderMergeDocumentsOptions,\n SearchIndexingBufferedSenderMergeOrUploadDocumentsOptions,\n SearchIndexingBufferedSenderOptions,\n SearchIndexingBufferedSenderUploadDocumentsOptions,\n SearchIterator,\n SearchOptions,\n SearchPick,\n SearchRequestOptions,\n SearchRequestQueryTypeOptions,\n SearchResult,\n SearchScoreThreshold,\n SelectArray,\n SelectFields,\n SemanticDebugInfo,\n SemanticErrorMode,\n SemanticErrorReason,\n SemanticSearchOptions,\n SemanticSearchResultsType,\n SuggestDocumentsResult,\n SuggestNarrowedModel,\n SuggestOptions,\n SuggestRequest,\n SuggestResult,\n UnionToIntersection,\n UploadDocumentsOptions,\n VectorFilterMode,\n VectorizableImageBinaryQuery,\n VectorizableImageUrlQuery,\n VectorizableTextQuery,\n VectorizedQuery,\n VectorQuery,\n VectorQueryKind,\n VectorSearchOptions,\n VectorSimilarityThreshold,\n VectorThreshold,\n} from \"./indexModels\";\nexport { odata } from \"./odata\";\nexport { KnownSearchAudience } from \"./searchAudience\";\nexport { SearchClient, SearchClientOptions } from \"./searchClient\";\nexport { SearchIndexClient, SearchIndexClientOptions } from \"./searchIndexClient\";\nexport { SearchIndexerClient, SearchIndexerClientOptions } from \"./searchIndexerClient\";\nexport {\n DEFAULT_BATCH_SIZE,\n DEFAULT_FLUSH_WINDOW,\n DEFAULT_RETRY_COUNT,\n IndexDocumentsClient,\n SearchIndexingBufferedSender,\n} from \"./searchIndexingBufferedSender\";\nexport {\n AIServicesAccountIdentity,\n AIServicesVisionParameters,\n AIServicesVisionVectorizer,\n AliasIterator,\n AnalyzeRequest,\n AnalyzeTextOptions,\n AzureMachineLearningVectorizer,\n AzureMachineLearningVectorizerParameters,\n AzureOpenAIEmbeddingSkill,\n AzureOpenAIParameters,\n AzureOpenAIVectorizer,\n BaseAzureMachineLearningVectorizerParameters,\n BaseVectorSearchAlgorithmConfiguration,\n BaseVectorSearchVectorizer,\n BlobIndexerDataToExtract,\n BlobIndexerImageAction,\n BlobIndexerParsingMode,\n BlobIndexerPDFTextRotationAlgorithm,\n CharFilter,\n CognitiveServicesAccount,\n ComplexDataType,\n ComplexField,\n CreateAliasOptions,\n CreateDataSourceConnectionOptions,\n CreateIndexerOptions,\n CreateIndexOptions,\n CreateOrUpdateAliasOptions,\n CreateorUpdateDataSourceConnectionOptions,\n CreateorUpdateIndexerOptions,\n CreateOrUpdateIndexOptions,\n CreateOrUpdateSkillsetOptions,\n CreateOrUpdateSynonymMapOptions,\n CreateSkillsetOptions,\n CreateSynonymMapOptions,\n CustomAnalyzer,\n CustomEntityLookupSkill,\n CustomEntityLookupSkillLanguage,\n DataChangeDetectionPolicy,\n DataDeletionDetectionPolicy,\n DeleteAliasOptions,\n DeleteDataSourceConnectionOptions,\n DeleteIndexerOptions,\n DeleteIndexOptions,\n DeleteSkillsetOptions,\n DeleteSynonymMapOptions,\n DocumentIntelligenceLayoutSkill,\n EdgeNGramTokenFilter,\n EntityCategory,\n EntityRecognitionSkill,\n EntityRecognitionSkillLanguage,\n ExhaustiveKnnAlgorithmConfiguration,\n ExhaustiveKnnParameters,\n GetAliasOptions,\n GetDataSourceConnectionOptions,\n GetIndexerOptions,\n GetIndexerStatusOptions,\n GetIndexOptions,\n GetIndexStatisticsOptions,\n GetServiceStatisticsOptions,\n GetSkillSetOptions,\n GetSynonymMapsOptions,\n HnswAlgorithmConfiguration,\n HnswParameters,\n ImageAnalysisSkill,\n ImageAnalysisSkillLanguage,\n ImageDetail,\n IndexerExecutionEnvironment,\n IndexingParameters,\n IndexingParametersConfiguration,\n IndexIterator,\n IndexNameIterator,\n KeyAuthAzureMachineLearningVectorizerParameters,\n KeyPhraseExtractionSkill,\n KeyPhraseExtractionSkillLanguage,\n KeywordTokenizer,\n KnownAnalyzerNames,\n KnownCharFilterNames,\n KnownTokenFilterNames,\n KnownTokenizerNames,\n LexicalAnalyzer,\n LexicalNormalizer,\n LexicalTokenizer,\n ListAliasesOptions,\n ListDataSourceConnectionsOptions,\n ListIndexersOptions,\n ListIndexesOptions,\n ListSkillsetsOptions,\n ListSynonymMapsOptions,\n LuceneStandardTokenizer,\n NGramTokenFilter,\n NoAuthAzureMachineLearningVectorizerParameters,\n OcrSkill,\n OcrSkillLanguage,\n PatternAnalyzer,\n PatternTokenizer,\n PIIDetectionSkill,\n PIIDetectionSkillMaskingMode,\n RegexFlags,\n ResetDocumentsOptions,\n ResetIndexerOptions,\n ResetSkillsOptions,\n RunIndexerOptions,\n ScoringFunction,\n ScoringProfile,\n SearchField,\n SearchFieldDataType,\n SearchIndex,\n SearchIndexAlias,\n SearchIndexer,\n SearchIndexerCache,\n SearchIndexerDataIdentity,\n SearchIndexerDataSourceConnection,\n SearchIndexerDataSourceType,\n SearchIndexerIndexProjection,\n SearchIndexerIndexProjectionParameters,\n SearchIndexerKnowledgeStore,\n SearchIndexerKnowledgeStoreParameters,\n SearchIndexerSkill,\n SearchIndexerSkillset,\n SearchIndexStatistics,\n SearchResourceEncryptionKey,\n SearchServiceStatistics,\n SentimentSkill,\n SentimentSkillLanguage,\n SimilarityAlgorithm,\n SimpleField,\n SplitSkill,\n SplitSkillLanguage,\n SynonymMap,\n TextSplitMode,\n TextTranslationSkill,\n TextTranslationSkillLanguage,\n TokenAuthAzureMachineLearningVectorizerParameters,\n TokenFilter,\n VectorSearch,\n VectorSearchAlgorithmConfiguration,\n VectorSearchAlgorithmKind,\n VectorSearchAlgorithmMetric,\n VectorSearchCompression,\n VectorSearchVectorizer,\n VisionVectorizeSkill,\n VisualFeature,\n WebApiParameters,\n WebApiSkill,\n WebApiVectorizer,\n} from \"./serviceModels\";\nexport { createSynonymMapFromFile } from \"./synonymMapHelper\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexDocumentsBatch.js","sourceRoot":"","sources":["../../src/indexDocumentsBatch.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC;;;GAGG;AACH,MAAM,OAAO,mBAAmB;IAM9B,YAAY,UAA0C,EAAE;QACtD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,SAAmB;QAC/B,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAA+B,CAAC,GAAG,EAAE,EAAE;YAChE,uCACK,GAAG,KACN,YAAY,EAAE,QAAQ,IACtB;QACJ,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,SAAmB;QAC9B,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAA+B,CAAC,GAAG,EAAE,EAAE;YAChE,uCACK,GAAG,KACN,YAAY,EAAE,OAAO,IACrB;QACJ,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED;;;;OAIG;IACI,aAAa,CAAC,SAAmB;QACtC,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAA+B,CAAC,GAAG,EAAE,EAAE;YAChE,uCACK,GAAG,KACN,YAAY,EAAE,eAAe,IAC7B;QACJ,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;IAC9B,CAAC;IAeM,MAAM,CAAC,kBAA2C,EAAE,SAAoB;QAC7E,IAAI,SAAS,EAAE,CAAC;YACd,MAAM,OAAO,GAAG,kBAAkC,CAAC;YAEnD,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAA+B,CAAC,QAAQ,EAAE,EAAE;gBACrE,OAAO;oBACL,YAAY,EAAE,QAAQ;oBACtB,CAAC,OAAO,CAAC,EAAE,QAAQ;iBACY,CAAC;YACpC,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;QAC9B,CAAC;aAAM,CAAC;YACN,MAAM,SAAS,GAAG,kBAA8B,CAAC;YAEjD,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAA+B,CAAC,QAAQ,EAAE,EAAE;gBACrE,OAAO,gBACL,YAAY,EAAE,QAAQ,IACnB,QAAQ,CACoB,CAAC;YACpC,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { IndexDocumentsAction } from \"./indexModels\";\n\n/**\n * Class used to perform batch operations\n * with multiple documents to the index.\n */\nexport class IndexDocumentsBatch<TModel> {\n /**\n * The set of actions taken in this batch.\n */\n public readonly actions: IndexDocumentsAction<TModel>[];\n\n constructor(actions: IndexDocumentsAction<TModel>[] = []) {\n this.actions = actions;\n }\n\n /**\n * Upload an array of documents to the index.\n * @param documents - The documents to upload.\n */\n public upload(documents: TModel[]): void {\n const batch = documents.map<IndexDocumentsAction<TModel>>((doc) => {\n return {\n ...doc,\n __actionType: \"upload\",\n };\n });\n\n this.actions.push(...batch);\n }\n\n /**\n * Update a set of documents in the index.\n * For more details about how merging works, see https://docs.microsoft.com/en-us/rest/api/searchservice/AddUpdate-or-Delete-Documents\n * @param documents - The updated documents.\n */\n public merge(documents: TModel[]): void {\n const batch = documents.map<IndexDocumentsAction<TModel>>((doc) => {\n return {\n ...doc,\n __actionType: \"merge\",\n };\n });\n\n this.actions.push(...batch);\n }\n\n /**\n * Update a set of documents in the index or uploads them if they don't exist.\n * For more details about how merging works, see https://docs.microsoft.com/en-us/rest/api/searchservice/AddUpdate-or-Delete-Documents\n * @param documents - The new/updated documents.\n */\n public mergeOrUpload(documents: TModel[]): void {\n const batch = documents.map<IndexDocumentsAction<TModel>>((doc) => {\n return {\n ...doc,\n __actionType: \"mergeOrUpload\",\n };\n });\n\n this.actions.push(...batch);\n }\n\n /**\n * Delete a set of documents.\n * @param keyName - The name of their primary key in the index.\n * @param keyValues - The primary key values of documents to delete.\n */\n public delete(keyName: keyof TModel, keyValues: string[]): void;\n\n /**\n * Delete a set of documents.\n * @param documents - Documents to be deleted.\n */\n public delete(documents: TModel[]): void;\n\n public delete(keyNameOrDocuments: keyof TModel | TModel[], keyValues?: string[]): void {\n if (keyValues) {\n const keyName = keyNameOrDocuments as keyof TModel;\n\n const batch = keyValues.map<IndexDocumentsAction<TModel>>((keyValue) => {\n return {\n __actionType: \"delete\",\n [keyName]: keyValue,\n } as IndexDocumentsAction<TModel>;\n });\n\n this.actions.push(...batch);\n } else {\n const documents = keyNameOrDocuments as TModel[];\n\n const batch = documents.map<IndexDocumentsAction<TModel>>((document) => {\n return {\n __actionType: \"delete\",\n ...document,\n } as IndexDocumentsAction<TModel>;\n });\n\n this.actions.push(...batch);\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"indexDocumentsBatch.js","sourceRoot":"","sources":["../../src/indexDocumentsBatch.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC;;;GAGG;AACH,MAAM,OAAO,mBAAmB;IAM9B,YAAY,UAA0C,EAAE;QACtD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,SAAmB;QAC/B,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAA+B,CAAC,GAAG,EAAE,EAAE;YAChE,uCACK,GAAG,KACN,YAAY,EAAE,QAAQ,IACtB;QACJ,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,SAAmB;QAC9B,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAA+B,CAAC,GAAG,EAAE,EAAE;YAChE,uCACK,GAAG,KACN,YAAY,EAAE,OAAO,IACrB;QACJ,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED;;;;OAIG;IACI,aAAa,CAAC,SAAmB;QACtC,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAA+B,CAAC,GAAG,EAAE,EAAE;YAChE,uCACK,GAAG,KACN,YAAY,EAAE,eAAe,IAC7B;QACJ,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;IAC9B,CAAC;IAeM,MAAM,CAAC,kBAA2C,EAAE,SAAoB;QAC7E,IAAI,SAAS,EAAE,CAAC;YACd,MAAM,OAAO,GAAG,kBAAkC,CAAC;YAEnD,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAA+B,CAAC,QAAQ,EAAE,EAAE;gBACrE,OAAO;oBACL,YAAY,EAAE,QAAQ;oBACtB,CAAC,OAAO,CAAC,EAAE,QAAQ;iBACY,CAAC;YACpC,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;QAC9B,CAAC;aAAM,CAAC;YACN,MAAM,SAAS,GAAG,kBAA8B,CAAC;YAEjD,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAA+B,CAAC,QAAQ,EAAE,EAAE;gBACrE,OAAO,gBACL,YAAY,EAAE,QAAQ,IACnB,QAAQ,CACoB,CAAC;YACpC,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { IndexDocumentsAction } from \"./indexModels\";\n\n/**\n * Class used to perform batch operations\n * with multiple documents to the index.\n */\nexport class IndexDocumentsBatch<TModel> {\n /**\n * The set of actions taken in this batch.\n */\n public readonly actions: IndexDocumentsAction<TModel>[];\n\n constructor(actions: IndexDocumentsAction<TModel>[] = []) {\n this.actions = actions;\n }\n\n /**\n * Upload an array of documents to the index.\n * @param documents - The documents to upload.\n */\n public upload(documents: TModel[]): void {\n const batch = documents.map<IndexDocumentsAction<TModel>>((doc) => {\n return {\n ...doc,\n __actionType: \"upload\",\n };\n });\n\n this.actions.push(...batch);\n }\n\n /**\n * Update a set of documents in the index.\n * For more details about how merging works, see https://docs.microsoft.com/en-us/rest/api/searchservice/AddUpdate-or-Delete-Documents\n * @param documents - The updated documents.\n */\n public merge(documents: TModel[]): void {\n const batch = documents.map<IndexDocumentsAction<TModel>>((doc) => {\n return {\n ...doc,\n __actionType: \"merge\",\n };\n });\n\n this.actions.push(...batch);\n }\n\n /**\n * Update a set of documents in the index or uploads them if they don't exist.\n * For more details about how merging works, see https://docs.microsoft.com/en-us/rest/api/searchservice/AddUpdate-or-Delete-Documents\n * @param documents - The new/updated documents.\n */\n public mergeOrUpload(documents: TModel[]): void {\n const batch = documents.map<IndexDocumentsAction<TModel>>((doc) => {\n return {\n ...doc,\n __actionType: \"mergeOrUpload\",\n };\n });\n\n this.actions.push(...batch);\n }\n\n /**\n * Delete a set of documents.\n * @param keyName - The name of their primary key in the index.\n * @param keyValues - The primary key values of documents to delete.\n */\n public delete(keyName: keyof TModel, keyValues: string[]): void;\n\n /**\n * Delete a set of documents.\n * @param documents - Documents to be deleted.\n */\n public delete(documents: TModel[]): void;\n\n public delete(keyNameOrDocuments: keyof TModel | TModel[], keyValues?: string[]): void {\n if (keyValues) {\n const keyName = keyNameOrDocuments as keyof TModel;\n\n const batch = keyValues.map<IndexDocumentsAction<TModel>>((keyValue) => {\n return {\n __actionType: \"delete\",\n [keyName]: keyValue,\n } as IndexDocumentsAction<TModel>;\n });\n\n this.actions.push(...batch);\n } else {\n const documents = keyNameOrDocuments as TModel[];\n\n const batch = documents.map<IndexDocumentsAction<TModel>>((document) => {\n return {\n __actionType: \"delete\",\n ...document,\n } as IndexDocumentsAction<TModel>;\n });\n\n this.actions.push(...batch);\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexModels.js","sourceRoot":"","sources":["../../src/indexModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { OperationOptions } from \"@azure/core-client\";\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport {\n AutocompleteMode,\n FacetResult,\n HybridSearch,\n IndexActionType,\n KnownSemanticErrorMode,\n KnownSemanticErrorReason,\n KnownSemanticSearchResultsType,\n KnownVectorFilterMode,\n KnownVectorQueryKind,\n QueryAnswerResult,\n QueryCaptionResult,\n QueryDebugMode,\n QueryLanguage,\n QueryResultDocumentRerankerInput,\n QueryType,\n ScoringStatistics,\n SearchMode,\n SemanticFieldState,\n Speller,\n VectorsDebugInfo,\n} from \"./generated/data/models\";\nimport GeographyPoint from \"./geographyPoint\";\n\n/**\n * Options for performing the count operation on the index.\n */\nexport type CountDocumentsOptions = OperationOptions;\n\n/**\n * Options for SearchIndexingBufferedSender.\n */\nexport interface SearchIndexingBufferedSenderOptions {\n /**\n * Indicates if autoFlush is enabled.\n */\n autoFlush?: boolean;\n /**\n * Initial Batch Action Count.\n *\n * A batch request will be sent once the documents\n * reach the initialBatchActionCount.\n */\n initialBatchActionCount?: number;\n /**\n * Flush Window.\n *\n * A batch request will be sent after flushWindowInMs is\n * reached.\n */\n flushWindowInMs?: number;\n /**\n * Maximum number of Retries\n */\n maxRetriesPerAction?: number;\n /**\n * Delay between retries\n */\n throttlingDelayInMs?: number;\n /**\n * Max Delay between retries\n */\n maxThrottlingDelayInMs?: number;\n}\n\n/**\n * Options for SearchIndexingBufferedSenderUploadDocuments.\n */\nexport type SearchIndexingBufferedSenderUploadDocumentsOptions = OperationOptions;\n/**\n * Options for SearchIndexingBufferedSenderMergeDocuments.\n */\nexport type SearchIndexingBufferedSenderMergeDocumentsOptions = OperationOptions;\n/**\n * Options for SearchIndexingBufferedSenderMergeOrUploadDocuments.\n */\nexport type SearchIndexingBufferedSenderMergeOrUploadDocumentsOptions = OperationOptions;\n/**\n * Options for SearchIndexingBufferedSenderDeleteDocuments.\n */\nexport type SearchIndexingBufferedSenderDeleteDocumentsOptions = OperationOptions;\n/**\n * Options for SearchIndexingBufferedSenderFlushDocuments.\n */\nexport type SearchIndexingBufferedSenderFlushDocumentsOptions = OperationOptions;\n\n/**\n * Options for retrieving a single document.\n */\nexport interface GetDocumentOptions<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> extends OperationOptions {\n /**\n * List of field names to retrieve for the document; Any field not retrieved will be missing from\n * the returned document.\n */\n selectedFields?: SelectArray<TFields>;\n}\n\n/**\n * Options for the modify index batch operation.\n */\nexport interface IndexDocumentsOptions extends OperationOptions {\n /**\n * If true, will cause this operation to throw if any document operation\n * in the batch did not succeed.\n */\n throwOnAnyFailure?: boolean;\n}\n\n/**\n * Options for the upload documents operation.\n */\nexport type UploadDocumentsOptions = IndexDocumentsOptions;\n\n/**\n * Options for the merge documents operation.\n */\nexport type MergeDocumentsOptions = IndexDocumentsOptions;\n\n/**\n * Options for the merge or upload documents operation.\n */\nexport type MergeOrUploadDocumentsOptions = IndexDocumentsOptions;\n\n/**\n * Options for the delete documents operation.\n */\nexport type DeleteDocumentsOptions = IndexDocumentsOptions;\n\n/**\n * Arguments for retrieving the next page of search results.\n */\nexport interface ListSearchResultsPageSettings {\n /**\n * A token used for retrieving the next page of results when the server\n * enforces pagination.\n */\n continuationToken?: string;\n}\n\n// BEGIN manually modified generated interfaces\n//\n// This section is for places where we have to manually fix issues\n// with interfaces from the generated code.\n// Mostly this is to allow modeling additionalProperties:true as generics.\n\n/**\n * Options for retrieving completion text for a partial searchText.\n */\nexport type AutocompleteOptions<TModel extends object> = OperationOptions &\n AutocompleteRequest<TModel>;\n/**\n * Options for committing a full search request.\n */\nexport type SearchOptions<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> = OperationOptions & SearchRequestOptions<TModel, TFields>;\n/**\n * Options for retrieving suggestions based on the searchText.\n */\nexport type SuggestOptions<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> = OperationOptions & SuggestRequest<TModel, TFields>;\n\n/**\n * An iterator for search results of a paticular query. Will make requests\n * as needed during iteration. Use .byPage() to make one request to the server\n * per iteration.\n */\nexport type SearchIterator<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> = PagedAsyncIterableIterator<\n SearchResult<TModel, TFields>,\n SearchDocumentsPageResult<TModel, TFields>,\n ListSearchResultsPageSettings\n>;\n\n/** The query parameters for vector and hybrid search queries. */\nexport type VectorQuery<TModel extends object> =\n | VectorizedQuery<TModel>\n | VectorizableTextQuery<TModel>\n | VectorizableImageUrlQuery<TModel>\n | VectorizableImageBinaryQuery<TModel>;\n\n/** The query parameters for vector and hybrid search queries. */\nexport interface BaseVectorQuery<TModel extends object> {\n /**\n * ### Known values supported by the service\n * **vector**: Vector query where a raw vector value is provided.\n * **text**: Vector query where a text value that needs to be vectorized is provided.\n * **imageUrl**: Vector query where an url that represents an image value that needs to be vectorized is provided.\n * **imageBinary**: Vector query where a base 64 encoded binary of an image that needs to be vectorized is provided.\n */\n kind: VectorQueryKind;\n /** Number of nearest neighbors to return as top hits. */\n kNearestNeighborsCount?: number;\n /** Vector Fields of type Collection(Edm.Single) to be included in the vector searched. */\n fields?: SearchFieldArray<TModel>;\n /**\n * When true, triggers an exhaustive k-nearest neighbor search across all vectors within the\n * vector index. Useful for scenarios where exact matches are critical, such as determining ground\n * truth values.\n */\n exhaustive?: boolean;\n /**\n * Oversampling factor. Minimum value is 1. It overrides the 'defaultOversampling' parameter\n * configured in the index definition. It can be set only when 'rerankWithOriginalVectors' is\n * true. This parameter is only permitted when a compression method is used on the underlying\n * vector field.\n */\n oversampling?: number;\n /** Relative weight of the vector query when compared to other vector query and/or the text query within the same search request. This value is used when combining the results of multiple ranking lists produced by the different vector queries and/or the results retrieved through the text query. The higher the weight, the higher the documents that matched that query will be in the final ranking. Default is 1.0 and the value needs to be a positive number larger than zero. */\n weight?: number;\n /** The threshold used for vector queries. Note this can only be set if all 'fields' use the same similarity metric. */\n threshold?: VectorThreshold;\n /** The OData filter expression to apply to this specific vector query. If no filter expression is defined at the vector level, the expression defined in\n * the top level filter parameter is used instead. */\n filterOverride?: string;\n}\n\n/** The query parameters to use for vector search when a raw vector value is provided. */\nexport interface VectorizedQuery<TModel extends object> extends BaseVectorQuery<TModel> {\n /** Polymorphic discriminator, which specifies the different types this object can be */\n kind: \"vector\";\n /** The vector representation of a search query. */\n vector: number[];\n}\n\n/** The query parameters to use for vector search when a text value that needs to be vectorized is provided. */\nexport interface VectorizableTextQuery<TModel extends object> extends BaseVectorQuery<TModel> {\n /** Polymorphic discriminator, which specifies the different types this object can be */\n kind: \"text\";\n /** The text to be vectorized to perform a vector search query. */\n text: string;\n}\n\n/** The query parameters to use for vector search when an url that represents an image value that needs to be vectorized is provided. */\nexport interface VectorizableImageUrlQuery<TModel extends object> extends BaseVectorQuery<TModel> {\n /** Polymorphic discriminator, which specifies the different types this object can be */\n kind: \"imageUrl\";\n /** The URL of an image to be vectorized to perform a vector search query. */\n url: string;\n}\n\n/** The query parameters to use for vector search when a base 64 encoded binary of an image that needs to be vectorized is provided. */\nexport interface VectorizableImageBinaryQuery<TModel extends object>\n extends BaseVectorQuery<TModel> {\n /** Polymorphic discriminator, which specifies the different types this object can be */\n kind: \"imageBinary\";\n /** The base64 encoded binary of an image to be vectorized to perform a vector search query. */\n binaryImage: string;\n}\n\n/**\n * Parameters for filtering, sorting, faceting, paging, and other search query behaviors.\n */\nexport interface BaseSearchRequestOptions<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> {\n /**\n * A value that specifies whether to fetch the total count of results. Default is false. Setting\n * this value to true may have a performance impact. Note that the count returned is an\n * approximation.\n */\n includeTotalCount?: boolean;\n /**\n * The list of facet expressions to apply to the search query. Each facet expression contains a\n * field name, optionally followed by a comma-separated list of name:value pairs.\n */\n facets?: string[];\n /**\n * The OData $filter expression to apply to the search query.\n */\n filter?: string;\n /**\n * The comma-separated list of field names to use for hit highlights. Only searchable fields can\n * be used for hit highlighting.\n */\n highlightFields?: string;\n /**\n * A string tag that is appended to hit highlights. Must be set with highlightPreTag. Default is\n * </em>.\n */\n highlightPostTag?: string;\n /**\n * A string tag that is prepended to hit highlights. Must be set with highlightPostTag. Default\n * is <em>.\n */\n highlightPreTag?: string;\n /**\n * A number between 0 and 100 indicating the percentage of the index that must be covered by a\n * search query in order for the query to be reported as a success. This parameter can be useful\n * for ensuring search availability even for services with only one replica. The default is 100.\n */\n minimumCoverage?: number;\n /**\n * The list of OData $orderby expressions by which to sort the results. Each\n * expression can be either a field name or a call to either the geo.distance() or the\n * search.score() functions. Each expression can be followed by asc to indicate ascending, or\n * desc to indicate descending. The default is ascending order. Ties will be broken by the match\n * scores of documents. If no $orderby is specified, the default sort order is descending by\n * document match score. There can be at most 32 $orderby clauses.\n */\n orderBy?: string[];\n /**\n * A value that specifies the syntax of the search query. The default is 'simple'. Use 'full' if\n * your query uses the Lucene query syntax. Possible values include: 'simple', 'full', 'semantic'\n */\n queryType?: QueryType;\n /**\n * The list of parameter values to be used in scoring functions (for example,\n * referencePointParameter) using the format name-values. For example, if the scoring profile\n * defines a function with a parameter called 'mylocation' the parameter string would be\n * \"mylocation--122.2,44.8\" (without the quotes).\n */\n scoringParameters?: string[];\n /**\n * The name of a scoring profile to evaluate match scores for matching documents in order to sort\n * the results.\n */\n scoringProfile?: string;\n /**\n * The comma-separated list of field names to which to scope the full-text search. When using\n * fielded search (fieldName:searchExpression) in a full Lucene query, the field names of each\n * fielded search expression take precedence over any field names listed in this parameter.\n */\n searchFields?: SearchFieldArray<TModel>;\n /**\n * The language of the query.\n */\n queryLanguage?: QueryLanguage;\n /**\n * Improve search recall by spell-correcting individual search query terms.\n */\n speller?: Speller;\n /**\n * A value that specifies whether any or all of the search terms must be matched in order to\n * count the document as a match. Possible values include: 'any', 'all'\n */\n searchMode?: SearchMode;\n /**\n * A value that specifies whether we want to calculate scoring statistics (such as document\n * frequency) globally for more consistent scoring, or locally, for lower latency. Possible\n * values include: 'Local', 'Global'\n */\n scoringStatistics?: ScoringStatistics;\n /**\n * A value to be used to create a sticky session, which can help to get more consistent results.\n * As long as the same sessionId is used, a best-effort attempt will be made to target the same\n * replica set. Be wary that reusing the same sessionID values repeatedly can interfere with the\n * load balancing of the requests across replicas and adversely affect the performance of the\n * search service. The value used as sessionId cannot start with a '_' character.\n */\n sessionId?: string;\n /**\n * The list of fields to retrieve. If unspecified, all fields marked as\n * retrievable in the schema are included.\n */\n select?: SelectArray<TFields>;\n /**\n * The number of search results to skip. This value cannot be greater than 100,000. If you need\n * to scan documents in sequence, but cannot use skip due to this limitation, consider using\n * orderby on a totally-ordered key and filter with a range query instead.\n */\n skip?: number;\n /**\n * The number of search results to retrieve. This can be used in conjunction with $skip to\n * implement client-side paging of search results. If results are truncated due to server-side\n * paging, the response will include a continuation token that can be used to issue another\n * Search request for the next page of results.\n */\n top?: number;\n /**\n * Defines options for vector search queries\n */\n vectorSearchOptions?: VectorSearchOptions<TModel>;\n\n /** The query parameters to configure hybrid search behaviors. */\n hybridSearch?: HybridSearch;\n}\n\n/**\n * Parameters for filtering, sorting, faceting, paging, and other search query behaviors.\n */\nexport type SearchRequestOptions<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> = BaseSearchRequestOptions<TModel, TFields> & SearchRequestQueryTypeOptions;\n\nexport type SearchRequestQueryTypeOptions =\n | {\n queryType: \"semantic\";\n /**\n * Defines options for semantic search queries\n */\n semanticSearchOptions: SemanticSearchOptions;\n }\n | { queryType?: \"simple\" | \"full\" };\n\n/**\n * Contains a document found by a search query, plus associated metadata.\n */\nexport type SearchResult<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> = {\n /**\n * The relevance score of the document compared to other documents returned by the query.\n * **NOTE: This property will not be serialized. It can only be populated by the server.**\n */\n readonly score: number;\n /**\n * The relevance score computed by the semantic ranker for the top search results. Search results are sorted by the RerankerScore first and then by the Score. RerankerScore is only returned for queries of type 'semantic'.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly rerankerScore?: number;\n /**\n * Text fragments from the document that indicate the matching search terms, organized by each\n * applicable field; null if hit highlighting was not enabled for the query.\n * **NOTE: This property will not be serialized. It can only be populated by the server.**\n */\n readonly highlights?: { [k in SelectFields<TModel>]?: string[] };\n /**\n * Captions are the most representative passages from the document relatively to the search query. They are often used as document summary. Captions are only returned for queries of type 'semantic'.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly captions?: QueryCaptionResult[];\n\n document: NarrowedModel<TModel, TFields>;\n\n /**\n * Contains debugging information that can be used to further explore your search results.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly documentDebugInfo?: DocumentDebugInfo[];\n};\n\n/**\n * Response containing search results from an index.\n */\nexport interface SearchDocumentsResultBase {\n /**\n * The total count of results found by the search operation, or null if the count was not\n * requested. If present, the count may be greater than the number of results in this response.\n * This can happen if you use the $top or $skip parameters, or if Azure Cognitive Search can't\n * return all the requested documents in a single Search response.\n * **NOTE: This property will not be serialized. It can only be populated by the server.**\n */\n readonly count?: number;\n /**\n * A value indicating the percentage of the index that was included in the query, or null if\n * minimumCoverage was not specified in the request.\n * **NOTE: This property will not be serialized. It can only be populated by the server.**\n */\n readonly coverage?: number;\n /**\n * The facet query results for the search operation, organized as a collection of buckets for\n * each faceted field; null if the query did not include any facet expressions.\n * **NOTE: This property will not be serialized. It can only be populated by the server.**\n */\n readonly facets?: { [propertyName: string]: FacetResult[] };\n /**\n * The answers query results for the search operation; null if the answers query parameter was\n * not specified or set to 'none'.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly answers?: QueryAnswerResult[];\n /**\n * Reason that a partial response was returned for a semantic search request.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly semanticErrorReason?: SemanticErrorReason;\n /**\n * Type of partial response that was returned for a semantic search request.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly semanticSearchResultsType?: SemanticSearchResultsType;\n}\n\n/**\n * Response containing search results from an index.\n */\nexport interface SearchDocumentsResult<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> extends SearchDocumentsResultBase {\n /**\n * The sequence of results returned by the query.\n * **NOTE: This property will not be serialized. It can only be populated by the server.**\n */\n readonly results: SearchIterator<TModel, TFields>;\n}\n\n/**\n * Response containing search page results from an index.\n */\nexport interface SearchDocumentsPageResult<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> extends SearchDocumentsResultBase {\n /**\n * The sequence of results returned by the query.\n * **NOTE: This property will not be serialized. It can only be populated by the server.**\n */\n readonly results: SearchResult<TModel, TFields>[];\n /**\n * A token used for retrieving the next page of results when the server\n * enforces pagination.\n */\n continuationToken?: string;\n}\n\n/**\n * Parameters for filtering, sorting, fuzzy matching, and other suggestions query behaviors.\n */\nexport interface SuggestRequest<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> {\n /**\n * An OData expression that filters the documents considered for suggestions.\n */\n filter?: string;\n /**\n * A value indicating whether to use fuzzy matching for the suggestion query. Default is false.\n * When set to true, the query will find suggestions even if there's a substituted or missing\n * character in the search text. While this provides a better experience in some scenarios, it\n * comes at a performance cost as fuzzy suggestion searches are slower and consume more\n * resources.\n */\n useFuzzyMatching?: boolean;\n /**\n * A string tag that is appended to hit highlights. Must be set with highlightPreTag. If omitted,\n * hit highlighting of suggestions is disabled.\n */\n highlightPostTag?: string;\n /**\n * A string tag that is prepended to hit highlights. Must be set with highlightPostTag. If\n * omitted, hit highlighting of suggestions is disabled.\n */\n highlightPreTag?: string;\n /**\n * A number between 0 and 100 indicating the percentage of the index that must be covered by a\n * suggestion query in order for the query to be reported as a success. This parameter can be\n * useful for ensuring search availability even for services with only one replica. The default\n * is 80.\n */\n minimumCoverage?: number;\n /**\n * The list of OData $orderby expressions by which to sort the results. Each\n * expression can be either a field name or a call to either the geo.distance() or the\n * search.score() functions. Each expression can be followed by asc to indicate ascending, or\n * desc to indicate descending. The default is ascending order. Ties will be broken by the match\n * scores of documents. If no $orderby is specified, the default sort order is descending by\n * document match score. There can be at most 32 $orderby clauses.\n */\n orderBy?: string[];\n /**\n * The comma-separated list of field names to search for the specified search text. Target fields\n * must be included in the specified suggester.\n */\n searchFields?: SearchFieldArray<TModel>;\n /**\n * The list of fields to retrieve. If unspecified, only the key field will be\n * included in the results.\n */\n select?: SelectArray<TFields>;\n /**\n /**\n * The number of suggestions to retrieve. This must be a value between 1 and 100. The default is\n * 5.\n */\n top?: number;\n}\n\n/**\n * A result containing a document found by a suggestion query, plus associated metadata.\n */\nexport type SuggestResult<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> = {\n /**\n * The text of the suggestion result.\n * **NOTE: This property will not be serialized. It can only be populated by the server.**\n */\n readonly text: string;\n document: SuggestNarrowedModel<TModel, TFields>;\n};\n\n/**\n * Response containing suggestion query results from an index.\n */\nexport interface SuggestDocumentsResult<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> {\n /**\n * The sequence of results returned by the query.\n * **NOTE: This property will not be serialized. It can only be populated by the server.**\n */\n readonly results: SuggestResult<TModel, TFields>[];\n /**\n * A value indicating the percentage of the index that was included in the query, or null if\n * minimumCoverage was not set in the request.\n * **NOTE: This property will not be serialized. It can only be populated by the server.**\n */\n readonly coverage?: number;\n}\n\n/**\n * Parameters for fuzzy matching, and other autocomplete query behaviors.\n */\nexport interface AutocompleteRequest<TModel extends object> {\n /**\n * Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms' to get shingles\n * and 'oneTermWithContext' to use the current context while producing auto-completed terms.\n * Possible values include: 'oneTerm', 'twoTerms', 'oneTermWithContext'\n */\n autocompleteMode?: AutocompleteMode;\n /**\n * An OData expression that filters the documents used to produce completed terms for the\n * Autocomplete result.\n */\n filter?: string;\n /**\n * A value indicating whether to use fuzzy matching for the autocomplete query. Default is false.\n * When set to true, the query will autocomplete terms even if there's a substituted or missing\n * character in the search text. While this provides a better experience in some scenarios, it\n * comes at a performance cost as fuzzy autocomplete queries are slower and consume more\n * resources.\n */\n useFuzzyMatching?: boolean;\n /**\n * A string tag that is appended to hit highlights. Must be set with highlightPreTag. If omitted,\n * hit highlighting is disabled.\n */\n highlightPostTag?: string;\n /**\n * A string tag that is prepended to hit highlights. Must be set with highlightPostTag. If\n * omitted, hit highlighting is disabled.\n */\n highlightPreTag?: string;\n /**\n * A number between 0 and 100 indicating the percentage of the index that must be covered by an\n * autocomplete query in order for the query to be reported as a success. This parameter can be\n * useful for ensuring search availability even for services with only one replica. The default\n * is 80.\n */\n minimumCoverage?: number;\n /**\n * The comma-separated list of field names to consider when querying for auto-completed terms.\n * Target fields must be included in the specified suggester.\n */\n searchFields?: SearchFieldArray<TModel>;\n /**\n * The number of auto-completed terms to retrieve. This must be a value between 1 and 100. The\n * default is 5.\n */\n top?: number;\n}\n\n/**\n * Represents an index action that operates on a document.\n */\nexport type IndexDocumentsAction<TModel> = {\n /**\n * The operation to perform on a document in an indexing batch. Possible values include:\n * 'upload', 'merge', 'mergeOrUpload', 'delete'\n */\n __actionType: IndexActionType;\n} & Partial<TModel>;\n\n// END manually modified generated interfaces\n\n// Utility types\n\n/**\n * If `TFields` is never, an untyped string array\n * Otherwise, a narrowed `Fields[]` type to be used elsewhere in the consuming type.\n */\nexport type SelectArray<TFields = never> = [string] extends [TFields]\n ? readonly TFields[]\n : (<T>() => T extends TFields ? true : false) extends <T>() => T extends never ? true : false\n ? readonly string[]\n : readonly TFields[];\n\n/**\n * If `TModel` is an untyped object, an untyped string array\n * Otherwise, the slash-delimited fields of `TModel`.\n */\nexport type SearchFieldArray<TModel extends object = object> =\n (<T>() => T extends TModel ? true : false) extends <T>() => T extends object ? true : false\n ? readonly string[]\n : readonly SelectFields<TModel>[];\n\nexport type UnionToIntersection<Union> =\n // Distribute members of U into parameter position of a union of functions\n (\n Union extends unknown ? (_: Union) => unknown : never\n ) extends // Infer the intersection of the members of U as a single intersected parameter type\n (_: infer I) => unknown\n ? I\n : never;\n\n// Types that should not be included in SelectFields recursion\nexport type ExcludedODataTypes = Date | GeographyPoint;\n\n/**\n * Produces a union of valid Cognitive Search OData $select paths for T\n * using a post-order traversal of the field tree rooted at T.\n */\nexport type SelectFields<TModel extends object> =\n // If T is never, any, or object, resolves to string\n (<T>() => T extends TModel ? true : false) extends <T>() => T extends never ? true : false\n ? string\n : (<T>() => T extends TModel ? true : false) extends <T>() => T extends any ? true : false\n ? string\n : (<T>() => T extends TModel ? true : false) extends <T>() => T extends object ? true : false\n ? string\n : // If T is an array, allow selecting from fields in the array's element type\n TModel extends Array<infer Elem>\n ? // Allow selecting fields only from elements which are objects\n Elem extends object\n ? SelectFields<Elem>\n : never\n : {\n // Only consider string keys\n [Key in keyof TModel]: Key extends string\n ? NonNullable<TModel[Key]> extends object\n ? NonNullable<TModel[Key]> extends ExcludedODataTypes\n ? // Excluded, so don't recur\n Key\n : // Extract subpaths from T[Key]\n SelectFields<NonNullable<TModel[Key]>> extends infer NextPaths\n ? // This check is required to avoid distributing `never` over the condition\n (<T>() => T extends NextPaths ? true : false) extends <\n T,\n >() => T extends never ? true : false\n ? Key\n : NextPaths extends string\n ? Key | `${Key}/${NextPaths}`\n : Key\n : never\n : // Not an object, so can't recur\n Key\n : never;\n }[keyof TModel & string] &\n // Filter out undefined properties\n string;\n\n/**\n * Deeply pick fields of T using valid Cognitive Search OData $select\n * paths.\n */\nexport type SearchPick<TModel extends object, TFields extends SelectFields<TModel>> =\n (<T>() => T extends TModel ? true : false) extends <T>() => T extends object ? true : false\n ? // Picking from an untyped object should return `object`\n TModel\n : // If paths is any or never, yield the original type\n (<T>() => T extends TFields ? true : false) extends <T>() => T extends any ? true : false\n ? TModel\n : (<T>() => T extends TFields ? true : false) extends <T>() => T extends never ? true : false\n ? TModel\n : // We're going to get a union of individual interfaces for each field in T that's selected, so convert that to an intersection.\n UnionToIntersection<\n // Paths is a union or single string type, so if it's a union it will be _distributed_ over this conditional.\n // Fortunately, template literal types are not greedy, so we can infer the field name easily.\n TFields extends `${infer FieldName}/${infer RestPaths}`\n ? // Symbols and numbers are invalid types for field names\n FieldName extends keyof TModel & string\n ? NonNullable<TModel[FieldName]> extends Array<infer Elem>\n ? Elem extends object\n ? // Extends clause is necessary to refine the constraint of RestPaths\n RestPaths extends SelectFields<Elem>\n ? // Narrow the type of every element in the array\n {\n [Key in keyof TModel as Key & FieldName]: Array<\n SearchPick<Elem, RestPaths>\n >;\n }\n : // Unreachable by construction\n never\n : // Don't recur on arrays of non-object types\n never\n : NonNullable<TModel[FieldName]> extends object\n ? // Recur :)\n {\n [Key in keyof TModel as Key & FieldName]: RestPaths extends SelectFields<\n TModel[Key] & {\n // This empty intersection fixes `T[Key]` not being narrowed to an object type in older versions of TS\n }\n >\n ?\n | SearchPick<\n TModel[Key] & {\n // Ditto\n },\n RestPaths\n >\n | Extract<TModel[Key], null>\n : // Unreachable by construction\n never;\n }\n : // Unreachable by construction\n never\n : // Ignore symbols and numbers\n never\n : // Otherwise, capture the paths that are simple keys of T itself\n TFields extends keyof TModel\n ? Pick<TModel, TFields> | Extract<TModel, null>\n : never\n > & {\n // This useless intersection actually prevents the TypeScript language server from\n // expanding the definition of SearchPick<TModel, Paths> in IntelliSense. Since we're\n // sure the type always yields an object, this intersection does not alter the type\n // at all, only the display string of the type.\n };\n\nexport type ExtractDocumentKey<TModel> = {\n [K in keyof TModel as TModel[K] extends string | undefined ? K : never]: TModel[K];\n};\n\n/**\n * Narrows the Model type to include only the selected Fields\n */\nexport type NarrowedModel<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> =\n // If the model isn't specified, the type is the same as the input type\n (<T>() => T extends TModel ? true : false) extends <T>() => T extends never ? true : false\n ? TModel\n : (<T>() => T extends TModel ? true : false) extends <T>() => T extends object ? true : false\n ? TModel\n : (<T>() => T extends TModel ? true : false) extends <T>() => T extends any ? true : false\n ? TModel\n : (<T>() => T extends TModel ? true : false) extends <T>() => T extends unknown\n ? true\n : false\n ? TModel\n : (<T>() => T extends TFields ? true : false) extends <T>() => T extends never\n ? true\n : false\n ? // If fields aren't specified, this object can't exist\n never\n : (<T>() => T extends TFields ? true : false) extends <\n T,\n >() => T extends SelectFields<TModel> ? true : false\n ? // Avoid calculating the narrowed type if every field is specified\n TModel\n : SearchPick<TModel, TFields>;\n\nexport type SuggestNarrowedModel<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> =\n (<T>() => T extends TModel ? true : false) extends <T>() => T extends never ? true : false\n ? TModel\n : (<T>() => T extends TModel ? true : false) extends <T>() => T extends object ? true : false\n ? TModel\n : (<T>() => T extends TFields ? true : false) extends <T>() => T extends never ? true : false\n ? // Filter nullable (i.e. non-key) properties from the model, as they're not returned by the\n // service by default\n keyof ExtractDocumentKey<TModel> extends never\n ? // Return the original model if none of the properties are non-nullable\n TModel\n : ExtractDocumentKey<TModel>\n : // TFields isn't narrowed to exclude null by the first condition, so it needs to be narrowed\n // here\n TFields extends SelectFields<TModel>\n ? NarrowedModel<TModel, TFields>\n : // Unreachable by construction\n never;\n\n/** Description of fields that were sent to the semantic enrichment process, as well as how they were used */\nexport interface QueryResultDocumentSemanticField {\n /**\n * The name of the field that was sent to the semantic enrichment process\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly name?: string;\n /**\n * The way the field was used for the semantic enrichment process (fully used, partially used, or unused)\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly state?: SemanticFieldState;\n}\n\n/** Contains debugging information that can be used to further explore your search results. */\nexport interface DocumentDebugInfo {\n /**\n * Contains debugging information specific to semantic search queries.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly semantic?: SemanticDebugInfo;\n /**\n * Contains debugging information specific to vector and hybrid search.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly vectors?: VectorsDebugInfo;\n}\n\n/**\n * Debug options for semantic search queries.\n */\nexport interface SemanticDebugInfo {\n /**\n * The title field that was sent to the semantic enrichment process, as well as how it was used\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly titleField?: QueryResultDocumentSemanticField;\n /**\n * The content fields that were sent to the semantic enrichment process, as well as how they were used\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly contentFields?: QueryResultDocumentSemanticField[];\n /**\n * The keyword fields that were sent to the semantic enrichment process, as well as how they were used\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly keywordFields?: QueryResultDocumentSemanticField[];\n /**\n * The raw concatenated strings that were sent to the semantic enrichment process.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly rerankerInput?: QueryResultDocumentRerankerInput;\n}\n\n/**\n * Extracts answer candidates from the contents of the documents returned in response to a query\n * expressed as a question in natural language.\n */\nexport interface ExtractiveQueryAnswer {\n answerType: \"extractive\";\n /**\n * The number of answers returned. Default count is 1\n */\n count?: number;\n /**\n * The confidence threshold. Default threshold is 0.7\n */\n threshold?: number;\n}\n\n/**\n * A value that specifies whether answers should be returned as part of the search response.\n * This parameter is only valid if the query type is 'semantic'. If set to `extractive`, the query\n * returns answers extracted from key passages in the highest ranked documents.\n */\nexport type QueryAnswer = ExtractiveQueryAnswer;\n\n/** Extracts captions from the matching documents that contain passages relevant to the search query. */\nexport interface ExtractiveQueryCaption {\n captionType: \"extractive\";\n highlight?: boolean;\n}\n\n/**\n * A value that specifies whether captions should be returned as part of the search response.\n * This parameter is only valid if the query type is 'semantic'. If set, the query returns captions\n * extracted from key passages in the highest ranked documents. When Captions is 'extractive',\n * highlighting is enabled by default. Defaults to 'none'.\n */\nexport type QueryCaption = ExtractiveQueryCaption;\n\n/**\n * Defines options for semantic search queries\n */\nexport interface SemanticSearchOptions {\n /**\n * The name of a semantic configuration that will be used when processing documents for queries of\n * type semantic.\n */\n configurationName?: string;\n /**\n * Allows the user to choose whether a semantic call should fail completely, or to return partial\n * results (default).\n */\n errorMode?: SemanticErrorMode;\n /**\n * Allows the user to set an upper bound on the amount of time it takes for semantic enrichment\n * to finish processing before the request fails.\n */\n maxWaitInMilliseconds?: number;\n /**\n * If set, the query returns answers extracted from key passages in the highest ranked documents.\n */\n answers?: QueryAnswer;\n /**\n * If set, the query returns captions extracted from key passages in the highest ranked\n * documents. When Captions is set to 'extractive', highlighting is enabled by default. Defaults\n * to 'None'.\n */\n captions?: QueryCaption;\n /**\n * Allows setting a separate search query that will be solely used for semantic reranking,\n * semantic captions and semantic answers. Is useful for scenarios where there is a need to use\n * different queries between the base retrieval and ranking phase, and the L2 semantic phase.\n */\n semanticQuery?: string;\n /**\n * The list of field names used for semantic search.\n */\n semanticFields?: string[];\n /**\n * Enables a debugging tool that can be used to further explore your search results.\n */\n debugMode?: QueryDebugMode;\n}\n\n/**\n * Defines options for vector search queries\n */\nexport interface VectorSearchOptions<TModel extends object> {\n /**\n * The query parameters for vector, hybrid, and multi-vector search queries.\n */\n queries: VectorQuery<TModel>[];\n /**\n * Determines whether or not filters are applied before or after the vector search is performed.\n * Default is 'preFilter'.\n */\n filterMode?: VectorFilterMode;\n}\n/** The threshold used for vector queries. */\nexport interface BaseVectorThreshold {\n /** Polymorphic discriminator, which specifies the different types this object can be */\n kind: \"vectorSimilarity\" | \"searchScore\";\n}\n\n/** The results of the vector query will be filtered based on the vector similarity metric. Note this is the canonical definition of similarity metric, not the 'distance' version. The threshold direction (larger or smaller) will be chosen automatically according to the metric used by the field. */\nexport interface VectorSimilarityThreshold extends BaseVectorThreshold {\n /** Polymorphic discriminator, which specifies the different types this object can be */\n kind: \"vectorSimilarity\";\n /** The threshold will filter based on the similarity metric value. Note this is the canonical definition of similarity metric, not the 'distance' version. The threshold direction (larger or smaller) will be chosen automatically according to the metric used by the field. */\n value: number;\n}\n\n/** The results of the vector query will filter based on the '\\@search.score' value. Note this is the \\@search.score returned as part of the search response. The threshold direction will be chosen for higher \\@search.score. */\nexport interface SearchScoreThreshold extends BaseVectorThreshold {\n /** Polymorphic discriminator, which specifies the different types this object can be */\n kind: \"searchScore\";\n /** The threshold will filter based on the '\\@search.score' value. Note this is the \\@search.score returned as part of the search response. The threshold direction will be chosen for higher \\@search.score. */\n value: number;\n}\n\n/** The threshold used for vector queries. */\nexport type VectorThreshold = VectorSimilarityThreshold | SearchScoreThreshold;\nexport type SemanticErrorMode = `${KnownSemanticErrorMode}`;\nexport type SemanticErrorReason = `${KnownSemanticErrorReason}`;\nexport type SemanticSearchResultsType = `${KnownSemanticSearchResultsType}`;\nexport type VectorFilterMode = `${KnownVectorFilterMode}`;\nexport type VectorQueryKind = `${KnownVectorQueryKind}`;\n"]}
|
|
1
|
+
{"version":3,"file":"indexModels.js","sourceRoot":"","sources":["../../src/indexModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { OperationOptions } from \"@azure/core-client\";\nimport type { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport type {\n AutocompleteMode,\n DebugInfo,\n FacetResult,\n HybridSearch,\n IndexActionType,\n KnownSemanticErrorMode,\n KnownSemanticErrorReason,\n KnownSemanticSearchResultsType,\n KnownVectorFilterMode,\n KnownVectorQueryKind,\n QueryAnswerResult,\n QueryCaptionResult,\n QueryDebugMode,\n QueryLanguage,\n QueryResultDocumentRerankerInput,\n QuerySpellerType as QuerySpeller,\n QueryType,\n ScoringStatistics,\n SearchMode,\n SemanticFieldState,\n SemanticQueryRewritesResultType,\n VectorsDebugInfo,\n} from \"./generated/data/models\";\nimport type GeographyPoint from \"./geographyPoint\";\n\n/**\n * Options for performing the count operation on the index.\n */\nexport type CountDocumentsOptions = OperationOptions;\n\n/**\n * Options for SearchIndexingBufferedSender.\n */\nexport interface SearchIndexingBufferedSenderOptions {\n /**\n * Indicates if autoFlush is enabled.\n */\n autoFlush?: boolean;\n /**\n * Initial Batch Action Count.\n *\n * A batch request will be sent once the documents\n * reach the initialBatchActionCount.\n */\n initialBatchActionCount?: number;\n /**\n * Flush Window.\n *\n * A batch request will be sent after flushWindowInMs is\n * reached.\n */\n flushWindowInMs?: number;\n /**\n * Maximum number of Retries\n */\n maxRetriesPerAction?: number;\n /**\n * Delay between retries\n */\n throttlingDelayInMs?: number;\n /**\n * Max Delay between retries\n */\n maxThrottlingDelayInMs?: number;\n}\n\n/**\n * Options for SearchIndexingBufferedSenderUploadDocuments.\n */\nexport type SearchIndexingBufferedSenderUploadDocumentsOptions = OperationOptions;\n/**\n * Options for SearchIndexingBufferedSenderMergeDocuments.\n */\nexport type SearchIndexingBufferedSenderMergeDocumentsOptions = OperationOptions;\n/**\n * Options for SearchIndexingBufferedSenderMergeOrUploadDocuments.\n */\nexport type SearchIndexingBufferedSenderMergeOrUploadDocumentsOptions = OperationOptions;\n/**\n * Options for SearchIndexingBufferedSenderDeleteDocuments.\n */\nexport type SearchIndexingBufferedSenderDeleteDocumentsOptions = OperationOptions;\n/**\n * Options for SearchIndexingBufferedSenderFlushDocuments.\n */\nexport type SearchIndexingBufferedSenderFlushDocumentsOptions = OperationOptions;\n\n/**\n * Options for retrieving a single document.\n */\nexport interface GetDocumentOptions<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> extends OperationOptions {\n /**\n * List of field names to retrieve for the document; Any field not retrieved will be missing from\n * the returned document.\n */\n selectedFields?: SelectArray<TFields>;\n}\n\n/**\n * Options for the modify index batch operation.\n */\nexport interface IndexDocumentsOptions extends OperationOptions {\n /**\n * If true, will cause this operation to throw if any document operation\n * in the batch did not succeed.\n */\n throwOnAnyFailure?: boolean;\n}\n\n/**\n * Options for the upload documents operation.\n */\nexport type UploadDocumentsOptions = IndexDocumentsOptions;\n\n/**\n * Options for the merge documents operation.\n */\nexport type MergeDocumentsOptions = IndexDocumentsOptions;\n\n/**\n * Options for the merge or upload documents operation.\n */\nexport type MergeOrUploadDocumentsOptions = IndexDocumentsOptions;\n\n/**\n * Options for the delete documents operation.\n */\nexport type DeleteDocumentsOptions = IndexDocumentsOptions;\n\n/**\n * Arguments for retrieving the next page of search results.\n */\nexport interface ListSearchResultsPageSettings {\n /**\n * A token used for retrieving the next page of results when the server\n * enforces pagination.\n */\n continuationToken?: string;\n}\n\n// BEGIN manually modified generated interfaces\n//\n// This section is for places where we have to manually fix issues\n// with interfaces from the generated code.\n// Mostly this is to allow modeling additionalProperties:true as generics.\n\n/**\n * Options for retrieving completion text for a partial searchText.\n */\nexport type AutocompleteOptions<TModel extends object> = OperationOptions &\n AutocompleteRequest<TModel>;\n/**\n * Options for committing a full search request.\n */\nexport type SearchOptions<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> = OperationOptions & SearchRequestOptions<TModel, TFields>;\n/**\n * Options for retrieving suggestions based on the searchText.\n */\nexport type SuggestOptions<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> = OperationOptions & SuggestRequest<TModel, TFields>;\n\n/**\n * An iterator for search results of a paticular query. Will make requests\n * as needed during iteration. Use .byPage() to make one request to the server\n * per iteration.\n */\nexport type SearchIterator<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> = PagedAsyncIterableIterator<\n SearchResult<TModel, TFields>,\n SearchDocumentsPageResult<TModel, TFields>,\n ListSearchResultsPageSettings\n>;\n\n/** The query parameters for vector and hybrid search queries. */\nexport type VectorQuery<TModel extends object> =\n | VectorizedQuery<TModel>\n | VectorizableTextQuery<TModel>\n | VectorizableImageUrlQuery<TModel>\n | VectorizableImageBinaryQuery<TModel>;\n\n/** The query parameters for vector and hybrid search queries. */\nexport interface BaseVectorQuery<TModel extends object> {\n /**\n * ### Known values supported by the service\n * **vector**: Vector query where a raw vector value is provided.\n * **text**: Vector query where a text value that needs to be vectorized is provided.\n * **imageUrl**: Vector query where an url that represents an image value that needs to be vectorized is provided.\n * **imageBinary**: Vector query where a base 64 encoded binary of an image that needs to be vectorized is provided.\n */\n kind: VectorQueryKind;\n /** Number of nearest neighbors to return as top hits. */\n kNearestNeighborsCount?: number;\n /** Vector Fields of type Collection(Edm.Single) to be included in the vector searched. */\n fields?: SearchFieldArray<TModel>;\n /**\n * When true, triggers an exhaustive k-nearest neighbor search across all vectors within the\n * vector index. Useful for scenarios where exact matches are critical, such as determining ground\n * truth values.\n */\n exhaustive?: boolean;\n /**\n * Oversampling factor. Minimum value is 1. It overrides the 'defaultOversampling' parameter\n * configured in the index definition. It can be set only when 'rerankWithOriginalVectors' is\n * true. This parameter is only permitted when a compression method is used on the underlying\n * vector field.\n */\n oversampling?: number;\n /** Relative weight of the vector query when compared to other vector query and/or the text query within the same search request. This value is used when combining the results of multiple ranking lists produced by the different vector queries and/or the results retrieved through the text query. The higher the weight, the higher the documents that matched that query will be in the final ranking. Default is 1.0 and the value needs to be a positive number larger than zero. */\n weight?: number;\n /** The threshold used for vector queries. Note this can only be set if all 'fields' use the same similarity metric. */\n threshold?: VectorThreshold;\n /** The OData filter expression to apply to this specific vector query. If no filter expression is defined at the vector level, the expression defined in\n * the top level filter parameter is used instead. */\n filterOverride?: string;\n}\n\n/** The query parameters to use for vector search when a raw vector value is provided. */\nexport interface VectorizedQuery<TModel extends object> extends BaseVectorQuery<TModel> {\n /** Polymorphic discriminator, which specifies the different types this object can be */\n kind: \"vector\";\n /** The vector representation of a search query. */\n vector: number[];\n}\n\n/** The query parameters to use for vector search when a text value that needs to be vectorized is provided. */\nexport interface VectorizableTextQuery<TModel extends object> extends BaseVectorQuery<TModel> {\n /** Polymorphic discriminator, which specifies the different types this object can be */\n kind: \"text\";\n /** The text to be vectorized to perform a vector search query. */\n text: string;\n /**\n * Can be configured to let a generative model rewrite the query before sending it to be\n * vectorized.\n */\n queryRewrites?: QueryRewrites;\n}\n\n/** The query parameters to use for vector search when an url that represents an image value that needs to be vectorized is provided. */\nexport interface VectorizableImageUrlQuery<TModel extends object> extends BaseVectorQuery<TModel> {\n /** Polymorphic discriminator, which specifies the different types this object can be */\n kind: \"imageUrl\";\n /** The URL of an image to be vectorized to perform a vector search query. */\n url: string;\n}\n\n/** The query parameters to use for vector search when a base 64 encoded binary of an image that needs to be vectorized is provided. */\nexport interface VectorizableImageBinaryQuery<TModel extends object>\n extends BaseVectorQuery<TModel> {\n /** Polymorphic discriminator, which specifies the different types this object can be */\n kind: \"imageBinary\";\n /** The base64 encoded binary of an image to be vectorized to perform a vector search query. */\n binaryImage: string;\n}\n\n/**\n * Parameters for filtering, sorting, faceting, paging, and other search query behaviors.\n */\nexport interface BaseSearchRequestOptions<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> {\n /**\n * A value that specifies whether to fetch the total count of results. Default is false. Setting\n * this value to true may have a performance impact. Note that the count returned is an\n * approximation.\n */\n includeTotalCount?: boolean;\n /**\n * The list of facet expressions to apply to the search query. Each facet expression contains a\n * field name, optionally followed by a comma-separated list of name:value pairs.\n */\n facets?: string[];\n /**\n * The OData $filter expression to apply to the search query.\n */\n filter?: string;\n /**\n * The comma-separated list of field names to use for hit highlights. Only searchable fields can\n * be used for hit highlighting.\n */\n highlightFields?: string;\n /**\n * A string tag that is appended to hit highlights. Must be set with highlightPreTag. Default is\n * </em>.\n */\n highlightPostTag?: string;\n /**\n * A string tag that is prepended to hit highlights. Must be set with highlightPostTag. Default\n * is <em>.\n */\n highlightPreTag?: string;\n /**\n * A number between 0 and 100 indicating the percentage of the index that must be covered by a\n * search query in order for the query to be reported as a success. This parameter can be useful\n * for ensuring search availability even for services with only one replica. The default is 100.\n */\n minimumCoverage?: number;\n /**\n * The list of OData $orderby expressions by which to sort the results. Each\n * expression can be either a field name or a call to either the geo.distance() or the\n * search.score() functions. Each expression can be followed by asc to indicate ascending, or\n * desc to indicate descending. The default is ascending order. Ties will be broken by the match\n * scores of documents. If no $orderby is specified, the default sort order is descending by\n * document match score. There can be at most 32 $orderby clauses.\n */\n orderBy?: string[];\n /**\n * A value that specifies the syntax of the search query. The default is 'simple'. Use 'full' if\n * your query uses the Lucene query syntax. Possible values include: 'simple', 'full', 'semantic'\n */\n queryType?: QueryType;\n /**\n * The list of parameter values to be used in scoring functions (for example,\n * referencePointParameter) using the format name-values. For example, if the scoring profile\n * defines a function with a parameter called 'mylocation' the parameter string would be\n * \"mylocation--122.2,44.8\" (without the quotes).\n */\n scoringParameters?: string[];\n /**\n * The name of a scoring profile to evaluate match scores for matching documents in order to sort\n * the results.\n */\n scoringProfile?: string;\n /**\n * The comma-separated list of field names to which to scope the full-text search. When using\n * fielded search (fieldName:searchExpression) in a full Lucene query, the field names of each\n * fielded search expression take precedence over any field names listed in this parameter.\n */\n searchFields?: SearchFieldArray<TModel>;\n /**\n * The language of the query.\n */\n queryLanguage?: QueryLanguage;\n /**\n * Improve search recall by spell-correcting individual search query terms.\n */\n speller?: QuerySpeller;\n /**\n * A value that specifies whether any or all of the search terms must be matched in order to\n * count the document as a match. Possible values include: 'any', 'all'\n */\n searchMode?: SearchMode;\n /**\n * A value that specifies whether we want to calculate scoring statistics (such as document\n * frequency) globally for more consistent scoring, or locally, for lower latency. Possible\n * values include: 'Local', 'Global'\n */\n scoringStatistics?: ScoringStatistics;\n /**\n * A value to be used to create a sticky session, which can help to get more consistent results.\n * As long as the same sessionId is used, a best-effort attempt will be made to target the same\n * replica set. Be wary that reusing the same sessionID values repeatedly can interfere with the\n * load balancing of the requests across replicas and adversely affect the performance of the\n * search service. The value used as sessionId cannot start with a '_' character.\n */\n sessionId?: string;\n /**\n * The list of fields to retrieve. If unspecified, all fields marked as\n * retrievable in the schema are included.\n */\n select?: SelectArray<TFields>;\n /**\n * The number of search results to skip. This value cannot be greater than 100,000. If you need\n * to scan documents in sequence, but cannot use skip due to this limitation, consider using\n * orderby on a totally-ordered key and filter with a range query instead.\n */\n skip?: number;\n /**\n * The number of search results to retrieve. This can be used in conjunction with $skip to\n * implement client-side paging of search results. If results are truncated due to server-side\n * paging, the response will include a continuation token that can be used to issue another\n * Search request for the next page of results.\n */\n top?: number;\n /**\n * Defines options for vector search queries\n */\n vectorSearchOptions?: VectorSearchOptions<TModel>;\n\n /** The query parameters to configure hybrid search behaviors. */\n hybridSearch?: HybridSearch;\n}\n\n/**\n * Parameters for filtering, sorting, faceting, paging, and other search query behaviors.\n */\nexport type SearchRequestOptions<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> = BaseSearchRequestOptions<TModel, TFields> & SearchRequestQueryTypeOptions;\n\nexport type SearchRequestQueryTypeOptions =\n | {\n queryType: \"semantic\";\n /**\n * Defines options for semantic search queries\n */\n semanticSearchOptions: SemanticSearchOptions;\n }\n | { queryType?: \"simple\" | \"full\" };\n\n/**\n * Contains a document found by a search query, plus associated metadata.\n */\nexport type SearchResult<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> = {\n /**\n * The relevance score of the document compared to other documents returned by the query.\n * **NOTE: This property will not be serialized. It can only be populated by the server.**\n */\n readonly score: number;\n /**\n * The relevance score computed by the semantic ranker for the top search results. Search results are sorted by the RerankerScore first and then by the Score. RerankerScore is only returned for queries of type 'semantic'.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly rerankerScore?: number;\n /**\n * Text fragments from the document that indicate the matching search terms, organized by each\n * applicable field; null if hit highlighting was not enabled for the query.\n * **NOTE: This property will not be serialized. It can only be populated by the server.**\n */\n readonly highlights?: { [k in SelectFields<TModel>]?: string[] };\n /**\n * Captions are the most representative passages from the document relatively to the search query. They are often used as document summary. Captions are only returned for queries of type 'semantic'.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly captions?: QueryCaptionResult[];\n\n document: NarrowedModel<TModel, TFields>;\n\n /**\n * Contains debugging information that can be used to further explore your search results.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly documentDebugInfo?: DocumentDebugInfo;\n};\n\n/**\n * Response containing search results from an index.\n */\nexport interface SearchDocumentsResultBase {\n /**\n * The total count of results found by the search operation, or null if the count was not\n * requested. If present, the count may be greater than the number of results in this response.\n * This can happen if you use the $top or $skip parameters, or if Azure Cognitive Search can't\n * return all the requested documents in a single Search response.\n * **NOTE: This property will not be serialized. It can only be populated by the server.**\n */\n readonly count?: number;\n /**\n * A value indicating the percentage of the index that was included in the query, or null if\n * minimumCoverage was not specified in the request.\n * **NOTE: This property will not be serialized. It can only be populated by the server.**\n */\n readonly coverage?: number;\n /**\n * The facet query results for the search operation, organized as a collection of buckets for\n * each faceted field; null if the query did not include any facet expressions.\n * **NOTE: This property will not be serialized. It can only be populated by the server.**\n */\n readonly facets?: { [propertyName: string]: FacetResult[] };\n /**\n * The answers query results for the search operation; null if the answers query parameter was\n * not specified or set to 'none'.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly answers?: QueryAnswerResult[];\n /**\n * Debug information that applies to the search results as a whole.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly debugInfo?: DebugInfo;\n /**\n * Reason that a partial response was returned for a semantic search request.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly semanticErrorReason?: SemanticErrorReason;\n /**\n * Type of partial response that was returned for a semantic search request.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly semanticSearchResultsType?: SemanticSearchResultsType;\n /**\n * Type of query rewrite that was used to retrieve documents.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly semanticQueryRewritesResultType?: SemanticQueryRewritesResultType;\n}\n\n/**\n * Response containing search results from an index.\n */\nexport interface SearchDocumentsResult<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> extends SearchDocumentsResultBase {\n /**\n * The sequence of results returned by the query.\n * **NOTE: This property will not be serialized. It can only be populated by the server.**\n */\n readonly results: SearchIterator<TModel, TFields>;\n}\n\n/**\n * Response containing search page results from an index.\n */\nexport interface SearchDocumentsPageResult<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> extends SearchDocumentsResultBase {\n /**\n * The sequence of results returned by the query.\n * **NOTE: This property will not be serialized. It can only be populated by the server.**\n */\n readonly results: SearchResult<TModel, TFields>[];\n /**\n * A token used for retrieving the next page of results when the server\n * enforces pagination.\n */\n continuationToken?: string;\n}\n\n/**\n * Parameters for filtering, sorting, fuzzy matching, and other suggestions query behaviors.\n */\nexport interface SuggestRequest<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> {\n /**\n * An OData expression that filters the documents considered for suggestions.\n */\n filter?: string;\n /**\n * A value indicating whether to use fuzzy matching for the suggestion query. Default is false.\n * When set to true, the query will find suggestions even if there's a substituted or missing\n * character in the search text. While this provides a better experience in some scenarios, it\n * comes at a performance cost as fuzzy suggestion searches are slower and consume more\n * resources.\n */\n useFuzzyMatching?: boolean;\n /**\n * A string tag that is appended to hit highlights. Must be set with highlightPreTag. If omitted,\n * hit highlighting of suggestions is disabled.\n */\n highlightPostTag?: string;\n /**\n * A string tag that is prepended to hit highlights. Must be set with highlightPostTag. If\n * omitted, hit highlighting of suggestions is disabled.\n */\n highlightPreTag?: string;\n /**\n * A number between 0 and 100 indicating the percentage of the index that must be covered by a\n * suggestion query in order for the query to be reported as a success. This parameter can be\n * useful for ensuring search availability even for services with only one replica. The default\n * is 80.\n */\n minimumCoverage?: number;\n /**\n * The list of OData $orderby expressions by which to sort the results. Each\n * expression can be either a field name or a call to either the geo.distance() or the\n * search.score() functions. Each expression can be followed by asc to indicate ascending, or\n * desc to indicate descending. The default is ascending order. Ties will be broken by the match\n * scores of documents. If no $orderby is specified, the default sort order is descending by\n * document match score. There can be at most 32 $orderby clauses.\n */\n orderBy?: string[];\n /**\n * The comma-separated list of field names to search for the specified search text. Target fields\n * must be included in the specified suggester.\n */\n searchFields?: SearchFieldArray<TModel>;\n /**\n * The list of fields to retrieve. If unspecified, only the key field will be\n * included in the results.\n */\n select?: SelectArray<TFields>;\n /**\n /**\n * The number of suggestions to retrieve. This must be a value between 1 and 100. The default is\n * 5.\n */\n top?: number;\n}\n\n/**\n * A result containing a document found by a suggestion query, plus associated metadata.\n */\nexport type SuggestResult<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> = {\n /**\n * The text of the suggestion result.\n * **NOTE: This property will not be serialized. It can only be populated by the server.**\n */\n readonly text: string;\n document: SuggestNarrowedModel<TModel, TFields>;\n};\n\n/**\n * Response containing suggestion query results from an index.\n */\nexport interface SuggestDocumentsResult<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> {\n /**\n * The sequence of results returned by the query.\n * **NOTE: This property will not be serialized. It can only be populated by the server.**\n */\n readonly results: SuggestResult<TModel, TFields>[];\n /**\n * A value indicating the percentage of the index that was included in the query, or null if\n * minimumCoverage was not set in the request.\n * **NOTE: This property will not be serialized. It can only be populated by the server.**\n */\n readonly coverage?: number;\n}\n\n/**\n * Parameters for fuzzy matching, and other autocomplete query behaviors.\n */\nexport interface AutocompleteRequest<TModel extends object> {\n /**\n * Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms' to get shingles\n * and 'oneTermWithContext' to use the current context while producing auto-completed terms.\n * Possible values include: 'oneTerm', 'twoTerms', 'oneTermWithContext'\n */\n autocompleteMode?: AutocompleteMode;\n /**\n * An OData expression that filters the documents used to produce completed terms for the\n * Autocomplete result.\n */\n filter?: string;\n /**\n * A value indicating whether to use fuzzy matching for the autocomplete query. Default is false.\n * When set to true, the query will autocomplete terms even if there's a substituted or missing\n * character in the search text. While this provides a better experience in some scenarios, it\n * comes at a performance cost as fuzzy autocomplete queries are slower and consume more\n * resources.\n */\n useFuzzyMatching?: boolean;\n /**\n * A string tag that is appended to hit highlights. Must be set with highlightPreTag. If omitted,\n * hit highlighting is disabled.\n */\n highlightPostTag?: string;\n /**\n * A string tag that is prepended to hit highlights. Must be set with highlightPostTag. If\n * omitted, hit highlighting is disabled.\n */\n highlightPreTag?: string;\n /**\n * A number between 0 and 100 indicating the percentage of the index that must be covered by an\n * autocomplete query in order for the query to be reported as a success. This parameter can be\n * useful for ensuring search availability even for services with only one replica. The default\n * is 80.\n */\n minimumCoverage?: number;\n /**\n * The comma-separated list of field names to consider when querying for auto-completed terms.\n * Target fields must be included in the specified suggester.\n */\n searchFields?: SearchFieldArray<TModel>;\n /**\n * The number of auto-completed terms to retrieve. This must be a value between 1 and 100. The\n * default is 5.\n */\n top?: number;\n}\n\n/**\n * Represents an index action that operates on a document.\n */\nexport type IndexDocumentsAction<TModel> = {\n /**\n * The operation to perform on a document in an indexing batch. Possible values include:\n * 'upload', 'merge', 'mergeOrUpload', 'delete'\n */\n __actionType: IndexActionType;\n} & Partial<TModel>;\n\n// END manually modified generated interfaces\n\n// Utility types\n\n/**\n * If `TFields` is never, an untyped string array\n * Otherwise, a narrowed `Fields[]` type to be used elsewhere in the consuming type.\n */\nexport type SelectArray<TFields = never> = [string] extends [TFields]\n ? readonly TFields[]\n : (<T>() => T extends TFields ? true : false) extends <T>() => T extends never ? true : false\n ? readonly string[]\n : readonly TFields[];\n\n/**\n * If `TModel` is an untyped object, an untyped string array\n * Otherwise, the slash-delimited fields of `TModel`.\n */\nexport type SearchFieldArray<TModel extends object = object> =\n (<T>() => T extends TModel ? true : false) extends <T>() => T extends object ? true : false\n ? readonly string[]\n : readonly SelectFields<TModel>[];\n\nexport type UnionToIntersection<Union> =\n // Distribute members of U into parameter position of a union of functions\n (\n Union extends unknown ? (_: Union) => unknown : never\n ) extends // Infer the intersection of the members of U as a single intersected parameter type\n (_: infer I) => unknown\n ? I\n : never;\n\n// Types that should not be included in SelectFields recursion\nexport type ExcludedODataTypes = Date | GeographyPoint;\n\n/**\n * Produces a union of valid Cognitive Search OData $select paths for T\n * using a post-order traversal of the field tree rooted at T.\n */\nexport type SelectFields<TModel extends object> =\n // If T is never, any, or object, resolves to string\n (<T>() => T extends TModel ? true : false) extends <T>() => T extends never ? true : false\n ? string\n : (<T>() => T extends TModel ? true : false) extends <T>() => T extends any ? true : false\n ? string\n : (<T>() => T extends TModel ? true : false) extends <T>() => T extends object ? true : false\n ? string\n : // If T is an array, allow selecting from fields in the array's element type\n TModel extends Array<infer Elem>\n ? // Allow selecting fields only from elements which are objects\n Elem extends object\n ? SelectFields<Elem>\n : never\n : {\n // Only consider string keys\n [Key in keyof TModel]: Key extends string\n ? NonNullable<TModel[Key]> extends object\n ? NonNullable<TModel[Key]> extends ExcludedODataTypes\n ? // Excluded, so don't recur\n Key\n : // Extract subpaths from T[Key]\n SelectFields<NonNullable<TModel[Key]>> extends infer NextPaths\n ? // This check is required to avoid distributing `never` over the condition\n (<T>() => T extends NextPaths ? true : false) extends <\n T,\n >() => T extends never ? true : false\n ? Key\n : NextPaths extends string\n ? Key | `${Key}/${NextPaths}`\n : Key\n : never\n : // Not an object, so can't recur\n Key\n : never;\n }[keyof TModel & string] &\n // Filter out undefined properties\n string;\n\n/**\n * Deeply pick fields of T using valid Cognitive Search OData $select\n * paths.\n */\nexport type SearchPick<TModel extends object, TFields extends SelectFields<TModel>> =\n (<T>() => T extends TModel ? true : false) extends <T>() => T extends object ? true : false\n ? // Picking from an untyped object should return `object`\n TModel\n : // If paths is any or never, yield the original type\n (<T>() => T extends TFields ? true : false) extends <T>() => T extends any ? true : false\n ? TModel\n : (<T>() => T extends TFields ? true : false) extends <T>() => T extends never ? true : false\n ? TModel\n : // We're going to get a union of individual interfaces for each field in T that's selected, so convert that to an intersection.\n UnionToIntersection<\n // Paths is a union or single string type, so if it's a union it will be _distributed_ over this conditional.\n // Fortunately, template literal types are not greedy, so we can infer the field name easily.\n TFields extends `${infer FieldName}/${infer RestPaths}`\n ? // Symbols and numbers are invalid types for field names\n FieldName extends keyof TModel & string\n ? NonNullable<TModel[FieldName]> extends Array<infer Elem>\n ? Elem extends object\n ? // Extends clause is necessary to refine the constraint of RestPaths\n RestPaths extends SelectFields<Elem>\n ? // Narrow the type of every element in the array\n {\n [Key in keyof TModel as Key & FieldName]: Array<\n SearchPick<Elem, RestPaths>\n >;\n }\n : // Unreachable by construction\n never\n : // Don't recur on arrays of non-object types\n never\n : NonNullable<TModel[FieldName]> extends object\n ? // Recur :)\n {\n [Key in keyof TModel as Key & FieldName]: RestPaths extends SelectFields<\n TModel[Key] & {\n // This empty intersection fixes `T[Key]` not being narrowed to an object type in older versions of TS\n }\n >\n ?\n | SearchPick<\n TModel[Key] & {\n // Ditto\n },\n RestPaths\n >\n | Extract<TModel[Key], null>\n : // Unreachable by construction\n never;\n }\n : // Unreachable by construction\n never\n : // Ignore symbols and numbers\n never\n : // Otherwise, capture the paths that are simple keys of T itself\n TFields extends keyof TModel\n ? Pick<TModel, TFields> | Extract<TModel, null>\n : never\n > & {\n // This useless intersection actually prevents the TypeScript language server from\n // expanding the definition of SearchPick<TModel, Paths> in IntelliSense. Since we're\n // sure the type always yields an object, this intersection does not alter the type\n // at all, only the display string of the type.\n };\n\nexport type ExtractDocumentKey<TModel> = {\n [K in keyof TModel as TModel[K] extends string | undefined ? K : never]: TModel[K];\n};\n\n/**\n * Narrows the Model type to include only the selected Fields\n */\nexport type NarrowedModel<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> =\n // If the model isn't specified, the type is the same as the input type\n (<T>() => T extends TModel ? true : false) extends <T>() => T extends never ? true : false\n ? TModel\n : (<T>() => T extends TModel ? true : false) extends <T>() => T extends object ? true : false\n ? TModel\n : (<T>() => T extends TModel ? true : false) extends <T>() => T extends any ? true : false\n ? TModel\n : (<T>() => T extends TModel ? true : false) extends <T>() => T extends unknown\n ? true\n : false\n ? TModel\n : (<T>() => T extends TFields ? true : false) extends <T>() => T extends never\n ? true\n : false\n ? // If fields aren't specified, this object can't exist\n never\n : (<T>() => T extends TFields ? true : false) extends <\n T,\n >() => T extends SelectFields<TModel> ? true : false\n ? // Avoid calculating the narrowed type if every field is specified\n TModel\n : SearchPick<TModel, TFields>;\n\nexport type SuggestNarrowedModel<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> =\n (<T>() => T extends TModel ? true : false) extends <T>() => T extends never ? true : false\n ? TModel\n : (<T>() => T extends TModel ? true : false) extends <T>() => T extends object ? true : false\n ? TModel\n : (<T>() => T extends TFields ? true : false) extends <T>() => T extends never ? true : false\n ? // Filter nullable (i.e. non-key) properties from the model, as they're not returned by the\n // service by default\n keyof ExtractDocumentKey<TModel> extends never\n ? // Return the original model if none of the properties are non-nullable\n TModel\n : ExtractDocumentKey<TModel>\n : // TFields isn't narrowed to exclude null by the first condition, so it needs to be narrowed\n // here\n TFields extends SelectFields<TModel>\n ? NarrowedModel<TModel, TFields>\n : // Unreachable by construction\n never;\n\n/** Description of fields that were sent to the semantic enrichment process, as well as how they were used */\nexport interface QueryResultDocumentSemanticField {\n /**\n * The name of the field that was sent to the semantic enrichment process\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly name?: string;\n /**\n * The way the field was used for the semantic enrichment process (fully used, partially used, or unused)\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly state?: SemanticFieldState;\n}\n\n/** Contains debugging information that can be used to further explore your search results. */\nexport interface DocumentDebugInfo {\n /**\n * Contains debugging information specific to semantic search queries.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly semantic?: SemanticDebugInfo;\n /**\n * Contains debugging information specific to vector and hybrid search.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly vectors?: VectorsDebugInfo;\n}\n\n/**\n * Debug options for semantic search queries.\n */\nexport interface SemanticDebugInfo {\n /**\n * The title field that was sent to the semantic enrichment process, as well as how it was used\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly titleField?: QueryResultDocumentSemanticField;\n /**\n * The content fields that were sent to the semantic enrichment process, as well as how they were used\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly contentFields?: QueryResultDocumentSemanticField[];\n /**\n * The keyword fields that were sent to the semantic enrichment process, as well as how they were used\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly keywordFields?: QueryResultDocumentSemanticField[];\n /**\n * The raw concatenated strings that were sent to the semantic enrichment process.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly rerankerInput?: QueryResultDocumentRerankerInput;\n}\n\n/**\n * Extracts answer candidates from the contents of the documents returned in response to a query\n * expressed as a question in natural language.\n */\nexport interface ExtractiveQueryAnswer {\n answerType: \"extractive\";\n /**\n * The number of answers returned. Default count is 1\n */\n count?: number;\n /**\n * The confidence threshold. Default threshold is 0.7\n */\n threshold?: number;\n /**\n * An optional upper bound on the number of characters in each answer.\n */\n maxAnswerLength?: number;\n}\n\n/**\n * A value that specifies whether answers should be returned as part of the search response.\n * This parameter is only valid if the query type is 'semantic'. If set to `extractive`, the query\n * returns answers extracted from key passages in the highest ranked documents.\n */\nexport type QueryAnswer = ExtractiveQueryAnswer;\n\n/** Extracts captions from the matching documents that contain passages relevant to the search query. */\nexport interface ExtractiveQueryCaption {\n captionType: \"extractive\";\n highlight?: boolean;\n /**\n * An optional upper bound on the number of characters in each caption.\n */\n maxCaptionLength?: number;\n}\n\n/**\n * A value that specifies whether captions should be returned as part of the search response.\n * This parameter is only valid if the query type is 'semantic'. If set, the query returns captions\n * extracted from key passages in the highest ranked documents. When Captions is 'extractive',\n * highlighting is enabled by default. Defaults to 'none'.\n */\nexport type QueryCaption = ExtractiveQueryCaption;\n\n/**\n * Defines options for semantic search queries\n */\nexport interface SemanticSearchOptions {\n /**\n * The name of a semantic configuration that will be used when processing documents for queries of\n * type semantic.\n */\n configurationName?: string;\n /**\n * Allows the user to choose whether a semantic call should fail completely, or to return partial\n * results (default).\n */\n errorMode?: SemanticErrorMode;\n /**\n * Allows the user to set an upper bound on the amount of time it takes for semantic enrichment\n * to finish processing before the request fails.\n */\n maxWaitInMilliseconds?: number;\n /**\n * If set, the query returns answers extracted from key passages in the highest ranked documents.\n */\n answers?: QueryAnswer;\n /**\n * If set, the query returns captions extracted from key passages in the highest ranked\n * documents. When Captions is set to 'extractive', highlighting is enabled by default. Defaults\n * to 'None'.\n */\n captions?: QueryCaption;\n /**\n * When QueryRewrites is set to `generative`, the query terms are sent to a generate model which will\n * produce 10 (default) rewrites to help increase the recall of the request. Defaults to `none`.\n */\n queryRewrites?: QueryRewrites;\n /**\n * Allows setting a separate search query that will be solely used for semantic reranking,\n * semantic captions and semantic answers. Is useful for scenarios where there is a need to use\n * different queries between the base retrieval and ranking phase, and the L2 semantic phase.\n */\n semanticQuery?: string;\n /**\n * The list of field names used for semantic search.\n */\n semanticFields?: string[];\n /**\n * Enables a debugging tool that can be used to further explore your search results.\n */\n debugMode?: QueryDebugMode;\n}\n\n/** Defines options for query rewrites. */\nexport type QueryRewrites = GenerativeQueryRewrites;\n\n/** Generate alternative query terms to increase the recall of a search request. */\nexport interface GenerativeQueryRewrites {\n /** Polymorphic discriminator, which specifies the different types this object can be */\n rewritesType: \"generative\";\n /** The number of query rewrites to generate. Defaults to 10.*/\n count?: number;\n}\n\n/**\n * Defines options for vector search queries\n */\nexport interface VectorSearchOptions<TModel extends object> {\n /**\n * The query parameters for vector, hybrid, and multi-vector search queries.\n */\n queries: VectorQuery<TModel>[];\n /**\n * Determines whether or not filters are applied before or after the vector search is performed.\n * Default is 'preFilter'.\n */\n filterMode?: VectorFilterMode;\n}\n/** The threshold used for vector queries. */\nexport interface BaseVectorThreshold {\n /** Polymorphic discriminator, which specifies the different types this object can be */\n kind: \"vectorSimilarity\" | \"searchScore\";\n}\n\n/** The results of the vector query will be filtered based on the vector similarity metric. Note this is the canonical definition of similarity metric, not the 'distance' version. The threshold direction (larger or smaller) will be chosen automatically according to the metric used by the field. */\nexport interface VectorSimilarityThreshold extends BaseVectorThreshold {\n /** Polymorphic discriminator, which specifies the different types this object can be */\n kind: \"vectorSimilarity\";\n /** The threshold will filter based on the similarity metric value. Note this is the canonical definition of similarity metric, not the 'distance' version. The threshold direction (larger or smaller) will be chosen automatically according to the metric used by the field. */\n value: number;\n}\n\n/** The results of the vector query will filter based on the '\\@search.score' value. Note this is the \\@search.score returned as part of the search response. The threshold direction will be chosen for higher \\@search.score. */\nexport interface SearchScoreThreshold extends BaseVectorThreshold {\n /** Polymorphic discriminator, which specifies the different types this object can be */\n kind: \"searchScore\";\n /** The threshold will filter based on the '\\@search.score' value. Note this is the \\@search.score returned as part of the search response. The threshold direction will be chosen for higher \\@search.score. */\n value: number;\n}\n\n/** The threshold used for vector queries. */\nexport type VectorThreshold = VectorSimilarityThreshold | SearchScoreThreshold;\nexport type SemanticErrorMode = `${KnownSemanticErrorMode}`;\nexport type SemanticErrorReason = `${KnownSemanticErrorReason}`;\nexport type SemanticSearchResultsType = `${KnownSemanticSearchResultsType}`;\nexport type VectorFilterMode = `${KnownVectorFilterMode}`;\nexport type VectorQueryKind = `${KnownVectorQueryKind}`;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odataMetadataPolicy.js","sourceRoot":"","sources":["../../src/odataMetadataPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AASlC,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAGlC,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AAElD;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CAAC,aAA4B;IACpE,OAAO;QACL,IAAI,EAAE,mBAAmB;QACzB,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;YAC3D,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,mCAAmC,aAAa,EAAE,CAAC,CAAC;YAC1F,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n PipelinePolicy,\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\n\nconst AcceptHeaderName = \"Accept\";\n\ntype MetadataLevel = \"none\" | \"minimal\";\nconst odataMetadataPolicy = \"OdataMetadataPolicy\";\n\n/**\n * A policy factory for setting the Accept header to ignore odata metadata\n * @internal\n */\nexport function createOdataMetadataPolicy(metadataLevel: MetadataLevel): PipelinePolicy {\n return {\n name: odataMetadataPolicy,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n request.headers.set(AcceptHeaderName, `application/json;odata.metadata=${metadataLevel}`);\n return next(request);\n },\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"odataMetadataPolicy.js","sourceRoot":"","sources":["../../src/odataMetadataPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AASlC,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAGlC,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AAElD;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CAAC,aAA4B;IACpE,OAAO;QACL,IAAI,EAAE,mBAAmB;QACzB,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;YAC3D,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,mCAAmC,aAAa,EAAE,CAAC,CAAC;YAC1F,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n PipelinePolicy,\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\n\nconst AcceptHeaderName = \"Accept\";\n\ntype MetadataLevel = \"none\" | \"minimal\";\nconst odataMetadataPolicy = \"OdataMetadataPolicy\";\n\n/**\n * A policy factory for setting the Accept header to ignore odata metadata\n * @internal\n */\nexport function createOdataMetadataPolicy(metadataLevel: MetadataLevel): PipelinePolicy {\n return {\n name: odataMetadataPolicy,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n request.headers.set(AcceptHeaderName, `application/json;odata.metadata=${metadataLevel}`);\n return next(request);\n },\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchApiKeyCredentialPolicy.js","sourceRoot":"","sources":["../../src/searchApiKeyCredentialPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAUlC,MAAM,mBAAmB,GAAG,SAAS,CAAC;AACtC,MAAM,4BAA4B,GAAG,8BAA8B,CAAC;AAEpE;;;GAGG;AACH,MAAM,UAAU,kCAAkC,CAAC,UAAyB;IAC1E,OAAO;QACL,IAAI,EAAE,4BAA4B;QAClC,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;YAC3D,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,EAAE,CAAC;gBAC9C,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;YAC3D,CAAC;YACD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { KeyCredential } from \"@azure/core-auth\";\nimport {\n PipelinePolicy,\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\n\nconst API_KEY_HEADER_NAME = \"api-key\";\nconst searchApiKeyCredentialPolicy = \"SearchApiKeyCredentialPolicy\";\n\n/**\n * Create an HTTP pipeline policy to authenticate a request\n * using an `AzureKeyCredential` for Azure Cognitive Search\n */\nexport function createSearchApiKeyCredentialPolicy(credential: KeyCredential): PipelinePolicy {\n return {\n name: searchApiKeyCredentialPolicy,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n if (!request.headers.has(API_KEY_HEADER_NAME)) {\n request.headers.set(API_KEY_HEADER_NAME, credential.key);\n }\n return next(request);\n },\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"searchApiKeyCredentialPolicy.js","sourceRoot":"","sources":["../../src/searchApiKeyCredentialPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAUlC,MAAM,mBAAmB,GAAG,SAAS,CAAC;AACtC,MAAM,4BAA4B,GAAG,8BAA8B,CAAC;AAEpE;;;GAGG;AACH,MAAM,UAAU,kCAAkC,CAAC,UAAyB;IAC1E,OAAO;QACL,IAAI,EAAE,4BAA4B;QAClC,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;YAC3D,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,EAAE,CAAC;gBAC9C,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;YAC3D,CAAC;YACD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { KeyCredential } from \"@azure/core-auth\";\nimport type {\n PipelinePolicy,\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\n\nconst API_KEY_HEADER_NAME = \"api-key\";\nconst searchApiKeyCredentialPolicy = \"SearchApiKeyCredentialPolicy\";\n\n/**\n * Create an HTTP pipeline policy to authenticate a request\n * using an `AzureKeyCredential` for Azure Cognitive Search\n */\nexport function createSearchApiKeyCredentialPolicy(credential: KeyCredential): PipelinePolicy {\n return {\n name: searchApiKeyCredentialPolicy,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n if (!request.headers.has(API_KEY_HEADER_NAME)) {\n request.headers.set(API_KEY_HEADER_NAME, credential.key);\n }\n return next(request);\n },\n };\n}\n"]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
import { __asyncDelegator, __asyncGenerator, __asyncValues, __await, __rest } from "tslib";
|
|
4
|
-
/// <reference lib="esnext.asynciterable" />
|
|
5
4
|
import { isTokenCredential } from "@azure/core-auth";
|
|
6
5
|
import { bearerTokenAuthenticationPolicy } from "@azure/core-rest-pipeline";
|
|
7
6
|
import { decode, encode } from "./base64";
|
|
@@ -105,6 +104,7 @@ export class SearchClient {
|
|
|
105
104
|
* Retrieves the number of documents in the index.
|
|
106
105
|
* @param options - Options to the count operation.
|
|
107
106
|
*/
|
|
107
|
+
// eslint-disable-next-line @azure/azure-sdk/ts-naming-options
|
|
108
108
|
async getDocumentsCount(options = {}) {
|
|
109
109
|
const { span, updatedOptions } = createSpan("SearchClient-getDocumentsCount", options);
|
|
110
110
|
try {
|
|
@@ -189,9 +189,9 @@ export class SearchClient {
|
|
|
189
189
|
}
|
|
190
190
|
async searchDocuments(searchText, options = {}, nextPageParameters = {}) {
|
|
191
191
|
const _a = options, { includeTotalCount, orderBy, searchFields, select, vectorSearchOptions, semanticSearchOptions, hybridSearch } = _a, restOptions = __rest(_a, ["includeTotalCount", "orderBy", "searchFields", "select", "vectorSearchOptions", "semanticSearchOptions", "hybridSearch"]);
|
|
192
|
-
const _b = semanticSearchOptions !== null && semanticSearchOptions !== void 0 ? semanticSearchOptions : {}, { semanticFields, configurationName, errorMode, answers, captions, debugMode } = _b, restSemanticOptions = __rest(_b, ["semanticFields", "configurationName", "errorMode", "answers", "captions", "debugMode"]);
|
|
192
|
+
const _b = semanticSearchOptions !== null && semanticSearchOptions !== void 0 ? semanticSearchOptions : {}, { semanticFields, configurationName, errorMode, answers, captions, debugMode, queryRewrites } = _b, restSemanticOptions = __rest(_b, ["semanticFields", "configurationName", "errorMode", "answers", "captions", "debugMode", "queryRewrites"]);
|
|
193
193
|
const _c = vectorSearchOptions !== null && vectorSearchOptions !== void 0 ? vectorSearchOptions : {}, { queries, filterMode } = _c, restVectorOptions = __rest(_c, ["queries", "filterMode"]);
|
|
194
|
-
const fullOptions = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, restSemanticOptions), restVectorOptions), restOptions), nextPageParameters), { searchFields: this.convertSearchFields(searchFields), semanticFields: this.convertSemanticFields(semanticFields), select: this.convertSelect(select) || "*", orderBy: this.convertOrderBy(orderBy), includeTotalResultCount: includeTotalCount, vectorQueries: queries === null || queries === void 0 ? void 0 : queries.map(this.convertVectorQuery.bind(this)), answers: this.convertQueryAnswers(answers), captions: this.convertQueryCaptions(captions), semanticErrorHandling: errorMode, semanticConfigurationName: configurationName, debug: debugMode, vectorFilterMode: filterMode, hybridSearch: hybridSearch });
|
|
194
|
+
const fullOptions = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, restSemanticOptions), restVectorOptions), restOptions), nextPageParameters), { searchFields: this.convertSearchFields(searchFields), semanticFields: this.convertSemanticFields(semanticFields), select: this.convertSelect(select) || "*", orderBy: this.convertOrderBy(orderBy), includeTotalResultCount: includeTotalCount, vectorQueries: queries === null || queries === void 0 ? void 0 : queries.map(this.convertVectorQuery.bind(this)), answers: this.convertQueryAnswers(answers), captions: this.convertQueryCaptions(captions), semanticErrorHandling: errorMode, semanticConfigurationName: configurationName, debug: debugMode, queryRewrites: this.convertQueryRewrites(queryRewrites), vectorFilterMode: filterMode, hybridSearch: hybridSearch });
|
|
195
195
|
const { span, updatedOptions } = createSpan("SearchClient-searchDocuments", options);
|
|
196
196
|
try {
|
|
197
197
|
const result = await this.client.documents.searchPost(Object.assign(Object.assign({}, fullOptions), { searchText: searchText }), updatedOptions);
|
|
@@ -594,13 +594,16 @@ export class SearchClient {
|
|
|
594
594
|
return answers;
|
|
595
595
|
}
|
|
596
596
|
const config = [];
|
|
597
|
-
const { answerType: output, count, threshold } = answers;
|
|
597
|
+
const { answerType: output, count, threshold, maxAnswerLength } = answers;
|
|
598
598
|
if (count) {
|
|
599
599
|
config.push(`count-${count}`);
|
|
600
600
|
}
|
|
601
601
|
if (threshold) {
|
|
602
602
|
config.push(`threshold-${threshold}`);
|
|
603
603
|
}
|
|
604
|
+
if (maxAnswerLength) {
|
|
605
|
+
config.push(`maxcharlength-${maxAnswerLength}`);
|
|
606
|
+
}
|
|
604
607
|
if (config.length) {
|
|
605
608
|
return output + `|${config.join(",")}`;
|
|
606
609
|
}
|
|
@@ -611,17 +614,51 @@ export class SearchClient {
|
|
|
611
614
|
return captions;
|
|
612
615
|
}
|
|
613
616
|
const config = [];
|
|
614
|
-
const { captionType: output, highlight } = captions;
|
|
617
|
+
const { captionType: output, highlight, maxCaptionLength } = captions;
|
|
615
618
|
if (highlight !== undefined) {
|
|
616
619
|
config.push(`highlight-${highlight}`);
|
|
617
620
|
}
|
|
621
|
+
if (maxCaptionLength) {
|
|
622
|
+
config.push(`maxcharlength-${maxCaptionLength}`);
|
|
623
|
+
}
|
|
618
624
|
if (config.length) {
|
|
619
625
|
return output + `|${config.join(",")}`;
|
|
620
626
|
}
|
|
621
627
|
return output;
|
|
622
628
|
}
|
|
623
629
|
convertVectorQuery(vectorQuery) {
|
|
624
|
-
|
|
630
|
+
switch (vectorQuery.kind) {
|
|
631
|
+
case "text": {
|
|
632
|
+
const { fields, queryRewrites } = vectorQuery, restFields = __rest(vectorQuery, ["fields", "queryRewrites"]);
|
|
633
|
+
return Object.assign(Object.assign({}, restFields), { fields: this.convertVectorQueryFields(fields), queryRewrites: this.convertQueryRewrites(queryRewrites) });
|
|
634
|
+
}
|
|
635
|
+
case "vector":
|
|
636
|
+
case "imageUrl":
|
|
637
|
+
case "imageBinary": {
|
|
638
|
+
return Object.assign(Object.assign({}, vectorQuery), { fields: this.convertVectorQueryFields(vectorQuery === null || vectorQuery === void 0 ? void 0 : vectorQuery.fields) });
|
|
639
|
+
}
|
|
640
|
+
default: {
|
|
641
|
+
logger.warning("Unknown vector query kind; sending without serialization");
|
|
642
|
+
return vectorQuery;
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
convertQueryRewrites(queryRewrites) {
|
|
647
|
+
if (!queryRewrites) {
|
|
648
|
+
return queryRewrites;
|
|
649
|
+
}
|
|
650
|
+
const { rewritesType: baseOutput } = queryRewrites;
|
|
651
|
+
switch (baseOutput) {
|
|
652
|
+
case "generative": {
|
|
653
|
+
const { count } = queryRewrites;
|
|
654
|
+
const config = [...(count === undefined ? [] : [`count-${count}`])];
|
|
655
|
+
if (config.length)
|
|
656
|
+
return baseOutput + `|${config.join(",")}`;
|
|
657
|
+
return baseOutput;
|
|
658
|
+
}
|
|
659
|
+
default:
|
|
660
|
+
return baseOutput;
|
|
661
|
+
}
|
|
625
662
|
}
|
|
626
663
|
}
|
|
627
664
|
//# sourceMappingURL=searchClient.js.map
|