@azure/search-documents 12.0.0-alpha.20230622.2 → 12.0.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/README.md +56 -15
- package/dist/index.js +589 -99
- package/dist/index.js.map +1 -1
- package/dist-esm/src/generated/data/models/index.js +50 -6
- package/dist-esm/src/generated/data/models/index.js.map +1 -1
- package/dist-esm/src/generated/data/models/mappers.js +202 -0
- package/dist-esm/src/generated/data/models/mappers.js.map +1 -1
- package/dist-esm/src/generated/data/models/parameters.js +30 -0
- package/dist-esm/src/generated/data/models/parameters.js.map +1 -1
- package/dist-esm/src/generated/data/operations/documents.js +3 -0
- package/dist-esm/src/generated/data/operations/documents.js.map +1 -1
- package/dist-esm/src/generated/data/searchClient.js.map +1 -1
- package/dist-esm/src/generated/service/models/index.js +15 -14
- package/dist-esm/src/generated/service/models/index.js.map +1 -1
- package/dist-esm/src/generated/service/models/mappers.js +190 -7
- package/dist-esm/src/generated/service/models/mappers.js.map +1 -1
- package/dist-esm/src/generated/service/searchServiceClient.js.map +1 -1
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/indexModels.js.map +1 -1
- package/dist-esm/src/searchClient.js +51 -46
- package/dist-esm/src/searchClient.js.map +1 -1
- package/dist-esm/src/searchIndexClient.js +1 -1
- package/dist-esm/src/searchIndexClient.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 +39 -26
- package/dist-esm/src/serviceUtils.js.map +1 -1
- package/package.json +5 -4
- package/types/search-documents.d.ts +469 -110
|
@@ -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;AAC1D,OAAO,EACL,eAAe,EACf,YAAY,EACZ,aAAa,EACb,eAAe,EACf,WAAW,EACX,WAAW,EACZ,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;YAC1B,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;SAC9C;QACD,IAAI,UAAU,KAAK,SAAS,EAAE;YAC5B,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;SAChD;QAED,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,GAAG,EAAE,CAAC;SACd;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,OAAO,EAAE,MAAA,MAAA,OAAO,CAAC,QAAQ,mCAAI,OAAO,CAAC,OAAO,mCAAI,YAAY,GAC7D,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;IACvC,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,WAAW;SAChC;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 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;AAC1D,OAAO,EACL,eAAe,EACf,YAAY,EACZ,aAAa,EACb,eAAe,EACf,WAAW,EACX,WAAW,EACZ,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;YAC1B,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;SAC9C;QACD,IAAI,UAAU,KAAK,SAAS,EAAE;YAC5B,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;SAChD;QAED,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,GAAG,EAAE,CAAC;SACd;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,OAAO,EAAE,MAAA,MAAA,OAAO,CAAC,QAAQ,mCAAI,OAAO,CAAC,OAAO,mCAAI,YAAY,GAC7D,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;IACvC,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,WAAW;SAChC;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 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 ApiVersion20230701Preview,\n SearchServiceClientOptionalParams,\n GetServiceStatisticsOptionalParams,\n GetServiceStatisticsResponse\n} from \"./models\";\n\n/** @internal */\nexport class SearchServiceClient extends coreHttpCompat.ExtendedServiceClient {\n endpoint: string;\n apiVersion: ApiVersion20230701Preview;\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: ApiVersion20230701Preview,\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.0.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 baseUri: 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 }\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.SearchError\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,YAAY,EAAuB,MAAM,gBAAgB,CAAC;AACnE,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,gCAAgC,CAAC;AAuCxC,OAAO,EAAE,4BAA4B,EAAwB,MAAM,gCAAgC,CAAC;AACpG,OAAO,EAAE,iBAAiB,EAA4B,MAAM,qBAAqB,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAA8B,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAwBL,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,GAsDpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAYL,YAAY,EAEZ,kBAAkB,EAElB,YAAY,EAOZ,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAEL,eAAe,EAqEf,oCAAoC,EAapC,2BAA2B,EAE3B,uBAAuB,EAEvB,kBAAkB,EAElB,iCAAiC,EAMjC,mBAAmB,EAEnB,mCAAmC,EAEnC,+BAA+B,EAE/B,gBAAgB,EAEhB,kBAAkB,EAElB,qCAAqC,EAErC,qBAAqB,EAcrB,gCAAgC,EAUhC,wBAAwB,EAKxB,6BAA6B,EAG7B,2BAA2B,EAE3B,2BAA2B,EAE3B,wCAAwC,EAYxC,0BAA0B,EAG1B,oBAAoB,EAEpB,mBAAmB,EAUnB,iCAAiC,EAEjC,eAAe,EAKf,iCAAiC,EAEjC,iBAAiB,GAMlB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport { SearchClient, SearchClientOptions } from \"./searchClient\";\nexport {\n DEFAULT_BATCH_SIZE,\n DEFAULT_FLUSH_WINDOW,\n DEFAULT_RETRY_COUNT,\n} from \"./searchIndexingBufferedSender\";\nexport {\n AutocompleteRequest,\n AutocompleteOptions,\n CountDocumentsOptions,\n DeleteDocumentsOptions,\n ExcludedODataTypes,\n ExtractDocumentKey,\n GetDocumentOptions,\n IndexDocumentsAction,\n ListSearchResultsPageSettings,\n IndexDocumentsOptions,\n SearchDocumentsResultBase,\n SearchDocumentsResult,\n SearchDocumentsPageResult,\n SearchIterator,\n SearchOptions,\n SearchRequestOptions,\n SearchRequest,\n SearchResult,\n SuggestDocumentsResult,\n SuggestRequest,\n SuggestResult,\n SuggestOptions,\n MergeDocumentsOptions,\n MergeOrUploadDocumentsOptions,\n NarrowedModel,\n UploadDocumentsOptions,\n SearchIndexingBufferedSenderOptions,\n SearchIndexingBufferedSenderDeleteDocumentsOptions,\n SearchIndexingBufferedSenderFlushDocumentsOptions,\n SearchIndexingBufferedSenderMergeDocumentsOptions,\n SearchIndexingBufferedSenderMergeOrUploadDocumentsOptions,\n SearchIndexingBufferedSenderUploadDocumentsOptions,\n SearchPick,\n SelectFields,\n SuggestNarrowedModel,\n UnionToIntersection,\n} from \"./indexModels\";\nexport { SearchIndexingBufferedSender, IndexDocumentsClient } from \"./searchIndexingBufferedSender\";\nexport { SearchIndexClient, SearchIndexClientOptions } from \"./searchIndexClient\";\nexport { SearchIndexerClient, SearchIndexerClientOptions } from \"./searchIndexerClient\";\nexport {\n SearchIndex,\n LexicalAnalyzer,\n TokenFilter,\n LexicalTokenizer,\n CharFilter,\n ListIndexesOptions,\n CreateIndexOptions,\n CreateOrUpdateIndexOptions,\n CreateOrUpdateSkillsetOptions,\n CreateOrUpdateSynonymMapOptions,\n CreateSkillsetOptions,\n CreateSynonymMapOptions,\n DeleteSkillsetOptions,\n DeleteSynonymMapOptions,\n GetSkillSetOptions,\n GetSynonymMapsOptions,\n ListSkillsetsOptions,\n SearchIndexerSkillset,\n ListSynonymMapsOptions,\n DeleteIndexOptions,\n AnalyzeTextOptions,\n GetIndexOptions,\n GetIndexStatisticsOptions,\n KnownAnalyzerNames,\n KnownCharFilterNames,\n KnownTokenFilterNames,\n KnownTokenizerNames,\n ScoringFunction,\n ScoringProfile,\n CustomAnalyzer,\n PatternAnalyzer,\n PatternTokenizer,\n SearchField,\n SimpleField,\n ComplexField,\n SearchFieldDataType,\n ComplexDataType,\n CognitiveServicesAccount,\n SearchIndexerSkill,\n SynonymMap,\n ListIndexersOptions,\n CreateIndexerOptions,\n GetIndexerOptions,\n CreateorUpdateIndexerOptions,\n DeleteIndexerOptions,\n GetIndexerStatusOptions,\n ResetIndexerOptions,\n RunIndexerOptions,\n CreateDataSourceConnectionOptions,\n CreateorUpdateDataSourceConnectionOptions,\n DeleteDataSourceConnectionOptions,\n GetDataSourceConnectionOptions,\n ListDataSourceConnectionsOptions,\n SearchIndexerDataSourceConnection,\n DataChangeDetectionPolicy,\n DataDeletionDetectionPolicy,\n GetServiceStatisticsOptions,\n IndexIterator,\n IndexNameIterator,\n SimilarityAlgorithm,\n NGramTokenFilter,\n LuceneStandardTokenizer,\n EdgeNGramTokenFilter,\n KeywordTokenizer,\n AnalyzeRequest,\n SearchResourceEncryptionKey,\n SearchIndexStatistics,\n SearchServiceStatistics,\n SearchIndexer,\n LexicalNormalizer,\n SearchIndexerDataIdentity,\n ResetDocumentsOptions,\n ResetSkillsOptions,\n SearchIndexAlias,\n CreateAliasOptions,\n CreateOrUpdateAliasOptions,\n DeleteAliasOptions,\n GetAliasOptions,\n ListAliasesOptions,\n AliasIterator,\n} from \"./serviceModels\";\nexport { default as GeographyPoint } from \"./geographyPoint\";\nexport { odata } from \"./odata\";\nexport { IndexDocumentsBatch } from \"./indexDocumentsBatch\";\nexport {\n AutocompleteResult,\n AutocompleteMode,\n AutocompleteItem,\n FacetResult,\n IndexActionType,\n IndexDocumentsResult,\n IndexingResult,\n QueryType,\n SearchMode,\n ScoringStatistics,\n Answers,\n KnownAnswers,\n QueryLanguage,\n KnownQueryLanguage,\n Speller,\n KnownSpeller,\n CaptionResult,\n AnswerResult,\n Captions,\n QueryAnswerType,\n QueryCaptionType,\n QuerySpellerType,\n KnownQuerySpellerType,\n KnownQueryAnswerType,\n KnownQueryCaptionType,\n} from \"./generated/data/models\";\nexport {\n RegexFlags,\n KnownRegexFlags,\n LuceneStandardAnalyzer,\n StopAnalyzer,\n MappingCharFilter,\n PatternReplaceCharFilter,\n CorsOptions,\n AzureActiveDirectoryApplicationCredentials,\n ScoringFunctionAggregation,\n ScoringFunctionInterpolation,\n DistanceScoringParameters,\n DistanceScoringFunction,\n FreshnessScoringParameters,\n FreshnessScoringFunction,\n MagnitudeScoringParameters,\n MagnitudeScoringFunction,\n TagScoringParameters,\n TagScoringFunction,\n TextWeights,\n AsciiFoldingTokenFilter,\n CjkBigramTokenFilterScripts,\n CjkBigramTokenFilter,\n CommonGramTokenFilter,\n DictionaryDecompounderTokenFilter,\n EdgeNGramTokenFilterSide,\n ElisionTokenFilter,\n KeepTokenFilter,\n KeywordMarkerTokenFilter,\n LengthTokenFilter,\n LimitTokenFilter,\n PatternCaptureTokenFilter,\n PatternReplaceTokenFilter,\n PhoneticEncoder,\n PhoneticTokenFilter,\n ShingleTokenFilter,\n SnowballTokenFilterLanguage,\n SnowballTokenFilter,\n StemmerTokenFilterLanguage,\n StemmerTokenFilter,\n StemmerOverrideTokenFilter,\n StopwordsList,\n StopwordsTokenFilter,\n SynonymTokenFilter,\n TruncateTokenFilter,\n UniqueTokenFilter,\n WordDelimiterTokenFilter,\n ClassicTokenizer,\n TokenCharacterKind,\n EdgeNGramTokenizer,\n MicrosoftTokenizerLanguage,\n MicrosoftLanguageTokenizer,\n MicrosoftStemmingTokenizerLanguage,\n MicrosoftLanguageStemmingTokenizer,\n NGramTokenizer,\n PathHierarchyTokenizerV2 as PathHierarchyTokenizer,\n UaxUrlEmailTokenizer,\n Suggester as SearchSuggester,\n AnalyzeResult,\n AnalyzedTokenInfo,\n ConditionalSkill,\n KeyPhraseExtractionSkill,\n OcrSkill,\n ImageAnalysisSkill,\n LanguageDetectionSkill,\n ShaperSkill,\n MergeSkill,\n EntityRecognitionSkill,\n SentimentSkill,\n CustomEntityLookupSkill,\n CustomEntityLookupSkillLanguage,\n KnownCustomEntityLookupSkillLanguage,\n DocumentExtractionSkill,\n CustomEntity,\n CustomEntityAlias,\n SplitSkill,\n PIIDetectionSkill,\n EntityRecognitionSkillV3,\n EntityLinkingSkill,\n SentimentSkillV3,\n TextTranslationSkill,\n WebApiSkill,\n AzureMachineLearningSkill,\n SentimentSkillLanguage,\n KnownSentimentSkillLanguage,\n SplitSkillLanguage,\n KnownSplitSkillLanguage,\n TextSplitMode,\n KnownTextSplitMode,\n TextTranslationSkillLanguage,\n KnownTextTranslationSkillLanguage,\n DefaultCognitiveServicesAccount,\n CognitiveServicesAccountKey,\n InputFieldMappingEntry,\n OutputFieldMappingEntry,\n EntityCategory,\n KnownEntityCategory,\n EntityRecognitionSkillLanguage,\n KnownEntityRecognitionSkillLanguage,\n ImageAnalysisSkillLanguage,\n KnownImageAnalysisSkillLanguage,\n ImageDetail,\n KnownImageDetail,\n VisualFeature,\n KnownVisualFeature,\n KeyPhraseExtractionSkillLanguage,\n KnownKeyPhraseExtractionSkillLanguage,\n OcrSkillLanguage,\n KnownOcrSkillLanguage,\n FieldMapping,\n IndexingParameters,\n IndexingSchedule,\n FieldMappingFunction,\n SearchIndexerStatus,\n IndexerExecutionResult,\n SearchIndexerLimits,\n IndexerStatus,\n SearchIndexerError,\n IndexerExecutionStatus,\n SearchIndexerWarning,\n SearchIndexerDataContainer,\n SearchIndexerDataSourceType,\n KnownSearchIndexerDataSourceType,\n SoftDeleteColumnDeletionDetectionPolicy,\n SqlIntegratedChangeTrackingPolicy,\n HighWaterMarkChangeDetectionPolicy,\n SearchIndexerDataUserAssignedIdentity,\n SearchIndexerDataNoneIdentity,\n ServiceCounters,\n ServiceLimits,\n ResourceCounter,\n LexicalAnalyzerName,\n KnownLexicalAnalyzerName,\n ClassicSimilarity,\n BM25Similarity,\n IndexingParametersConfiguration,\n BlobIndexerDataToExtract,\n KnownBlobIndexerDataToExtract,\n IndexerExecutionEnvironment,\n BlobIndexerImageAction,\n KnownBlobIndexerImageAction,\n BlobIndexerParsingMode,\n KnownBlobIndexerParsingMode,\n BlobIndexerPDFTextRotationAlgorithm,\n KnownBlobIndexerPDFTextRotationAlgorithm,\n TokenFilter as BaseTokenFilter,\n Similarity,\n LexicalTokenizer as BaseLexicalTokenizer,\n CognitiveServicesAccount as BaseCognitiveServicesAccount,\n SearchIndexerSkill as BaseSearchIndexerSkill,\n ScoringFunction as BaseScoringFunction,\n DataChangeDetectionPolicy as BaseDataChangeDetectionPolicy,\n LexicalAnalyzer as BaseLexicalAnalyzer,\n CharFilter as BaseCharFilter,\n DataDeletionDetectionPolicy as BaseDataDeletionDetectionPolicy,\n LexicalNormalizerName,\n KnownLexicalNormalizerName,\n CustomNormalizer,\n TokenFilterName,\n KnownTokenFilterName,\n CharFilterName,\n KnownCharFilterName,\n LexicalNormalizer as BaseLexicalNormalizer,\n SearchIndexerKnowledgeStore,\n SearchIndexerKnowledgeStoreProjection,\n SearchIndexerKnowledgeStoreFileProjectionSelector,\n SearchIndexerKnowledgeStoreBlobProjectionSelector,\n SearchIndexerKnowledgeStoreProjectionSelector,\n SearchIndexerKnowledgeStoreObjectProjectionSelector,\n SearchIndexerKnowledgeStoreTableProjectionSelector,\n PIIDetectionSkillMaskingMode,\n KnownPIIDetectionSkillMaskingMode,\n LineEnding,\n KnownLineEnding,\n SearchIndexerDataIdentity as BaseSearchIndexerDataIdentity,\n SearchIndexerCache,\n IndexerState,\n IndexerExecutionStatusDetail,\n KnownIndexerExecutionStatusDetail,\n IndexingMode,\n KnownIndexingMode,\n SemanticSettings,\n SemanticConfiguration,\n PrioritizedFields,\n SemanticField,\n SearchAlias,\n} from \"./generated/service/models\";\nexport { AzureKeyCredential } from \"@azure/core-auth\";\nexport { createSynonymMapFromFile } from \"./synonymMapHelper\";\nexport { KnownSearchAudience } from \"./searchAudience\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,YAAY,EAAuB,MAAM,gBAAgB,CAAC;AACnE,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,gCAAgC,CAAC;AAoDxC,OAAO,EAAE,4BAA4B,EAAwB,MAAM,gCAAgC,CAAC;AACpG,OAAO,EAAE,iBAAiB,EAA4B,MAAM,qBAAqB,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAA8B,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAwBL,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,GA8DpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAWL,YAAY,EAEZ,kBAAkB,EAElB,YAAY,EAOZ,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,GAEtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAEL,eAAe,EAqEf,oCAAoC,EAYpC,2BAA2B,EAE3B,uBAAuB,EAEvB,kBAAkB,EAElB,iCAAiC,EAMjC,mBAAmB,EAEnB,mCAAmC,EAEnC,+BAA+B,EAE/B,gBAAgB,EAEhB,kBAAkB,EAElB,qCAAqC,EAErC,qBAAqB,EAcrB,gCAAgC,EAUhC,wBAAwB,EAKxB,6BAA6B,EAG7B,2BAA2B,EAE3B,2BAA2B,EAE3B,wCAAwC,EAYxC,0BAA0B,EAG1B,oBAAoB,EAEpB,mBAAmB,EASnB,iCAAiC,EAEjC,eAAe,EAIf,iCAAiC,EAEjC,iBAAiB,GAOlB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport { SearchClient, SearchClientOptions } from \"./searchClient\";\nexport {\n DEFAULT_BATCH_SIZE,\n DEFAULT_FLUSH_WINDOW,\n DEFAULT_RETRY_COUNT,\n} from \"./searchIndexingBufferedSender\";\nexport {\n AutocompleteRequest,\n AutocompleteOptions,\n CountDocumentsOptions,\n DeleteDocumentsOptions,\n ExcludedODataTypes,\n ExtractDocumentKey,\n GetDocumentOptions,\n IndexDocumentsAction,\n ListSearchResultsPageSettings,\n IndexDocumentsOptions,\n SearchDocumentsResultBase,\n SearchDocumentsResult,\n SearchDocumentsPageResult,\n SearchIterator,\n SearchOptions,\n SearchRequestOptions,\n SearchRequest,\n SearchResult,\n SuggestDocumentsResult,\n SuggestRequest,\n SuggestResult,\n SuggestOptions,\n MergeDocumentsOptions,\n MergeOrUploadDocumentsOptions,\n NarrowedModel,\n UploadDocumentsOptions,\n SearchIndexingBufferedSenderOptions,\n SearchIndexingBufferedSenderDeleteDocumentsOptions,\n SearchIndexingBufferedSenderFlushDocumentsOptions,\n SearchIndexingBufferedSenderMergeDocumentsOptions,\n SearchIndexingBufferedSenderMergeOrUploadDocumentsOptions,\n SearchIndexingBufferedSenderUploadDocumentsOptions,\n SearchPick,\n SearchFieldArray,\n SelectArray,\n SelectFields,\n SuggestNarrowedModel,\n UnionToIntersection,\n SemanticPartialResponseReason,\n SemanticPartialResponseType,\n QueryDebugMode,\n SemanticErrorHandlingMode,\n SemanticFieldState,\n Vector,\n AnswersOptions,\n DocumentDebugInfo,\n SemanticDebugInfo,\n QueryResultDocumentSemanticField,\n Answers,\n} from \"./indexModels\";\nexport { SearchIndexingBufferedSender, IndexDocumentsClient } from \"./searchIndexingBufferedSender\";\nexport { SearchIndexClient, SearchIndexClientOptions } from \"./searchIndexClient\";\nexport { SearchIndexerClient, SearchIndexerClientOptions } from \"./searchIndexerClient\";\nexport {\n SearchIndex,\n LexicalAnalyzer,\n TokenFilter,\n LexicalTokenizer,\n CharFilter,\n ListIndexesOptions,\n CreateIndexOptions,\n CreateOrUpdateIndexOptions,\n CreateOrUpdateSkillsetOptions,\n CreateOrUpdateSynonymMapOptions,\n CreateSkillsetOptions,\n CreateSynonymMapOptions,\n DeleteSkillsetOptions,\n DeleteSynonymMapOptions,\n GetSkillSetOptions,\n GetSynonymMapsOptions,\n ListSkillsetsOptions,\n SearchIndexerSkillset,\n ListSynonymMapsOptions,\n DeleteIndexOptions,\n AnalyzeTextOptions,\n GetIndexOptions,\n GetIndexStatisticsOptions,\n KnownAnalyzerNames,\n KnownCharFilterNames,\n KnownTokenFilterNames,\n KnownTokenizerNames,\n ScoringFunction,\n ScoringProfile,\n CustomAnalyzer,\n PatternAnalyzer,\n PatternTokenizer,\n SearchField,\n SimpleField,\n ComplexField,\n SearchFieldDataType,\n ComplexDataType,\n CognitiveServicesAccount,\n SearchIndexerSkill,\n SynonymMap,\n ListIndexersOptions,\n CreateIndexerOptions,\n GetIndexerOptions,\n CreateorUpdateIndexerOptions,\n DeleteIndexerOptions,\n GetIndexerStatusOptions,\n ResetIndexerOptions,\n RunIndexerOptions,\n CreateDataSourceConnectionOptions,\n CreateorUpdateDataSourceConnectionOptions,\n DeleteDataSourceConnectionOptions,\n GetDataSourceConnectionOptions,\n ListDataSourceConnectionsOptions,\n SearchIndexerDataSourceConnection,\n DataChangeDetectionPolicy,\n DataDeletionDetectionPolicy,\n GetServiceStatisticsOptions,\n IndexIterator,\n IndexNameIterator,\n SimilarityAlgorithm,\n NGramTokenFilter,\n LuceneStandardTokenizer,\n EdgeNGramTokenFilter,\n KeywordTokenizer,\n AnalyzeRequest,\n SearchResourceEncryptionKey,\n SearchIndexStatistics,\n SearchServiceStatistics,\n SearchIndexer,\n LexicalNormalizer,\n SearchIndexerDataIdentity,\n ResetDocumentsOptions,\n ResetSkillsOptions,\n SearchIndexAlias,\n CreateAliasOptions,\n CreateOrUpdateAliasOptions,\n DeleteAliasOptions,\n GetAliasOptions,\n ListAliasesOptions,\n AliasIterator,\n VectorSearchAlgorithmConfiguration,\n VectorSearchAlgorithmMetric,\n VectorSearch,\n SearchIndexerCache,\n SearchIndexerKnowledgeStore,\n WebApiSkill,\n HnswParameters,\n HnswVectorSearchAlgorithmConfiguration,\n} from \"./serviceModels\";\nexport { default as GeographyPoint } from \"./geographyPoint\";\nexport { odata } from \"./odata\";\nexport { IndexDocumentsBatch } from \"./indexDocumentsBatch\";\nexport {\n AutocompleteResult,\n AutocompleteMode,\n AutocompleteItem,\n FacetResult,\n IndexActionType,\n IndexDocumentsResult,\n IndexingResult,\n QueryType,\n SearchMode,\n ScoringStatistics,\n KnownAnswers,\n QueryLanguage,\n KnownQueryLanguage,\n Speller,\n KnownSpeller,\n CaptionResult,\n AnswerResult,\n Captions,\n QueryAnswerType,\n QueryCaptionType,\n QuerySpellerType,\n KnownQuerySpellerType,\n KnownQueryAnswerType,\n KnownQueryCaptionType,\n QueryResultDocumentRerankerInput,\n} from \"./generated/data/models\";\nexport {\n RegexFlags,\n KnownRegexFlags,\n LuceneStandardAnalyzer,\n StopAnalyzer,\n MappingCharFilter,\n PatternReplaceCharFilter,\n CorsOptions,\n AzureActiveDirectoryApplicationCredentials,\n ScoringFunctionAggregation,\n ScoringFunctionInterpolation,\n DistanceScoringParameters,\n DistanceScoringFunction,\n FreshnessScoringParameters,\n FreshnessScoringFunction,\n MagnitudeScoringParameters,\n MagnitudeScoringFunction,\n TagScoringParameters,\n TagScoringFunction,\n TextWeights,\n AsciiFoldingTokenFilter,\n CjkBigramTokenFilterScripts,\n CjkBigramTokenFilter,\n CommonGramTokenFilter,\n DictionaryDecompounderTokenFilter,\n EdgeNGramTokenFilterSide,\n ElisionTokenFilter,\n KeepTokenFilter,\n KeywordMarkerTokenFilter,\n LengthTokenFilter,\n LimitTokenFilter,\n PatternCaptureTokenFilter,\n PatternReplaceTokenFilter,\n PhoneticEncoder,\n PhoneticTokenFilter,\n ShingleTokenFilter,\n SnowballTokenFilterLanguage,\n SnowballTokenFilter,\n StemmerTokenFilterLanguage,\n StemmerTokenFilter,\n StemmerOverrideTokenFilter,\n StopwordsList,\n StopwordsTokenFilter,\n SynonymTokenFilter,\n TruncateTokenFilter,\n UniqueTokenFilter,\n WordDelimiterTokenFilter,\n ClassicTokenizer,\n TokenCharacterKind,\n EdgeNGramTokenizer,\n MicrosoftTokenizerLanguage,\n MicrosoftLanguageTokenizer,\n MicrosoftStemmingTokenizerLanguage,\n MicrosoftLanguageStemmingTokenizer,\n NGramTokenizer,\n PathHierarchyTokenizerV2 as PathHierarchyTokenizer,\n UaxUrlEmailTokenizer,\n Suggester as SearchSuggester,\n AnalyzeResult,\n AnalyzedTokenInfo,\n ConditionalSkill,\n KeyPhraseExtractionSkill,\n OcrSkill,\n ImageAnalysisSkill,\n LanguageDetectionSkill,\n ShaperSkill,\n MergeSkill,\n EntityRecognitionSkill,\n SentimentSkill,\n CustomEntityLookupSkill,\n CustomEntityLookupSkillLanguage,\n KnownCustomEntityLookupSkillLanguage,\n DocumentExtractionSkill,\n CustomEntity,\n CustomEntityAlias,\n SplitSkill,\n PIIDetectionSkill,\n EntityRecognitionSkillV3,\n EntityLinkingSkill,\n SentimentSkillV3,\n TextTranslationSkill,\n AzureMachineLearningSkill,\n SentimentSkillLanguage,\n KnownSentimentSkillLanguage,\n SplitSkillLanguage,\n KnownSplitSkillLanguage,\n TextSplitMode,\n KnownTextSplitMode,\n TextTranslationSkillLanguage,\n KnownTextTranslationSkillLanguage,\n DefaultCognitiveServicesAccount,\n CognitiveServicesAccountKey,\n InputFieldMappingEntry,\n OutputFieldMappingEntry,\n EntityCategory,\n KnownEntityCategory,\n EntityRecognitionSkillLanguage,\n KnownEntityRecognitionSkillLanguage,\n ImageAnalysisSkillLanguage,\n KnownImageAnalysisSkillLanguage,\n ImageDetail,\n KnownImageDetail,\n VisualFeature,\n KnownVisualFeature,\n KeyPhraseExtractionSkillLanguage,\n KnownKeyPhraseExtractionSkillLanguage,\n OcrSkillLanguage,\n KnownOcrSkillLanguage,\n FieldMapping,\n IndexingParameters,\n IndexingSchedule,\n FieldMappingFunction,\n SearchIndexerStatus,\n IndexerExecutionResult,\n SearchIndexerLimits,\n IndexerStatus,\n SearchIndexerError,\n IndexerExecutionStatus,\n SearchIndexerWarning,\n SearchIndexerDataContainer,\n SearchIndexerDataSourceType,\n KnownSearchIndexerDataSourceType,\n SoftDeleteColumnDeletionDetectionPolicy,\n SqlIntegratedChangeTrackingPolicy,\n HighWaterMarkChangeDetectionPolicy,\n SearchIndexerDataUserAssignedIdentity,\n SearchIndexerDataNoneIdentity,\n ServiceCounters,\n ServiceLimits,\n ResourceCounter,\n LexicalAnalyzerName,\n KnownLexicalAnalyzerName,\n ClassicSimilarity,\n BM25Similarity,\n IndexingParametersConfiguration,\n BlobIndexerDataToExtract,\n KnownBlobIndexerDataToExtract,\n IndexerExecutionEnvironment,\n BlobIndexerImageAction,\n KnownBlobIndexerImageAction,\n BlobIndexerParsingMode,\n KnownBlobIndexerParsingMode,\n BlobIndexerPDFTextRotationAlgorithm,\n KnownBlobIndexerPDFTextRotationAlgorithm,\n TokenFilter as BaseTokenFilter,\n Similarity,\n LexicalTokenizer as BaseLexicalTokenizer,\n CognitiveServicesAccount as BaseCognitiveServicesAccount,\n SearchIndexerSkill as BaseSearchIndexerSkill,\n ScoringFunction as BaseScoringFunction,\n DataChangeDetectionPolicy as BaseDataChangeDetectionPolicy,\n LexicalAnalyzer as BaseLexicalAnalyzer,\n CharFilter as BaseCharFilter,\n DataDeletionDetectionPolicy as BaseDataDeletionDetectionPolicy,\n LexicalNormalizerName,\n KnownLexicalNormalizerName,\n CustomNormalizer,\n TokenFilterName,\n KnownTokenFilterName,\n CharFilterName,\n KnownCharFilterName,\n LexicalNormalizer as BaseLexicalNormalizer,\n SearchIndexerKnowledgeStoreProjection,\n SearchIndexerKnowledgeStoreFileProjectionSelector,\n SearchIndexerKnowledgeStoreBlobProjectionSelector,\n SearchIndexerKnowledgeStoreProjectionSelector,\n SearchIndexerKnowledgeStoreObjectProjectionSelector,\n SearchIndexerKnowledgeStoreTableProjectionSelector,\n PIIDetectionSkillMaskingMode,\n KnownPIIDetectionSkillMaskingMode,\n LineEnding,\n KnownLineEnding,\n SearchIndexerDataIdentity as BaseSearchIndexerDataIdentity,\n IndexerState,\n IndexerExecutionStatusDetail,\n KnownIndexerExecutionStatusDetail,\n IndexingMode,\n KnownIndexingMode,\n SemanticSettings,\n SemanticConfiguration,\n PrioritizedFields,\n SemanticField,\n SearchAlias,\n VectorSearchAlgorithmConfiguration as BaseVectorSearchAlgorithmConfiguration,\n} from \"./generated/service/models\";\nexport { AzureKeyCredential } from \"@azure/core-auth\";\nexport { createSynonymMapFromFile } from \"./synonymMapHelper\";\nexport { KnownSearchAudience } from \"./searchAudience\";\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 {\n AnswerResult,\n Answers,\n AutocompleteMode,\n CaptionResult,\n Captions,\n FacetResult,\n IndexActionType,\n QueryAnswerType,\n QueryCaptionType,\n QueryLanguage,\n QuerySpellerType,\n QueryType,\n ScoringStatistics,\n SearchMode,\n Speller,\n} from \"./generated/data/models\";\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\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 Model extends object,\n Fields extends SelectFields<Model> = SelectFields<Model>\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?: [string] extends [Fields] ? string[] : Fields[] | Readonly<Fields[]>;\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<Model extends object> = OperationOptions &\n AutocompleteRequest<Model>;\n/**\n * Options for committing a full search request.\n */\nexport type SearchOptions<\n Model extends object,\n Fields extends SelectFields<Model> = SelectFields<Model>\n> = OperationOptions & SearchRequestOptions<Model, Fields>;\n/**\n * Options for retrieving suggestions based on the searchText.\n */\nexport type SuggestOptions<\n Model extends object,\n Fields extends SelectFields<Model> = SelectFields<Model>\n> = OperationOptions & SuggestRequest<Model, Fields>;\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 Model extends object,\n Fields extends SelectFields<Model> = SelectFields<Model>\n> = PagedAsyncIterableIterator<\n SearchResult<Model, Fields>,\n SearchDocumentsPageResult<Model, Fields>,\n ListSearchResultsPageSettings\n>;\n\n/**\n * Parameters for filtering, sorting, faceting, paging, and other search query behaviors.\n */\nexport interface SearchRequest {\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 comma-separated 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'\n */\n queryType?: QueryType;\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. The default is\n * 'local'. Use 'global' to aggregate scoring statistics globally before scoring. Using global\n * scoring statistics can increase latency of search queries. Possible values include: 'Local',\n * 'Global'\n */\n scoringStatistics?: ScoringStatistics;\n /**\n * A value to be used to create a sticky session, which can help getting 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 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 name of a semantic configuration that will be used when processing documents for queries of\n * type semantic.\n */\n semanticConfiguration?: string;\n /**\n * A full-text search query expression; Use \"*\" or omit this parameter to match all documents.\n */\n searchText?: 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?: string;\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 the language of the search query.\n */\n queryLanguage?: QueryLanguage;\n /**\n * A value that specified the type of the speller to use to spell-correct individual search\n * query terms.\n */\n speller?: QuerySpellerType;\n /**\n * A value that specifies whether answers should be returned as part of the search response.\n */\n answers?: QueryAnswerType;\n /**\n * The comma-separated list of fields to retrieve. If unspecified, all fields marked as\n * retrievable in the schema are included.\n */\n select?: string;\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 * A value that specifies whether captions should be returned as part of the search response.\n */\n captions?: QueryCaptionType;\n /**\n * The comma-separated list of field names used for semantic search.\n */\n semanticFields?: string;\n}\n\n/**\n * Parameters for filtering, sorting, faceting, paging, and other search query behaviors.\n */\nexport interface SearchRequestOptions<\n Model extends object,\n Fields extends SelectFields<Model> = SelectFields<Model>\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'\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?: SelectFields<Model>[] | Readonly<SelectFields<Model>[]>;\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 * This parameter is only valid if the query type is 'semantic'. If set, the query returns answers\n * extracted from key passages in the highest ranked documents. The number of answers returned can\n * be configured by appending the pipe character '|' followed by the 'count-\\<number of answers\\>' option\n * after the answers parameter value, such as 'extractive|count-3'. Default count is 1.\n */\n answers?: Answers;\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?: [string] extends [Fields] ? string[] : Fields[] | Readonly<Fields[]>;\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 * 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 set to 'extractive',\n * highlighting is enabled by default, and can be configured by appending the pipe character '|'\n * followed by the 'highlight-true'/'highlight-false' option, such as 'extractive|highlight-true'. Defaults to 'None'.\n */\n captions?: Captions;\n /**\n * The list of field names used for semantic search.\n */\n semanticFields?: string[];\n}\n\n/**\n * Contains a document found by a search query, plus associated metadata.\n */\nexport type SearchResult<\n Model extends object,\n Fields extends SelectFields<Model> = SelectFields<Model>\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<Model>]?: 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?: CaptionResult[];\n\n document: NarrowedModel<Model, Fields>;\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?: AnswerResult[];\n}\n\n/**\n * Response containing search results from an index.\n */\nexport interface SearchDocumentsResult<\n Model extends object,\n Fields extends SelectFields<Model> = SelectFields<Model>\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<Model, Fields>;\n}\n\n/**\n * Response containing search page results from an index.\n */\nexport interface SearchDocumentsPageResult<\n Model extends object,\n Fields extends SelectFields<Model> = SelectFields<Model>\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<Model, Fields>[];\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 Model extends object,\n Fields extends SelectFields<Model> = SelectFields<Model>\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?: SelectFields<Model>[] | Readonly<SelectFields<Model>[]>;\n /**\n * The list of fields to retrieve. If unspecified, only the key field will be\n * included in the results.\n */\n select?: [string] extends [Fields] ? string[] : Fields[] | Readonly<Fields[]>;\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 Model extends object,\n Fields extends SelectFields<Model> = SelectFields<Model>\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<Model, Fields>;\n};\n\n/**\n * Response containing suggestion query results from an index.\n */\nexport interface SuggestDocumentsResult<\n Model extends object,\n Fields extends SelectFields<Model> = SelectFields<Model>\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<Model, Fields>[];\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<Model 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?: SelectFields<Model>[] | Readonly<SelectFields<Model>[]>;\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<T> = {\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<T>;\n\n// END manually modified generated interfaces\n\n// Utility types\n\nexport type UnionToIntersection<U> =\n // Distribute members of U into parameter position of a union of functions\n (\n U extends unknown ? (_: U) => 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<T extends object> = T 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 T]: Key extends string\n ? NonNullable<T[Key]> extends object\n ? NonNullable<T[Key]> extends ExcludedODataTypes\n ? // Excluded, so don't recur\n Key\n : SelectFields<NonNullable<T[Key]>> extends infer NextPaths\n ? // Narrow NextPaths' type for template literal\n NextPaths extends string\n ? // Union this key with all the next paths separated with '/'\n Key | `${Key}/${NextPaths}`\n : // We didn't infer any nested paths, so just use this key\n Key\n : never\n : // Not an object, so can't recur\n Key\n : never;\n }[keyof T & 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<T extends object, Paths extends SelectFields<T>> =\n // The default behavior of a client with no model is to return an object type\n [T] extends [never]\n ? object\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 Paths extends `${infer FieldName}/${infer RestPaths}`\n ? // Symbols and numbers are invalid types for field names\n FieldName extends keyof T & string\n ? NonNullable<T[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 T as Key & FieldName]: Array<SearchPick<Elem, RestPaths>>;\n }\n : // Unreachable by construction\n never\n : // Don't recur on arrays of non-object types\n never\n : NonNullable<T[FieldName]> extends object\n ? // Recur :)\n {\n [Key in keyof T as Key & FieldName]: RestPaths extends SelectFields<\n T[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 T[Key] & {\n // Ditto\n },\n RestPaths\n >\n | Extract<T[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 Pick<T, Paths> | Extract<T, null>\n > & {\n // This useless intersection actually prevents the TypeScript language server from\n // expanding the definition of SearchPick<T, 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<Model> = {\n [K in keyof Model as Model[K] extends string | undefined ? K : never]: Model[K];\n};\n\nexport type NarrowedModel<\n Model extends object,\n Fields extends SelectFields<Model> = SelectFields<Model>\n> =\n // Avoid calculating the type if every field is specified\n SelectFields<Model> extends Fields ? Model : SearchPick<Model, Fields>;\n\nexport type SuggestNarrowedModel<\n Model extends object,\n Fields extends SelectFields<Model> = SelectFields<Model>\n> = [Model] extends [never]\n ? // The client was instantiated with no model, so the narrowest possible result type is `object`\n object\n : // null represents the default case (no fields specified as selected)\n [Fields] extends [never]\n ? // Filter nullable (i.e. non-key) properties from the model, as they're not returned by the service by default\n keyof ExtractDocumentKey<Model> extends never\n ? // Return the original model if none of the properties are non-nullable\n Model\n : ExtractDocumentKey<Model>\n : // Fields isn't narrowed to exclude null by the first condition, so it needs to be narrowed here\n Fields extends SelectFields<Model>\n ? NarrowedModel<Model, Fields>\n : // Unreachable by construction\n never;\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 { OperationOptions } from \"@azure/core-client\";\nimport {\n AnswerResult,\n AutocompleteMode,\n CaptionResult,\n Captions,\n FacetResult,\n IndexActionType,\n QueryAnswerType,\n QueryCaptionType,\n QueryLanguage,\n QueryResultDocumentRerankerInput,\n QuerySpellerType,\n QueryType,\n ScoringStatistics,\n SearchMode,\n Speller,\n} from \"./generated/data/models\";\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\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 interface Vector<T extends object> {\n /** The vector representation of a search query. */\n value?: number[];\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<T>;\n}\n\n/**\n * Parameters for filtering, sorting, faceting, paging, and other search query behaviors.\n */\nexport interface SearchRequest<TModel extends object = never> {\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 comma-separated 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'\n */\n queryType?: QueryType;\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. The default is\n * 'local'. Use 'global' to aggregate scoring statistics globally before scoring. Using global\n * scoring statistics can increase latency of search queries. Possible values include: 'Local',\n * 'Global'\n */\n scoringStatistics?: ScoringStatistics;\n /**\n * A value to be used to create a sticky session, which can help getting 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 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 name of a semantic configuration that will be used when processing documents for queries of\n * type semantic.\n */\n semanticConfiguration?: string;\n /**\n * Allows the user to choose whether a semantic call should fail completely (default / current\n * behavior), or to return partial results.\n */\n semanticErrorHandlingMode?: SemanticErrorHandlingMode;\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 semanticMaxWaitInMilliseconds?: number;\n /**\n * Enables a debugging tool that can be used to further explore your Semantic search results.\n */\n debugMode?: QueryDebugMode;\n /**\n * A full-text search query expression; Use \"*\" or omit this parameter to match all documents.\n */\n searchText?: 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?: string;\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 the language of the search query.\n */\n queryLanguage?: QueryLanguage;\n /**\n * A value that specified the type of the speller to use to spell-correct individual search\n * query terms.\n */\n speller?: QuerySpellerType;\n /**\n * A value that specifies whether answers should be returned as part of the search response.\n */\n answers?: QueryAnswerType;\n /**\n * The comma-separated list of fields to retrieve. If unspecified, all fields marked as\n * retrievable in the schema are included.\n */\n select?: string;\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 * A value that specifies whether captions should be returned as part of the search response.\n */\n captions?: QueryCaptionType;\n /**\n * The comma-separated list of field names used for semantic search.\n */\n semanticFields?: string;\n /**\n * The query parameters for vector and hybrid search queries.\n */\n vector?: Vector<TModel>;\n}\n\n/**\n * Parameters for filtering, sorting, faceting, paging, and other search query behaviors.\n */\nexport interface SearchRequestOptions<\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 name of a semantic configuration that will be used when processing documents for queries of\n * type semantic.\n */\n semanticConfiguration?: string;\n /**\n * Allows the user to choose whether a semantic call should fail completely, or to return partial results.\n */\n semanticErrorHandlingMode?: SemanticErrorHandlingMode;\n /**\n * Allows the user to set an upper bound on the amount of time it takes for semantic enrichment to finish\n * processing before the request fails.\n */\n semanticMaxWaitInMilliseconds?: number;\n /**\n * Enables a debugging tool that can be used to further explore your search results.\n */\n debugMode?: QueryDebugMode;\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 * This parameter is only valid if the query type is 'semantic'. If set, the query returns answers\n * extracted from key passages in the highest ranked documents.\n */\n answers?: Answers | AnswersOptions;\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 * 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 set to 'extractive',\n * highlighting is enabled by default, and can be configured by appending the pipe character '|'\n * followed by the 'highlight-true'/'highlight-false' option, such as 'extractive|highlight-true'. Defaults to 'None'.\n */\n captions?: Captions;\n /**\n * The list of field names used for semantic search.\n */\n semanticFields?: string[];\n\n /**\n * The query parameters for vector and hybrid search queries.\n */\n vector?: Vector<TModel>;\n}\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?: CaptionResult[];\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?: AnswerResult[];\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 semanticPartialResponseReason?: SemanticPartialResponseReason;\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 semanticPartialResponseType?: SemanticPartialResponseType;\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<T> = {\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<T>;\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> = (<T>() => T extends TModel\n ? true\n : 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 <T>() => T extends never\n ? true\n : 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\n>() => 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<SearchPick<Elem, RestPaths>>;\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 ? true : false\n ? TModel\n : (<T>() => T extends TFields ? true : false) extends <T>() => T extends never ? true : false\n ? // If fields aren't specified, this object can't exist\n never\n : (<T>() => T extends TFields ? true : false) extends <T>() => T extends SelectFields<TModel>\n ? true\n : 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> = (<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\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 * This parameter is only valid if the query type is 'semantic'. If set, the query returns answers\n * extracted from key passages in the highest ranked documents. The number of answers returned can\n * be configured by appending the pipe character '|' followed by the 'count-\\<number of answers\\>' option\n * after the answers parameter value, such as 'extractive|count-3'. Default count is 1. The\n * confidence threshold can be configured by appending the pipe character '|' followed by the\n * 'threshold-\\<confidence threshold\\>' option after the answers parameter value, such as\n * 'extractive|threshold-0.9'. Default threshold is 0.7.\n */\nexport type Answers = string;\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 AnswersOptions =\n | {\n /**\n * Extracts answer candidates from the contents of the documents returned in response to a\n * query expressed as a question in natural language.\n */\n answers: \"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 * Do not return answers for the query.\n */\n answers: \"none\";\n };\n\n/**\n * maxWaitExceeded: If 'semanticMaxWaitInMilliseconds' was set and the semantic processing duration\n * exceeded that value. Only the base results were returned.\n *\n * capacityOverloaded: The request was throttled. Only the base results were returned.\n *\n * transient: At least one step of the semantic process failed.\n */\nexport type SemanticPartialResponseReason = \"maxWaitExceeded\" | \"capacityOverloaded\" | \"transient\";\n\n/**\n * baseResults: Results without any semantic enrichment or reranking.\n *\n * rerankedResults: Results have been reranked with the reranker model and will include semantic\n * captions. They will not include any answers, answers highlights or caption highlights.\n */\nexport type SemanticPartialResponseType = \"baseResults\" | \"rerankedResults\";\n\n/**\n * disabled: No query debugging information will be returned.\n *\n * semantic: Allows the user to further explore their Semantic search results.\n */\nexport type QueryDebugMode = \"disabled\" | \"semantic\";\n\n/**\n * partial: If the semantic processing fails, partial results still return. The definition of\n * partial results depends on what semantic step failed and what was the reason for failure.\n *\n * fail: If there is an exception during the semantic processing step, the query will fail and\n * return the appropriate HTTP code depending on the error.\n */\nexport type SemanticErrorHandlingMode = \"partial\" | \"fail\";\n\n/**\n * used: The field was fully used for semantic enrichment.\n *\n * unused: The field was not used for semantic enrichment.\n *\n * partial: The field was partially used for semantic enrichment.\n */\nexport type SemanticFieldState = \"used\" | \"unused\" | \"partial\";\n"]}
|
|
@@ -137,7 +137,7 @@ export class SearchClient {
|
|
|
137
137
|
* import {
|
|
138
138
|
* AzureKeyCredential,
|
|
139
139
|
* SearchClient,
|
|
140
|
-
*
|
|
140
|
+
* SearchFieldArray,
|
|
141
141
|
* } from "@azure/search-documents";
|
|
142
142
|
*
|
|
143
143
|
* type TModel = {
|
|
@@ -151,7 +151,7 @@ export class SearchClient {
|
|
|
151
151
|
* new AzureKeyCredential("key")
|
|
152
152
|
* );
|
|
153
153
|
*
|
|
154
|
-
* const searchFields:
|
|
154
|
+
* const searchFields: SearchFieldArray<TModel> = ["azure/sdk"];
|
|
155
155
|
*
|
|
156
156
|
* const autocompleteResult = await client.autocomplete(
|
|
157
157
|
* "searchText",
|
|
@@ -161,8 +161,7 @@ export class SearchClient {
|
|
|
161
161
|
* ```
|
|
162
162
|
*/
|
|
163
163
|
async autocomplete(searchText, suggesterName, options = {}) {
|
|
164
|
-
const {
|
|
165
|
-
const { searchFields } = restOptions, nonFieldOptions = __rest(restOptions, ["searchFields"]);
|
|
164
|
+
const { searchFields } = options, nonFieldOptions = __rest(options, ["searchFields"]);
|
|
166
165
|
const fullOptions = Object.assign({ searchText: searchText, suggesterName: suggesterName, searchFields: this.convertSearchFields(searchFields) }, nonFieldOptions);
|
|
167
166
|
if (!fullOptions.searchText) {
|
|
168
167
|
throw new RangeError("searchText must be provided.");
|
|
@@ -170,7 +169,7 @@ export class SearchClient {
|
|
|
170
169
|
if (!fullOptions.suggesterName) {
|
|
171
170
|
throw new RangeError("suggesterName must be provided.");
|
|
172
171
|
}
|
|
173
|
-
const { span, updatedOptions } = createSpan("SearchClient-autocomplete",
|
|
172
|
+
const { span, updatedOptions } = createSpan("SearchClient-autocomplete", options);
|
|
174
173
|
try {
|
|
175
174
|
const result = await this.client.documents.autocompletePost(fullOptions, updatedOptions);
|
|
176
175
|
return result;
|
|
@@ -187,22 +186,16 @@ export class SearchClient {
|
|
|
187
186
|
}
|
|
188
187
|
}
|
|
189
188
|
async searchDocuments(searchText, options = {}, nextPageParameters = {}) {
|
|
190
|
-
const {
|
|
191
|
-
const {
|
|
192
|
-
const
|
|
193
|
-
const { span, updatedOptions } = createSpan("SearchClient-searchDocuments", operationOptions);
|
|
189
|
+
const { searchFields, semanticFields, select, orderBy, includeTotalCount, vector, answers, semanticErrorHandlingMode, debugMode } = options, restOptions = __rest(options, ["searchFields", "semanticFields", "select", "orderBy", "includeTotalCount", "vector", "answers", "semanticErrorHandlingMode", "debugMode"]);
|
|
190
|
+
const fullOptions = Object.assign(Object.assign(Object.assign({}, restOptions), nextPageParameters), { searchFields: this.convertSearchFields(searchFields), semanticFields: this.convertSemanticFields(semanticFields), select: this.convertSelect(select) || "*", orderBy: this.convertOrderBy(orderBy), includeTotalResultCount: includeTotalCount, vector: this.convertVector(vector), answers: this.convertAnswers(answers), semanticErrorHandling: semanticErrorHandlingMode, debug: debugMode });
|
|
191
|
+
const { span, updatedOptions } = createSpan("SearchClient-searchDocuments", options);
|
|
194
192
|
try {
|
|
195
|
-
const result = await this.client.documents.searchPost(Object.assign(Object.assign({}, fullOptions), {
|
|
196
|
-
const { results,
|
|
193
|
+
const result = await this.client.documents.searchPost(Object.assign(Object.assign({}, fullOptions), { searchText: searchText }), updatedOptions);
|
|
194
|
+
const { results, nextLink, nextPageParameters: resultNextPageParameters, semanticPartialResponseReason, semanticPartialResponseType } = result, restResult = __rest(result, ["results", "nextLink", "nextPageParameters", "semanticPartialResponseReason", "semanticPartialResponseType"]);
|
|
197
195
|
const modifiedResults = utils.generatedSearchResultToPublicSearchResult(results);
|
|
198
|
-
const converted = {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
coverage,
|
|
202
|
-
facets,
|
|
203
|
-
answers,
|
|
204
|
-
continuationToken: this.encodeContinuationToken(nextLink, result.nextPageParameters),
|
|
205
|
-
};
|
|
196
|
+
const converted = Object.assign(Object.assign({}, restResult), { results: modifiedResults, semanticPartialResponseReason: semanticPartialResponseReason, semanticPartialResponseType: semanticPartialResponseType, continuationToken: this.encodeContinuationToken(nextLink, resultNextPageParameters
|
|
197
|
+
? utils.generatedSearchRequestToPublicSearchRequest(resultNextPageParameters)
|
|
198
|
+
: resultNextPageParameters) });
|
|
206
199
|
return deserialize(converted);
|
|
207
200
|
}
|
|
208
201
|
catch (e) {
|
|
@@ -284,7 +277,7 @@ export class SearchClient {
|
|
|
284
277
|
* import {
|
|
285
278
|
* AzureKeyCredential,
|
|
286
279
|
* SearchClient,
|
|
287
|
-
*
|
|
280
|
+
* SearchFieldArray,
|
|
288
281
|
* } from "@azure/search-documents";
|
|
289
282
|
*
|
|
290
283
|
* type TModel = {
|
|
@@ -299,7 +292,7 @@ export class SearchClient {
|
|
|
299
292
|
* );
|
|
300
293
|
*
|
|
301
294
|
* const select = ["azure/sdk"] as const;
|
|
302
|
-
* const searchFields:
|
|
295
|
+
* const searchFields: SearchFieldArray<TModel> = ["azure/sdk"];
|
|
303
296
|
*
|
|
304
297
|
* const searchResult = await client.search("searchText", {
|
|
305
298
|
* select,
|
|
@@ -311,14 +304,7 @@ export class SearchClient {
|
|
|
311
304
|
const { span, updatedOptions } = createSpan("SearchClient-search", options);
|
|
312
305
|
try {
|
|
313
306
|
const pageResult = await this.searchDocuments(searchText, updatedOptions);
|
|
314
|
-
|
|
315
|
-
return {
|
|
316
|
-
count,
|
|
317
|
-
coverage,
|
|
318
|
-
facets,
|
|
319
|
-
answers,
|
|
320
|
-
results: this.listSearchResults(pageResult, searchText, updatedOptions),
|
|
321
|
-
};
|
|
307
|
+
return Object.assign(Object.assign({}, pageResult), { results: this.listSearchResults(pageResult, searchText, updatedOptions) });
|
|
322
308
|
}
|
|
323
309
|
catch (e) {
|
|
324
310
|
span.setStatus({
|
|
@@ -342,7 +328,7 @@ export class SearchClient {
|
|
|
342
328
|
* import {
|
|
343
329
|
* AzureKeyCredential,
|
|
344
330
|
* SearchClient,
|
|
345
|
-
*
|
|
331
|
+
* SearchFieldArray,
|
|
346
332
|
* } from "@azure/search-documents";
|
|
347
333
|
*
|
|
348
334
|
* type TModel = {
|
|
@@ -357,7 +343,7 @@ export class SearchClient {
|
|
|
357
343
|
* );
|
|
358
344
|
*
|
|
359
345
|
* const select = ["azure/sdk"] as const;
|
|
360
|
-
* const searchFields:
|
|
346
|
+
* const searchFields: SearchFieldArray<TModel> = ["azure/sdk"];
|
|
361
347
|
*
|
|
362
348
|
* const suggestResult = await client.suggest("searchText", "suggesterName", {
|
|
363
349
|
* select,
|
|
@@ -366,8 +352,7 @@ export class SearchClient {
|
|
|
366
352
|
* ```
|
|
367
353
|
*/
|
|
368
354
|
async suggest(searchText, suggesterName, options = {}) {
|
|
369
|
-
const {
|
|
370
|
-
const { select, searchFields, orderBy } = restOptions, nonFieldOptions = __rest(restOptions, ["select", "searchFields", "orderBy"]);
|
|
355
|
+
const { select, searchFields, orderBy } = options, nonFieldOptions = __rest(options, ["select", "searchFields", "orderBy"]);
|
|
371
356
|
const fullOptions = Object.assign({ searchText: searchText, suggesterName: suggesterName, searchFields: this.convertSearchFields(searchFields), select: this.convertSelect(select), orderBy: this.convertOrderBy(orderBy) }, nonFieldOptions);
|
|
372
357
|
if (!fullOptions.searchText) {
|
|
373
358
|
throw new RangeError("searchText must be provided.");
|
|
@@ -375,7 +360,7 @@ export class SearchClient {
|
|
|
375
360
|
if (!fullOptions.suggesterName) {
|
|
376
361
|
throw new RangeError("suggesterName must be provided.");
|
|
377
362
|
}
|
|
378
|
-
const { span, updatedOptions } = createSpan("SearchClient-suggest",
|
|
363
|
+
const { span, updatedOptions } = createSpan("SearchClient-suggest", options);
|
|
379
364
|
try {
|
|
380
365
|
const result = await this.client.documents.suggestPost(fullOptions, updatedOptions);
|
|
381
366
|
const modifiedResult = utils.generatedSuggestDocumentsResultToPublicSuggestDocumentsResult(result);
|
|
@@ -576,24 +561,18 @@ export class SearchClient {
|
|
|
576
561
|
throw new Error(`Corrupted or invalid continuation token: ${decodedToken}`);
|
|
577
562
|
}
|
|
578
563
|
}
|
|
579
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
580
|
-
extractOperationOptions(obj) {
|
|
581
|
-
const { abortSignal, requestOptions, tracingOptions } = obj, restOptions = __rest(obj, ["abortSignal", "requestOptions", "tracingOptions"]);
|
|
582
|
-
return {
|
|
583
|
-
operationOptions: {
|
|
584
|
-
abortSignal,
|
|
585
|
-
requestOptions,
|
|
586
|
-
tracingOptions,
|
|
587
|
-
},
|
|
588
|
-
restOptions,
|
|
589
|
-
};
|
|
590
|
-
}
|
|
591
564
|
convertSelect(select) {
|
|
592
565
|
if (select) {
|
|
593
566
|
return select.join(",");
|
|
594
567
|
}
|
|
595
568
|
return select;
|
|
596
569
|
}
|
|
570
|
+
convertVectorFields(fields) {
|
|
571
|
+
if (fields) {
|
|
572
|
+
return fields.join(",");
|
|
573
|
+
}
|
|
574
|
+
return fields;
|
|
575
|
+
}
|
|
597
576
|
convertSearchFields(searchFields) {
|
|
598
577
|
if (searchFields) {
|
|
599
578
|
return searchFields.join(",");
|
|
@@ -612,5 +591,31 @@ export class SearchClient {
|
|
|
612
591
|
}
|
|
613
592
|
return orderBy;
|
|
614
593
|
}
|
|
594
|
+
convertAnswers(answers) {
|
|
595
|
+
if (!answers || typeof answers === "string") {
|
|
596
|
+
return answers;
|
|
597
|
+
}
|
|
598
|
+
if (answers.answers === "none") {
|
|
599
|
+
return answers.answers;
|
|
600
|
+
}
|
|
601
|
+
const config = [];
|
|
602
|
+
const { answers: output, count, threshold } = answers;
|
|
603
|
+
if (count) {
|
|
604
|
+
config.push(`count-${count}`);
|
|
605
|
+
}
|
|
606
|
+
if (threshold) {
|
|
607
|
+
config.push(`threshold-${threshold}`);
|
|
608
|
+
}
|
|
609
|
+
if (config.length) {
|
|
610
|
+
return output + `|${config.join(",")}`;
|
|
611
|
+
}
|
|
612
|
+
return output;
|
|
613
|
+
}
|
|
614
|
+
convertVector(vector) {
|
|
615
|
+
if (!vector) {
|
|
616
|
+
return vector;
|
|
617
|
+
}
|
|
618
|
+
return Object.assign(Object.assign({}, vector), { fields: this.convertVectorFields(vector === null || vector === void 0 ? void 0 : vector.fields) });
|
|
619
|
+
}
|
|
615
620
|
}
|
|
616
621
|
//# sourceMappingURL=searchClient.js.map
|