@azure/search-documents 12.0.0-beta.4 → 12.1.0-beta.1
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 +52 -32
- package/dist/index.js +13493 -13180
- package/dist/index.js.map +1 -1
- package/dist-esm/src/constants.js +2 -1
- package/dist-esm/src/constants.js.map +1 -1
- package/dist-esm/src/errorModels.js +4 -0
- package/dist-esm/src/errorModels.js.map +1 -0
- package/dist-esm/src/generated/data/models/index.js +37 -53
- package/dist-esm/src/generated/data/models/index.js.map +1 -1
- package/dist-esm/src/generated/data/models/mappers.js +398 -331
- package/dist-esm/src/generated/data/models/mappers.js.map +1 -1
- package/dist-esm/src/generated/data/models/parameters.js +195 -195
- package/dist-esm/src/generated/data/models/parameters.js.map +1 -1
- package/dist-esm/src/generated/data/operations/documents.js +41 -41
- package/dist-esm/src/generated/data/operations/documents.js.map +1 -1
- package/dist-esm/src/generated/data/operationsInterfaces/documents.js.map +1 -1
- package/dist-esm/src/generated/data/searchClient.js +30 -4
- package/dist-esm/src/generated/data/searchClient.js.map +1 -1
- package/dist-esm/src/generated/service/models/index.js +138 -69
- package/dist-esm/src/generated/service/models/index.js.map +1 -1
- package/dist-esm/src/generated/service/models/mappers.js +1821 -1663
- package/dist-esm/src/generated/service/models/mappers.js.map +1 -1
- package/dist-esm/src/generated/service/models/parameters.js +64 -64
- package/dist-esm/src/generated/service/models/parameters.js.map +1 -1
- package/dist-esm/src/generated/service/operations/aliases.js +22 -22
- package/dist-esm/src/generated/service/operations/aliases.js.map +1 -1
- package/dist-esm/src/generated/service/operations/dataSources.js +23 -23
- package/dist-esm/src/generated/service/operations/dataSources.js.map +1 -1
- package/dist-esm/src/generated/service/operations/indexers.js +36 -36
- package/dist-esm/src/generated/service/operations/indexers.js.map +1 -1
- package/dist-esm/src/generated/service/operations/indexes.js +30 -30
- package/dist-esm/src/generated/service/operations/indexes.js.map +1 -1
- package/dist-esm/src/generated/service/operations/skillsets.js +26 -26
- package/dist-esm/src/generated/service/operations/skillsets.js.map +1 -1
- package/dist-esm/src/generated/service/operations/synonymMaps.js +22 -22
- package/dist-esm/src/generated/service/operations/synonymMaps.js.map +1 -1
- package/dist-esm/src/generated/service/operationsInterfaces/aliases.js.map +1 -1
- package/dist-esm/src/generated/service/operationsInterfaces/dataSources.js.map +1 -1
- package/dist-esm/src/generated/service/operationsInterfaces/indexers.js.map +1 -1
- package/dist-esm/src/generated/service/operationsInterfaces/indexes.js.map +1 -1
- package/dist-esm/src/generated/service/operationsInterfaces/skillsets.js.map +1 -1
- package/dist-esm/src/generated/service/operationsInterfaces/synonymMaps.js.map +1 -1
- package/dist-esm/src/generated/service/searchServiceClient.js +35 -9
- package/dist-esm/src/generated/service/searchServiceClient.js.map +1 -1
- package/dist-esm/src/generatedStringLiteralUnions.js +4 -0
- package/dist-esm/src/generatedStringLiteralUnions.js.map +1 -0
- package/dist-esm/src/index.js +8 -9
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/indexDocumentsBatch.js.map +1 -1
- package/dist-esm/src/indexModels.js.map +1 -1
- package/dist-esm/src/odata.js.map +1 -1
- package/dist-esm/src/odataMetadataPolicy.js.map +1 -1
- package/dist-esm/src/searchApiKeyCredentialPolicy.js.map +1 -1
- package/dist-esm/src/searchClient.js +36 -27
- package/dist-esm/src/searchClient.js.map +1 -1
- package/dist-esm/src/searchIndexClient.js +15 -29
- package/dist-esm/src/searchIndexClient.js.map +1 -1
- package/dist-esm/src/searchIndexerClient.js +9 -6
- package/dist-esm/src/searchIndexerClient.js.map +1 -1
- package/dist-esm/src/searchIndexingBufferedSender.js +3 -8
- package/dist-esm/src/searchIndexingBufferedSender.js.map +1 -1
- package/dist-esm/src/serialization.js.map +1 -1
- package/dist-esm/src/serviceModels.js.map +1 -1
- package/dist-esm/src/serviceUtils.js +44 -67
- package/dist-esm/src/serviceUtils.js.map +1 -1
- package/dist-esm/src/synonymMapHelper.browser.js.map +1 -1
- package/dist-esm/src/synonymMapHelper.js +1 -1
- package/dist-esm/src/synonymMapHelper.js.map +1 -1
- package/dist-esm/src/tracing.js +1 -1
- package/dist-esm/src/tracing.js.map +1 -1
- package/package.json +42 -43
- package/types/search-documents.d.ts +1014 -1458
package/dist-esm/src/index.js
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
|
+
export { AzureKeyCredential } from "@azure/core-auth";
|
|
4
|
+
export { KnownQueryDebugMode, KnownQueryLanguage, KnownQuerySpellerType, KnownSemanticErrorMode, KnownSemanticErrorReason, KnownSemanticFieldState, KnownSemanticSearchResultsType, KnownSpeller, KnownVectorQueryKind, } from "./generated/data/models";
|
|
5
|
+
export { KnownBlobIndexerDataToExtract, KnownBlobIndexerImageAction, KnownBlobIndexerParsingMode, KnownBlobIndexerPDFTextRotationAlgorithm, KnownCharFilterName, KnownCustomEntityLookupSkillLanguage, KnownEntityCategory, KnownEntityRecognitionSkillLanguage, KnownImageAnalysisSkillLanguage, KnownImageDetail, KnownIndexerExecutionEnvironment, KnownIndexerExecutionStatusDetail, KnownIndexingMode, KnownIndexProjectionMode, KnownKeyPhraseExtractionSkillLanguage, KnownLexicalAnalyzerName, KnownLexicalNormalizerName, KnownLexicalNormalizerName as KnownNormalizerNames, KnownLexicalTokenizerName, KnownLineEnding, KnownOcrSkillLanguage, KnownPIIDetectionSkillMaskingMode, KnownRegexFlags, KnownSearchIndexerDataSourceType, KnownSentimentSkillLanguage, KnownSplitSkillLanguage, KnownTextSplitMode, KnownTextTranslationSkillLanguage, KnownTokenFilterName, KnownVectorSearchCompressionKind, KnownVectorSearchCompressionTargetDataType, KnownVectorSearchVectorizerKind, KnownVisualFeature, } from "./generated/service/models";
|
|
6
|
+
export { default as GeographyPoint } from "./geographyPoint";
|
|
7
|
+
export { IndexDocumentsBatch } from "./indexDocumentsBatch";
|
|
8
|
+
export { odata } from "./odata";
|
|
9
|
+
export { KnownSearchAudience } from "./searchAudience";
|
|
3
10
|
export { SearchClient } from "./searchClient";
|
|
4
|
-
export { DEFAULT_BATCH_SIZE, DEFAULT_FLUSH_WINDOW, DEFAULT_RETRY_COUNT, } from "./searchIndexingBufferedSender";
|
|
5
|
-
export { SearchIndexingBufferedSender } from "./searchIndexingBufferedSender";
|
|
6
11
|
export { SearchIndexClient } from "./searchIndexClient";
|
|
7
12
|
export { SearchIndexerClient } from "./searchIndexerClient";
|
|
13
|
+
export { DEFAULT_BATCH_SIZE, DEFAULT_FLUSH_WINDOW, DEFAULT_RETRY_COUNT, SearchIndexingBufferedSender, } from "./searchIndexingBufferedSender";
|
|
8
14
|
export { KnownAnalyzerNames, KnownCharFilterNames, KnownTokenFilterNames, KnownTokenizerNames, } from "./serviceModels";
|
|
9
|
-
export { default as GeographyPoint } from "./geographyPoint";
|
|
10
|
-
export { odata } from "./odata";
|
|
11
|
-
export { IndexDocumentsBatch } from "./indexDocumentsBatch";
|
|
12
|
-
export { KnownAnswers, KnownQueryLanguage, KnownSpeller, KnownQuerySpellerType, KnownQueryAnswerType, KnownQueryCaptionType, } from "./generated/data/models";
|
|
13
|
-
export { KnownRegexFlags, KnownCustomEntityLookupSkillLanguage, KnownSentimentSkillLanguage, KnownSplitSkillLanguage, KnownTextSplitMode, KnownTextTranslationSkillLanguage, KnownEntityCategory, KnownEntityRecognitionSkillLanguage, KnownImageAnalysisSkillLanguage, KnownImageDetail, KnownVisualFeature, KnownKeyPhraseExtractionSkillLanguage, KnownOcrSkillLanguage, KnownSearchIndexerDataSourceType, KnownLexicalAnalyzerName, KnownBlobIndexerDataToExtract, KnownBlobIndexerImageAction, KnownBlobIndexerParsingMode, KnownBlobIndexerPDFTextRotationAlgorithm, KnownLexicalNormalizerName, KnownTokenFilterName, KnownCharFilterName, KnownPIIDetectionSkillMaskingMode, KnownLineEnding, KnownIndexerExecutionStatusDetail, KnownIndexingMode, } from "./generated/service/models";
|
|
14
|
-
export { AzureKeyCredential } from "@azure/core-auth";
|
|
15
15
|
export { createSynonymMapFromFile } from "./synonymMapHelper";
|
|
16
|
-
export { KnownSearchAudience } from "./searchAudience";
|
|
17
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -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;AAyDxC,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,GA8EpB,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,GASlB,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 AnswersOptions,\n DocumentDebugInfo,\n SemanticDebugInfo,\n QueryResultDocumentSemanticField,\n Answers,\n VectorQuery,\n BaseVectorQuery,\n RawVectorQuery,\n VectorizableTextQuery,\n VectorQueryKind,\n VectorFilterMode,\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 SearchIndexerIndexProjections,\n SearchIndexerIndexProjectionsParameters,\n VectorSearchVectorizer,\n ExhaustiveKnnParameters,\n AzureOpenAIParameters,\n CustomVectorizerParameters,\n VectorSearchAlgorithmKind,\n VectorSearchVectorizerKind,\n AzureOpenAIEmbeddingSkill,\n AzureOpenAIVectorizer,\n CustomVectorizer,\n ExhaustiveKnnVectorSearchAlgorithmConfiguration,\n IndexProjectionMode,\n BaseVectorSearchAlgorithmConfiguration,\n BaseVectorSearchVectorizer,\n SearchIndexerKnowledgeStoreParameters,\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 NativeBlobSoftDeleteDeletionDetectionPolicy,\n SearchIndexerIndexProjectionSelector,\n VectorSearchProfile,\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,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAQL,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EACvB,8BAA8B,EAC9B,YAAY,EACZ,oBAAoB,GAYrB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAkDL,6BAA6B,EAC7B,2BAA2B,EAC3B,2BAA2B,EAC3B,wCAAwC,EACxC,mBAAmB,EACnB,oCAAoC,EACpC,mBAAmB,EACnB,mCAAmC,EACnC,+BAA+B,EAC/B,gBAAgB,EAChB,gCAAgC,EAChC,iCAAiC,EACjC,iBAAiB,EACjB,wBAAwB,EACxB,qCAAqC,EACrC,wBAAwB,EACxB,0BAA0B,EAC1B,0BAA0B,IAAI,oBAAoB,EAClD,yBAAyB,EACzB,eAAe,EACf,qBAAqB,EACrB,iCAAiC,EACjC,eAAe,EACf,gCAAgC,EAChC,2BAA2B,EAC3B,uBAAuB,EACvB,kBAAkB,EAClB,iCAAiC,EACjC,oBAAoB,EACpB,gCAAgC,EAChC,0CAA0C,EAC1C,+BAA+B,EAC/B,kBAAkB,GAuFnB,MAAM,4BAA4B,CAAC;AA+BpC,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAuD5D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAuB,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAA4B,MAAM,qBAAqB,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAA8B,MAAM,uBAAuB,CAAC;AACxF,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EAEnB,4BAA4B,GAC7B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EA2DL,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,GAmDpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport { AzureKeyCredential } from \"@azure/core-auth\";\nexport {\n AutocompleteItem,\n AutocompleteMode,\n AutocompleteResult,\n FacetResult,\n IndexActionType,\n IndexDocumentsResult,\n IndexingResult,\n KnownQueryDebugMode,\n KnownQueryLanguage,\n KnownQuerySpellerType,\n KnownSemanticErrorMode,\n KnownSemanticErrorReason,\n KnownSemanticFieldState,\n KnownSemanticSearchResultsType,\n KnownSpeller,\n KnownVectorQueryKind,\n QueryAnswerResult,\n QueryCaptionResult,\n QueryDebugMode,\n QueryLanguage,\n QueryResultDocumentRerankerInput,\n QuerySpellerType,\n QueryType,\n ScoringStatistics,\n SearchMode,\n SemanticFieldState,\n Speller,\n} from \"./generated/data/models\";\nexport {\n AnalyzedTokenInfo,\n AnalyzeResult,\n AsciiFoldingTokenFilter,\n AzureActiveDirectoryApplicationCredentials,\n AzureMachineLearningSkill,\n BaseVectorSearchCompressionConfiguration,\n BM25Similarity,\n CharFilter as BaseCharFilter,\n CharFilterName,\n CjkBigramTokenFilter,\n CjkBigramTokenFilterScripts,\n ClassicSimilarity,\n ClassicTokenizer,\n CognitiveServicesAccount as BaseCognitiveServicesAccount,\n CognitiveServicesAccountKey,\n CommonGramTokenFilter,\n ConditionalSkill,\n CorsOptions,\n CustomEntity,\n CustomEntityAlias,\n CustomNormalizer,\n DataChangeDetectionPolicy as BaseDataChangeDetectionPolicy,\n DataDeletionDetectionPolicy as BaseDataDeletionDetectionPolicy,\n DefaultCognitiveServicesAccount,\n DictionaryDecompounderTokenFilter,\n DistanceScoringFunction,\n DistanceScoringParameters,\n DocumentExtractionSkill,\n EdgeNGramTokenFilterSide,\n EdgeNGramTokenizer,\n ElisionTokenFilter,\n EntityLinkingSkill,\n EntityRecognitionSkillV3,\n FieldMapping,\n FieldMappingFunction,\n FreshnessScoringFunction,\n FreshnessScoringParameters,\n HighWaterMarkChangeDetectionPolicy,\n IndexerExecutionResult,\n IndexerExecutionStatus,\n IndexerExecutionStatusDetail,\n IndexerState,\n IndexerStatus,\n IndexingMode,\n IndexingSchedule,\n IndexProjectionMode,\n InputFieldMappingEntry,\n KeepTokenFilter,\n KeywordMarkerTokenFilter,\n KnownBlobIndexerDataToExtract,\n KnownBlobIndexerImageAction,\n KnownBlobIndexerParsingMode,\n KnownBlobIndexerPDFTextRotationAlgorithm,\n KnownCharFilterName,\n KnownCustomEntityLookupSkillLanguage,\n KnownEntityCategory,\n KnownEntityRecognitionSkillLanguage,\n KnownImageAnalysisSkillLanguage,\n KnownImageDetail,\n KnownIndexerExecutionEnvironment,\n KnownIndexerExecutionStatusDetail,\n KnownIndexingMode,\n KnownIndexProjectionMode,\n KnownKeyPhraseExtractionSkillLanguage,\n KnownLexicalAnalyzerName,\n KnownLexicalNormalizerName,\n KnownLexicalNormalizerName as KnownNormalizerNames,\n KnownLexicalTokenizerName,\n KnownLineEnding,\n KnownOcrSkillLanguage,\n KnownPIIDetectionSkillMaskingMode,\n KnownRegexFlags,\n KnownSearchIndexerDataSourceType,\n KnownSentimentSkillLanguage,\n KnownSplitSkillLanguage,\n KnownTextSplitMode,\n KnownTextTranslationSkillLanguage,\n KnownTokenFilterName,\n KnownVectorSearchCompressionKind,\n KnownVectorSearchCompressionTargetDataType,\n KnownVectorSearchVectorizerKind,\n KnownVisualFeature,\n LanguageDetectionSkill,\n LengthTokenFilter,\n LexicalAnalyzer as BaseLexicalAnalyzer,\n LexicalAnalyzerName,\n LexicalNormalizer as BaseLexicalNormalizer,\n LexicalNormalizerName,\n LexicalTokenizer as BaseLexicalTokenizer,\n LexicalTokenizerName,\n LimitTokenFilter,\n LineEnding,\n LuceneStandardAnalyzer,\n MagnitudeScoringFunction,\n MagnitudeScoringParameters,\n MappingCharFilter,\n MergeSkill,\n MicrosoftLanguageStemmingTokenizer,\n MicrosoftLanguageTokenizer,\n MicrosoftStemmingTokenizerLanguage,\n MicrosoftTokenizerLanguage,\n NativeBlobSoftDeleteDeletionDetectionPolicy,\n NGramTokenizer,\n OutputFieldMappingEntry,\n PathHierarchyTokenizerV2 as PathHierarchyTokenizer,\n PatternCaptureTokenFilter,\n PatternReplaceCharFilter,\n PatternReplaceTokenFilter,\n PhoneticEncoder,\n PhoneticTokenFilter,\n ResourceCounter,\n ScalarQuantizationCompressionConfiguration,\n ScalarQuantizationParameters,\n ScoringFunction as BaseScoringFunction,\n ScoringFunctionAggregation,\n ScoringFunctionInterpolation,\n SearchAlias,\n SearchIndexerDataContainer,\n SearchIndexerDataIdentity as BaseSearchIndexerDataIdentity,\n SearchIndexerDataNoneIdentity,\n SearchIndexerDataUserAssignedIdentity,\n SearchIndexerError,\n SearchIndexerIndexProjectionSelector,\n SearchIndexerKnowledgeStoreBlobProjectionSelector,\n SearchIndexerKnowledgeStoreFileProjectionSelector,\n SearchIndexerKnowledgeStoreObjectProjectionSelector,\n SearchIndexerKnowledgeStoreProjection,\n SearchIndexerKnowledgeStoreProjectionSelector,\n SearchIndexerKnowledgeStoreTableProjectionSelector,\n SearchIndexerLimits,\n SearchIndexerSkill as BaseSearchIndexerSkill,\n SearchIndexerStatus,\n SearchIndexerWarning,\n SemanticConfiguration,\n SemanticField,\n SemanticPrioritizedFields,\n SemanticSearch,\n SentimentSkillV3,\n ServiceCounters,\n ServiceLimits,\n ShaperSkill,\n ShingleTokenFilter,\n Similarity,\n SnowballTokenFilter,\n SnowballTokenFilterLanguage,\n SoftDeleteColumnDeletionDetectionPolicy,\n SqlIntegratedChangeTrackingPolicy,\n StemmerOverrideTokenFilter,\n StemmerTokenFilter,\n StemmerTokenFilterLanguage,\n StopAnalyzer,\n StopwordsList,\n StopwordsTokenFilter,\n Suggester as SearchSuggester,\n SynonymTokenFilter,\n TagScoringFunction,\n TagScoringParameters,\n TextWeights,\n TokenCharacterKind,\n TokenFilter as BaseTokenFilter,\n TokenFilterName,\n TruncateTokenFilter,\n UaxUrlEmailTokenizer,\n UniqueTokenFilter,\n VectorSearchCompressionKind,\n VectorSearchCompressionTargetDataType,\n VectorSearchProfile,\n WordDelimiterTokenFilter,\n} from \"./generated/service/models\";\nexport {\n BlobIndexerDataToExtract,\n BlobIndexerImageAction,\n BlobIndexerParsingMode,\n BlobIndexerPDFTextRotationAlgorithm,\n CustomEntityLookupSkillLanguage,\n EntityCategory,\n EntityRecognitionSkillLanguage,\n ImageAnalysisSkillLanguage,\n ImageDetail,\n IndexerExecutionEnvironment,\n KeyPhraseExtractionSkillLanguage,\n OcrSkillLanguage,\n PIIDetectionSkillMaskingMode,\n RegexFlags,\n SearchIndexerDataSourceType,\n SemanticErrorMode,\n SemanticErrorReason,\n SemanticSearchResultsType,\n SentimentSkillLanguage,\n SplitSkillLanguage,\n TextSplitMode,\n TextTranslationSkillLanguage,\n VectorFilterMode,\n VectorQueryKind,\n VectorSearchAlgorithmKind,\n VectorSearchAlgorithmMetric,\n VectorSearchVectorizerKind,\n VisualFeature,\n} from \"./generatedStringLiteralUnions\";\nexport { default as GeographyPoint } from \"./geographyPoint\";\nexport { IndexDocumentsBatch } from \"./indexDocumentsBatch\";\nexport {\n AutocompleteOptions,\n AutocompleteRequest,\n BaseSearchRequestOptions,\n BaseVectorQuery,\n CountDocumentsOptions,\n DeleteDocumentsOptions,\n DocumentDebugInfo,\n ExcludedODataTypes,\n ExtractDocumentKey,\n ExtractiveQueryAnswer,\n ExtractiveQueryCaption,\n GetDocumentOptions,\n IndexDocumentsAction,\n IndexDocumentsOptions,\n ListSearchResultsPageSettings,\n MergeDocumentsOptions,\n MergeOrUploadDocumentsOptions,\n NarrowedModel,\n QueryAnswer,\n QueryCaption,\n QueryResultDocumentSemanticField,\n SearchDocumentsPageResult,\n SearchDocumentsResult,\n SearchDocumentsResultBase,\n SearchFieldArray,\n SearchIndexingBufferedSenderDeleteDocumentsOptions,\n SearchIndexingBufferedSenderFlushDocumentsOptions,\n SearchIndexingBufferedSenderMergeDocumentsOptions,\n SearchIndexingBufferedSenderMergeOrUploadDocumentsOptions,\n SearchIndexingBufferedSenderOptions,\n SearchIndexingBufferedSenderUploadDocumentsOptions,\n SearchIterator,\n SearchOptions,\n SearchPick,\n SearchRequestOptions,\n SearchRequestQueryTypeOptions,\n SearchResult,\n SelectArray,\n SelectFields,\n SemanticDebugInfo,\n SemanticSearchOptions,\n SuggestDocumentsResult,\n SuggestNarrowedModel,\n SuggestOptions,\n SuggestRequest,\n SuggestResult,\n UnionToIntersection,\n UploadDocumentsOptions,\n VectorizableTextQuery,\n VectorizedQuery,\n VectorQuery,\n VectorSearchOptions,\n} from \"./indexModels\";\nexport { odata } from \"./odata\";\nexport { KnownSearchAudience } from \"./searchAudience\";\nexport { SearchClient, SearchClientOptions } from \"./searchClient\";\nexport { SearchIndexClient, SearchIndexClientOptions } from \"./searchIndexClient\";\nexport { SearchIndexerClient, SearchIndexerClientOptions } from \"./searchIndexerClient\";\nexport {\n DEFAULT_BATCH_SIZE,\n DEFAULT_FLUSH_WINDOW,\n DEFAULT_RETRY_COUNT,\n IndexDocumentsClient,\n SearchIndexingBufferedSender,\n} from \"./searchIndexingBufferedSender\";\nexport {\n AliasIterator,\n AnalyzeRequest,\n AnalyzeTextOptions,\n AzureOpenAIEmbeddingSkill,\n AzureOpenAIParameters,\n AzureOpenAIVectorizer,\n BaseVectorSearchAlgorithmConfiguration,\n BaseVectorSearchVectorizer,\n CharFilter,\n CognitiveServicesAccount,\n ComplexDataType,\n ComplexField,\n CreateAliasOptions,\n CreateDataSourceConnectionOptions,\n CreateIndexerOptions,\n CreateIndexOptions,\n CreateOrUpdateAliasOptions,\n CreateorUpdateDataSourceConnectionOptions,\n CreateorUpdateIndexerOptions,\n CreateOrUpdateIndexOptions,\n CreateOrUpdateSkillsetOptions,\n CreateOrUpdateSynonymMapOptions,\n CreateSkillsetOptions,\n CreateSynonymMapOptions,\n CustomAnalyzer,\n CustomEntityLookupSkill,\n CustomVectorizer,\n CustomVectorizerParameters,\n DataChangeDetectionPolicy,\n DataDeletionDetectionPolicy,\n DeleteAliasOptions,\n DeleteDataSourceConnectionOptions,\n DeleteIndexerOptions,\n DeleteIndexOptions,\n DeleteSkillsetOptions,\n DeleteSynonymMapOptions,\n EdgeNGramTokenFilter,\n EntityRecognitionSkill,\n ExhaustiveKnnAlgorithmConfiguration,\n ExhaustiveKnnParameters,\n GetAliasOptions,\n GetDataSourceConnectionOptions,\n GetIndexerOptions,\n GetIndexerStatusOptions,\n GetIndexOptions,\n GetIndexStatisticsOptions,\n GetServiceStatisticsOptions,\n GetSkillSetOptions,\n GetSynonymMapsOptions,\n HnswAlgorithmConfiguration,\n HnswParameters,\n ImageAnalysisSkill,\n IndexingParameters,\n IndexingParametersConfiguration,\n IndexIterator,\n IndexNameIterator,\n KeyPhraseExtractionSkill,\n KeywordTokenizer,\n KnownAnalyzerNames,\n KnownCharFilterNames,\n KnownTokenFilterNames,\n KnownTokenizerNames,\n LexicalAnalyzer,\n LexicalNormalizer,\n LexicalTokenizer,\n ListAliasesOptions,\n ListDataSourceConnectionsOptions,\n ListIndexersOptions,\n ListIndexesOptions,\n ListSkillsetsOptions,\n ListSynonymMapsOptions,\n LuceneStandardTokenizer,\n NGramTokenFilter,\n OcrSkill,\n PatternAnalyzer,\n PatternTokenizer,\n PIIDetectionSkill,\n ResetDocumentsOptions,\n ResetIndexerOptions,\n ResetSkillsOptions,\n RunIndexerOptions,\n ScoringFunction,\n ScoringProfile,\n SearchField,\n SearchFieldDataType,\n SearchIndex,\n SearchIndexAlias,\n SearchIndexer,\n SearchIndexerCache,\n SearchIndexerDataIdentity,\n SearchIndexerDataSourceConnection,\n SearchIndexerIndexProjections,\n SearchIndexerIndexProjectionsParameters,\n SearchIndexerKnowledgeStore,\n SearchIndexerKnowledgeStoreParameters,\n SearchIndexerSkill,\n SearchIndexerSkillset,\n SearchIndexStatistics,\n SearchResourceEncryptionKey,\n SearchServiceStatistics,\n SentimentSkill,\n SimilarityAlgorithm,\n SimpleField,\n SplitSkill,\n SynonymMap,\n TextTranslationSkill,\n TokenFilter,\n VectorSearch,\n VectorSearchAlgorithmConfiguration,\n VectorSearchCompressionConfiguration,\n VectorSearchVectorizer,\n WebApiSkill,\n} from \"./serviceModels\";\nexport { createSynonymMapFromFile } from \"./synonymMapHelper\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexDocumentsBatch.js","sourceRoot":"","sources":["../../src/indexDocumentsBatch.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC;;;GAGG;AACH,MAAM,OAAO,mBAAmB;IAM9B,YAAY,
|
|
1
|
+
{"version":3,"file":"indexDocumentsBatch.js","sourceRoot":"","sources":["../../src/indexDocumentsBatch.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC;;;GAGG;AACH,MAAM,OAAO,mBAAmB;IAM9B,YAAY,UAA0C,EAAE;QACtD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,SAAmB;QAC/B,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAA+B,CAAC,GAAG,EAAE,EAAE;YAChE,uCACK,GAAG,KACN,YAAY,EAAE,QAAQ,IACtB;QACJ,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,SAAmB;QAC9B,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAA+B,CAAC,GAAG,EAAE,EAAE;YAChE,uCACK,GAAG,KACN,YAAY,EAAE,OAAO,IACrB;QACJ,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED;;;;OAIG;IACI,aAAa,CAAC,SAAmB;QACtC,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAA+B,CAAC,GAAG,EAAE,EAAE;YAChE,uCACK,GAAG,KACN,YAAY,EAAE,eAAe,IAC7B;QACJ,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;IAC9B,CAAC;IAeM,MAAM,CAAC,kBAA2C,EAAE,SAAoB;QAC7E,IAAI,SAAS,EAAE,CAAC;YACd,MAAM,OAAO,GAAG,kBAAkC,CAAC;YAEnD,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAA+B,CAAC,QAAQ,EAAE,EAAE;gBACrE,OAAO;oBACL,YAAY,EAAE,QAAQ;oBACtB,CAAC,OAAO,CAAC,EAAE,QAAQ;iBACY,CAAC;YACpC,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;QAC9B,CAAC;aAAM,CAAC;YACN,MAAM,SAAS,GAAG,kBAA8B,CAAC;YAEjD,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAA+B,CAAC,QAAQ,EAAE,EAAE;gBACrE,OAAO,gBACL,YAAY,EAAE,QAAQ,IACnB,QAAQ,CACoB,CAAC;YACpC,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { IndexDocumentsAction } from \"./indexModels\";\n\n/**\n * Class used to perform batch operations\n * with multiple documents to the index.\n */\nexport class IndexDocumentsBatch<TModel> {\n /**\n * The set of actions taken in this batch.\n */\n public readonly actions: IndexDocumentsAction<TModel>[];\n\n constructor(actions: IndexDocumentsAction<TModel>[] = []) {\n this.actions = actions;\n }\n\n /**\n * Upload an array of documents to the index.\n * @param documents - The documents to upload.\n */\n public upload(documents: TModel[]): void {\n const batch = documents.map<IndexDocumentsAction<TModel>>((doc) => {\n return {\n ...doc,\n __actionType: \"upload\",\n };\n });\n\n this.actions.push(...batch);\n }\n\n /**\n * Update a set of documents in the index.\n * For more details about how merging works, see https://docs.microsoft.com/en-us/rest/api/searchservice/AddUpdate-or-Delete-Documents\n * @param documents - The updated documents.\n */\n public merge(documents: TModel[]): void {\n const batch = documents.map<IndexDocumentsAction<TModel>>((doc) => {\n return {\n ...doc,\n __actionType: \"merge\",\n };\n });\n\n this.actions.push(...batch);\n }\n\n /**\n * Update a set of documents in the index or uploads them if they don't exist.\n * For more details about how merging works, see https://docs.microsoft.com/en-us/rest/api/searchservice/AddUpdate-or-Delete-Documents\n * @param documents - The new/updated documents.\n */\n public mergeOrUpload(documents: TModel[]): void {\n const batch = documents.map<IndexDocumentsAction<TModel>>((doc) => {\n return {\n ...doc,\n __actionType: \"mergeOrUpload\",\n };\n });\n\n this.actions.push(...batch);\n }\n\n /**\n * Delete a set of documents.\n * @param keyName - The name of their primary key in the index.\n * @param keyValues - The primary key values of documents to delete.\n */\n public delete(keyName: keyof TModel, keyValues: string[]): void;\n\n /**\n * Delete a set of documents.\n * @param documents - Documents to be deleted.\n */\n public delete(documents: TModel[]): void;\n\n public delete(keyNameOrDocuments: keyof TModel | TModel[], keyValues?: string[]): void {\n if (keyValues) {\n const keyName = keyNameOrDocuments as keyof TModel;\n\n const batch = keyValues.map<IndexDocumentsAction<TModel>>((keyValue) => {\n return {\n __actionType: \"delete\",\n [keyName]: keyValue,\n } as IndexDocumentsAction<TModel>;\n });\n\n this.actions.push(...batch);\n } else {\n const documents = keyNameOrDocuments as TModel[];\n\n const batch = documents.map<IndexDocumentsAction<TModel>>((document) => {\n return {\n __actionType: \"delete\",\n ...document,\n } as IndexDocumentsAction<TModel>;\n });\n\n this.actions.push(...batch);\n }\n }\n}\n"]}
|
|
@@ -1 +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 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\nexport type VectorQueryKind = \"vector\" | \"text\";\n\n/**\n * Determines whether or not filters are applied before or after the vector search is performed.\n */\nexport type VectorFilterMode = \"postFilter\" | \"preFilter\";\n\n/** The query parameters for vector and hybrid search queries. */\nexport type VectorQuery<TModel extends object> =\n | RawVectorQuery<TModel>\n | VectorizableTextQuery<TModel>;\n\n/** The query parameters for vector and hybrid search queries. */\nexport interface BaseVectorQuery<TModel extends object> {\n /** Polymorphic discriminator, which specifies the different types this object can be */\n kind: VectorQueryKind;\n /** Number of nearest neighbors to return as top hits. */\n kNearestNeighborsCount?: number;\n /** Vector Fields of type Collection(Edm.Single) to be included in the vector searched. */\n fields?: SearchFieldArray<TModel>;\n /** When true, triggers an exhaustive k-nearest neighbor search across all vectors within the vector index. Useful for scenarios where exact matches are critical, such as determining ground truth values. */\n exhaustive?: boolean;\n}\n\n/** The query parameters to use for vector search when a raw vector value is provided. */\nexport interface RawVectorQuery<TModel extends object> extends BaseVectorQuery<TModel> {\n /** Polymorphic discriminator, which specifies the different types this object can be */\n kind: \"vector\";\n /** The vector representation of a search query. */\n vector?: number[];\n}\n\n/** The query parameters to use for vector search when a text value that needs to be vectorized is provided. */\nexport interface VectorizableTextQuery<TModel extends object> extends BaseVectorQuery<TModel> {\n /** Polymorphic discriminator, which specifies the different types this object can be */\n kind: \"text\";\n /** The text to be vectorized to perform a vector search query. */\n text?: string;\n}\n\n/**\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 * Allows setting a separate search query that will be solely used for semantic reranking,\n * semantic captions and semantic answers. Is useful for scenarios where there is a need to use\n * different queries between the base retrieval and ranking phase, and the L2 semantic phase.\n */\n semanticQuery?: string;\n /**\n * The 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\n * results (default).\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, hybrid, and multi-vector search queries.\n */\n vectorQueries?: VectorQuery<TModel>[];\n /**\n * Determines whether or not filters are applied before or after the vector search is performed.\n * Default is 'preFilter'.\n */\n vectorFilterMode?: VectorFilterMode;\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 * Allows setting a separate search query that will be solely used for semantic reranking,\n * semantic captions and semantic answers. Is useful for scenarios where there is a need to use\n * different queries between the base retrieval and ranking phase, and the L2 semantic phase.\n */\n semanticQuery?: string;\n /**\n * The 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\n * partial results (default).\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 * The query parameters for vector and hybrid search queries.\n */\n vectorQueries?: VectorQuery<TModel>[];\n /**\n * Determines whether or not filters are applied before or after the vector search is performed.\n * Default is 'preFilter'.\n */\n vectorFilterMode?: VectorFilterMode;\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"]}
|
|
1
|
+
{"version":3,"file":"indexModels.js","sourceRoot":"","sources":["../../src/indexModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { OperationOptions } from \"@azure/core-client\";\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport {\n AutocompleteMode,\n FacetResult,\n IndexActionType,\n QueryAnswerResult,\n QueryCaptionResult,\n QueryDebugMode,\n QueryLanguage,\n QueryResultDocumentRerankerInput,\n QueryType,\n ScoringStatistics,\n SearchMode,\n SemanticFieldState,\n Speller,\n} from \"./generated/data/models\";\nimport {\n SemanticErrorMode,\n SemanticErrorReason,\n SemanticSearchResultsType,\n VectorFilterMode,\n VectorQueryKind,\n} from \"./generatedStringLiteralUnions\";\nimport GeographyPoint from \"./geographyPoint\";\n\n/**\n * Options for performing the count operation on the index.\n */\nexport type CountDocumentsOptions = OperationOptions;\n\n/**\n * Options for SearchIndexingBufferedSender.\n */\nexport interface SearchIndexingBufferedSenderOptions {\n /**\n * Indicates if autoFlush is enabled.\n */\n autoFlush?: boolean;\n /**\n * Initial Batch Action Count.\n *\n * A batch request will be sent once the documents\n * reach the initialBatchActionCount.\n */\n initialBatchActionCount?: number;\n /**\n * Flush Window.\n *\n * A batch request will be sent after flushWindowInMs is\n * reached.\n */\n flushWindowInMs?: number;\n /**\n * Maximum number of Retries\n */\n maxRetriesPerAction?: number;\n /**\n * Delay between retries\n */\n throttlingDelayInMs?: number;\n /**\n * Max Delay between retries\n */\n maxThrottlingDelayInMs?: number;\n}\n\n/**\n * Options for SearchIndexingBufferedSenderUploadDocuments.\n */\nexport type SearchIndexingBufferedSenderUploadDocumentsOptions = OperationOptions;\n/**\n * Options for SearchIndexingBufferedSenderMergeDocuments.\n */\nexport type SearchIndexingBufferedSenderMergeDocumentsOptions = OperationOptions;\n/**\n * Options for SearchIndexingBufferedSenderMergeOrUploadDocuments.\n */\nexport type SearchIndexingBufferedSenderMergeOrUploadDocumentsOptions = OperationOptions;\n/**\n * Options for SearchIndexingBufferedSenderDeleteDocuments.\n */\nexport type SearchIndexingBufferedSenderDeleteDocumentsOptions = OperationOptions;\n/**\n * Options for SearchIndexingBufferedSenderFlushDocuments.\n */\nexport type SearchIndexingBufferedSenderFlushDocumentsOptions = OperationOptions;\n\n/**\n * Options for retrieving a single document.\n */\nexport interface GetDocumentOptions<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> extends OperationOptions {\n /**\n * List of field names to retrieve for the document; Any field not retrieved will be missing from\n * the returned document.\n */\n selectedFields?: SelectArray<TFields>;\n}\n\n/**\n * Options for the modify index batch operation.\n */\nexport interface IndexDocumentsOptions extends OperationOptions {\n /**\n * If true, will cause this operation to throw if any document operation\n * in the batch did not succeed.\n */\n throwOnAnyFailure?: boolean;\n}\n\n/**\n * Options for the upload documents operation.\n */\nexport type UploadDocumentsOptions = IndexDocumentsOptions;\n\n/**\n * Options for the merge documents operation.\n */\nexport type MergeDocumentsOptions = IndexDocumentsOptions;\n\n/**\n * Options for the merge or upload documents operation.\n */\nexport type MergeOrUploadDocumentsOptions = IndexDocumentsOptions;\n\n/**\n * Options for the delete documents operation.\n */\nexport type DeleteDocumentsOptions = IndexDocumentsOptions;\n\n/**\n * Arguments for retrieving the next page of search results.\n */\nexport interface ListSearchResultsPageSettings {\n /**\n * A token used for retrieving the next page of results when the server\n * enforces pagination.\n */\n continuationToken?: string;\n}\n\n// BEGIN manually modified generated interfaces\n//\n// This section is for places where we have to manually fix issues\n// with interfaces from the generated code.\n// Mostly this is to allow modeling additionalProperties:true as generics.\n\n/**\n * Options for retrieving completion text for a partial searchText.\n */\nexport type AutocompleteOptions<TModel extends object> = OperationOptions &\n AutocompleteRequest<TModel>;\n/**\n * Options for committing a full search request.\n */\nexport type SearchOptions<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> = OperationOptions & SearchRequestOptions<TModel, TFields>;\n/**\n * Options for retrieving suggestions based on the searchText.\n */\nexport type SuggestOptions<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> = OperationOptions & SuggestRequest<TModel, TFields>;\n\n/**\n * An iterator for search results of a paticular query. Will make requests\n * as needed during iteration. Use .byPage() to make one request to the server\n * per iteration.\n */\nexport type SearchIterator<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> = PagedAsyncIterableIterator<\n SearchResult<TModel, TFields>,\n SearchDocumentsPageResult<TModel, TFields>,\n ListSearchResultsPageSettings\n>;\n\n/** The query parameters for vector and hybrid search queries. */\nexport type VectorQuery<TModel extends object> =\n | VectorizedQuery<TModel>\n | VectorizableTextQuery<TModel>;\n\n/** The query parameters for vector and hybrid search queries. */\nexport interface BaseVectorQuery<TModel extends object> {\n /** Polymorphic discriminator, which specifies the different types this object can be */\n kind: VectorQueryKind;\n /** Number of nearest neighbors to return as top hits. */\n kNearestNeighborsCount?: number;\n /** Vector Fields of type Collection(Edm.Single) to be included in the vector searched. */\n fields?: SearchFieldArray<TModel>;\n /**\n * When true, triggers an exhaustive k-nearest neighbor search across all vectors within the\n * vector index. Useful for scenarios where exact matches are critical, such as determining ground\n * truth values.\n */\n exhaustive?: boolean;\n /**\n * Oversampling factor. Minimum value is 1. It overrides the 'defaultOversampling' parameter\n * configured in the index definition. It can be set only when 'rerankWithOriginalVectors' is\n * true. This parameter is only permitted when a compression method is used on the underlying\n * vector field.\n */\n oversampling?: number;\n}\n\n/** The query parameters to use for vector search when a raw vector value is provided. */\nexport interface VectorizedQuery<TModel extends object> extends BaseVectorQuery<TModel> {\n /** Polymorphic discriminator, which specifies the different types this object can be */\n kind: \"vector\";\n /** The vector representation of a search query. */\n vector: number[];\n}\n\n/** The query parameters to use for vector search when a text value that needs to be vectorized is provided. */\nexport interface VectorizableTextQuery<TModel extends object> extends BaseVectorQuery<TModel> {\n /** Polymorphic discriminator, which specifies the different types this object can be */\n kind: \"text\";\n /** The text to be vectorized to perform a vector search query. */\n text?: string;\n}\n\n/**\n * Parameters for filtering, sorting, faceting, paging, and other search query behaviors.\n */\nexport interface BaseSearchRequestOptions<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> {\n /**\n * A value that specifies whether to fetch the total count of results. Default is false. Setting\n * this value to true may have a performance impact. Note that the count returned is an\n * approximation.\n */\n includeTotalCount?: boolean;\n /**\n * The list of facet expressions to apply to the search query. Each facet expression contains a\n * field name, optionally followed by a comma-separated list of name:value pairs.\n */\n facets?: string[];\n /**\n * The OData $filter expression to apply to the search query.\n */\n filter?: string;\n /**\n * The comma-separated list of field names to use for hit highlights. Only searchable fields can\n * be used for hit highlighting.\n */\n highlightFields?: string;\n /**\n * A string tag that is appended to hit highlights. Must be set with highlightPreTag. Default is\n * </em>.\n */\n highlightPostTag?: string;\n /**\n * A string tag that is prepended to hit highlights. Must be set with highlightPostTag. Default\n * is <em>.\n */\n highlightPreTag?: string;\n /**\n * A number between 0 and 100 indicating the percentage of the index that must be covered by a\n * search query in order for the query to be reported as a success. This parameter can be useful\n * for ensuring search availability even for services with only one replica. The default is 100.\n */\n minimumCoverage?: number;\n /**\n * The list of OData $orderby expressions by which to sort the results. Each\n * expression can be either a field name or a call to either the geo.distance() or the\n * search.score() functions. Each expression can be followed by asc to indicate ascending, or\n * desc to indicate descending. The default is ascending order. Ties will be broken by the match\n * scores of documents. If no $orderby is specified, the default sort order is descending by\n * document match score. There can be at most 32 $orderby clauses.\n */\n orderBy?: string[];\n /**\n * A value that specifies the syntax of the search query. The default is 'simple'. Use 'full' if\n * your query uses the Lucene query syntax. Possible values include: 'simple', 'full', 'semantic'\n */\n queryType?: QueryType;\n /**\n * The list of parameter values to be used in scoring functions (for example,\n * referencePointParameter) using the format name-values. For example, if the scoring profile\n * defines a function with a parameter called 'mylocation' the parameter string would be\n * \"mylocation--122.2,44.8\" (without the quotes).\n */\n scoringParameters?: string[];\n /**\n * The name of a scoring profile to evaluate match scores for matching documents in order to sort\n * the results.\n */\n scoringProfile?: string;\n /**\n * The comma-separated list of field names to which to scope the full-text search. When using\n * fielded search (fieldName:searchExpression) in a full Lucene query, the field names of each\n * fielded search expression take precedence over any field names listed in this parameter.\n */\n searchFields?: SearchFieldArray<TModel>;\n /**\n * The language of the query.\n */\n queryLanguage?: QueryLanguage;\n /**\n * Improve search recall by spell-correcting individual search query terms.\n */\n speller?: Speller;\n /**\n * A value that specifies whether any or all of the search terms must be matched in order to\n * count the document as a match. Possible values include: 'any', 'all'\n */\n searchMode?: SearchMode;\n /**\n * A value that specifies whether we want to calculate scoring statistics (such as document\n * frequency) globally for more consistent scoring, or locally, for lower latency. Possible\n * values include: 'Local', 'Global'\n */\n scoringStatistics?: ScoringStatistics;\n /**\n * A value to be used to create a sticky session, which can help to get more consistent results.\n * As long as the same sessionId is used, a best-effort attempt will be made to target the same\n * replica set. Be wary that reusing the same sessionID values repeatedly can interfere with the\n * load balancing of the requests across replicas and adversely affect the performance of the\n * search service. The value used as sessionId cannot start with a '_' character.\n */\n sessionId?: string;\n /**\n * The list of fields to retrieve. If unspecified, all fields marked as\n * retrievable in the schema are included.\n */\n select?: SelectArray<TFields>;\n /**\n * The number of search results to skip. This value cannot be greater than 100,000. If you need\n * to scan documents in sequence, but cannot use skip due to this limitation, consider using\n * orderby on a totally-ordered key and filter with a range query instead.\n */\n skip?: number;\n /**\n * The number of search results to retrieve. This can be used in conjunction with $skip to\n * implement client-side paging of search results. If results are truncated due to server-side\n * paging, the response will include a continuation token that can be used to issue another\n * Search request for the next page of results.\n */\n top?: number;\n /**\n * Defines options for vector search queries\n */\n vectorSearchOptions?: VectorSearchOptions<TModel>;\n}\n\n/**\n * Parameters for filtering, sorting, faceting, paging, and other search query behaviors.\n */\nexport type SearchRequestOptions<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> = BaseSearchRequestOptions<TModel, TFields> & SearchRequestQueryTypeOptions;\n\nexport type SearchRequestQueryTypeOptions =\n | {\n queryType: \"semantic\";\n /**\n * Defines options for semantic search queries\n */\n semanticSearchOptions: SemanticSearchOptions;\n }\n | { queryType?: \"simple\" | \"full\" };\n\n/**\n * Contains a document found by a search query, plus associated metadata.\n */\nexport type SearchResult<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> = {\n /**\n * The relevance score of the document compared to other documents returned by the query.\n * **NOTE: This property will not be serialized. It can only be populated by the server.**\n */\n readonly score: number;\n /**\n * The relevance score computed by the semantic ranker for the top search results. Search results are sorted by the RerankerScore first and then by the Score. RerankerScore is only returned for queries of type 'semantic'.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly rerankerScore?: number;\n /**\n * Text fragments from the document that indicate the matching search terms, organized by each\n * applicable field; null if hit highlighting was not enabled for the query.\n * **NOTE: This property will not be serialized. It can only be populated by the server.**\n */\n readonly highlights?: { [k in SelectFields<TModel>]?: string[] };\n /**\n * Captions are the most representative passages from the document relatively to the search query. They are often used as document summary. Captions are only returned for queries of type 'semantic'.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly captions?: QueryCaptionResult[];\n\n document: NarrowedModel<TModel, TFields>;\n\n /**\n * Contains debugging information that can be used to further explore your search results.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly documentDebugInfo?: DocumentDebugInfo[];\n};\n\n/**\n * Response containing search results from an index.\n */\nexport interface SearchDocumentsResultBase {\n /**\n * The total count of results found by the search operation, or null if the count was not\n * requested. If present, the count may be greater than the number of results in this response.\n * This can happen if you use the $top or $skip parameters, or if Azure Cognitive Search can't\n * return all the requested documents in a single Search response.\n * **NOTE: This property will not be serialized. It can only be populated by the server.**\n */\n readonly count?: number;\n /**\n * A value indicating the percentage of the index that was included in the query, or null if\n * minimumCoverage was not specified in the request.\n * **NOTE: This property will not be serialized. It can only be populated by the server.**\n */\n readonly coverage?: number;\n /**\n * The facet query results for the search operation, organized as a collection of buckets for\n * each faceted field; null if the query did not include any facet expressions.\n * **NOTE: This property will not be serialized. It can only be populated by the server.**\n */\n readonly facets?: { [propertyName: string]: FacetResult[] };\n /**\n * The answers query results for the search operation; null if the answers query parameter was\n * not specified or set to 'none'.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly answers?: QueryAnswerResult[];\n /**\n * Reason that a partial response was returned for a semantic search request.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly semanticErrorReason?: SemanticErrorReason;\n /**\n * Type of partial response that was returned for a semantic search request.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly semanticSearchResultsType?: SemanticSearchResultsType;\n}\n\n/**\n * Response containing search results from an index.\n */\nexport interface SearchDocumentsResult<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> extends SearchDocumentsResultBase {\n /**\n * The sequence of results returned by the query.\n * **NOTE: This property will not be serialized. It can only be populated by the server.**\n */\n readonly results: SearchIterator<TModel, TFields>;\n}\n\n/**\n * Response containing search page results from an index.\n */\nexport interface SearchDocumentsPageResult<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> extends SearchDocumentsResultBase {\n /**\n * The sequence of results returned by the query.\n * **NOTE: This property will not be serialized. It can only be populated by the server.**\n */\n readonly results: SearchResult<TModel, TFields>[];\n /**\n * A token used for retrieving the next page of results when the server\n * enforces pagination.\n */\n continuationToken?: string;\n}\n\n/**\n * Parameters for filtering, sorting, fuzzy matching, and other suggestions query behaviors.\n */\nexport interface SuggestRequest<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> {\n /**\n * An OData expression that filters the documents considered for suggestions.\n */\n filter?: string;\n /**\n * A value indicating whether to use fuzzy matching for the suggestion query. Default is false.\n * When set to true, the query will find suggestions even if there's a substituted or missing\n * character in the search text. While this provides a better experience in some scenarios, it\n * comes at a performance cost as fuzzy suggestion searches are slower and consume more\n * resources.\n */\n useFuzzyMatching?: boolean;\n /**\n * A string tag that is appended to hit highlights. Must be set with highlightPreTag. If omitted,\n * hit highlighting of suggestions is disabled.\n */\n highlightPostTag?: string;\n /**\n * A string tag that is prepended to hit highlights. Must be set with highlightPostTag. If\n * omitted, hit highlighting of suggestions is disabled.\n */\n highlightPreTag?: string;\n /**\n * A number between 0 and 100 indicating the percentage of the index that must be covered by a\n * suggestion query in order for the query to be reported as a success. This parameter can be\n * useful for ensuring search availability even for services with only one replica. The default\n * is 80.\n */\n minimumCoverage?: number;\n /**\n * The list of OData $orderby expressions by which to sort the results. Each\n * expression can be either a field name or a call to either the geo.distance() or the\n * search.score() functions. Each expression can be followed by asc to indicate ascending, or\n * desc to indicate descending. The default is ascending order. Ties will be broken by the match\n * scores of documents. If no $orderby is specified, the default sort order is descending by\n * document match score. There can be at most 32 $orderby clauses.\n */\n orderBy?: string[];\n /**\n * The comma-separated list of field names to search for the specified search text. Target fields\n * must be included in the specified suggester.\n */\n searchFields?: SearchFieldArray<TModel>;\n /**\n * The list of fields to retrieve. If unspecified, only the key field will be\n * included in the results.\n */\n select?: SelectArray<TFields>;\n /**\n /**\n * The number of suggestions to retrieve. This must be a value between 1 and 100. The default is\n * 5.\n */\n top?: number;\n}\n\n/**\n * A result containing a document found by a suggestion query, plus associated metadata.\n */\nexport type SuggestResult<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> = {\n /**\n * The text of the suggestion result.\n * **NOTE: This property will not be serialized. It can only be populated by the server.**\n */\n readonly text: string;\n document: SuggestNarrowedModel<TModel, TFields>;\n};\n\n/**\n * Response containing suggestion query results from an index.\n */\nexport interface SuggestDocumentsResult<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> {\n /**\n * The sequence of results returned by the query.\n * **NOTE: This property will not be serialized. It can only be populated by the server.**\n */\n readonly results: SuggestResult<TModel, TFields>[];\n /**\n * A value indicating the percentage of the index that was included in the query, or null if\n * minimumCoverage was not set in the request.\n * **NOTE: This property will not be serialized. It can only be populated by the server.**\n */\n readonly coverage?: number;\n}\n\n/**\n * Parameters for fuzzy matching, and other autocomplete query behaviors.\n */\nexport interface AutocompleteRequest<TModel extends object> {\n /**\n * Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms' to get shingles\n * and 'oneTermWithContext' to use the current context while producing auto-completed terms.\n * Possible values include: 'oneTerm', 'twoTerms', 'oneTermWithContext'\n */\n autocompleteMode?: AutocompleteMode;\n /**\n * An OData expression that filters the documents used to produce completed terms for the\n * Autocomplete result.\n */\n filter?: string;\n /**\n * A value indicating whether to use fuzzy matching for the autocomplete query. Default is false.\n * When set to true, the query will autocomplete terms even if there's a substituted or missing\n * character in the search text. While this provides a better experience in some scenarios, it\n * comes at a performance cost as fuzzy autocomplete queries are slower and consume more\n * resources.\n */\n useFuzzyMatching?: boolean;\n /**\n * A string tag that is appended to hit highlights. Must be set with highlightPreTag. If omitted,\n * hit highlighting is disabled.\n */\n highlightPostTag?: string;\n /**\n * A string tag that is prepended to hit highlights. Must be set with highlightPostTag. If\n * omitted, hit highlighting is disabled.\n */\n highlightPreTag?: string;\n /**\n * A number between 0 and 100 indicating the percentage of the index that must be covered by an\n * autocomplete query in order for the query to be reported as a success. This parameter can be\n * useful for ensuring search availability even for services with only one replica. The default\n * is 80.\n */\n minimumCoverage?: number;\n /**\n * The comma-separated list of field names to consider when querying for auto-completed terms.\n * Target fields must be included in the specified suggester.\n */\n searchFields?: SearchFieldArray<TModel>;\n /**\n * The number of auto-completed terms to retrieve. This must be a value between 1 and 100. The\n * default is 5.\n */\n top?: number;\n}\n\n/**\n * Represents an index action that operates on a document.\n */\nexport type IndexDocumentsAction<TModel> = {\n /**\n * The operation to perform on a document in an indexing batch. Possible values include:\n * 'upload', 'merge', 'mergeOrUpload', 'delete'\n */\n __actionType: IndexActionType;\n} & Partial<TModel>;\n\n// END manually modified generated interfaces\n\n// Utility types\n\n/**\n * If `TFields` is never, an untyped string array\n * Otherwise, a narrowed `Fields[]` type to be used elsewhere in the consuming type.\n */\nexport type SelectArray<TFields = never> = [string] extends [TFields]\n ? readonly TFields[]\n : (<T>() => T extends TFields ? true : false) extends <T>() => T extends never ? true : false\n ? readonly string[]\n : readonly TFields[];\n\n/**\n * If `TModel` is an untyped object, an untyped string array\n * Otherwise, the slash-delimited fields of `TModel`.\n */\nexport type SearchFieldArray<TModel extends object = object> =\n (<T>() => T extends TModel ? true : false) extends <T>() => T extends object ? true : false\n ? readonly string[]\n : readonly SelectFields<TModel>[];\n\nexport type UnionToIntersection<Union> =\n // Distribute members of U into parameter position of a union of functions\n (\n Union extends unknown ? (_: Union) => unknown : never\n ) extends // Infer the intersection of the members of U as a single intersected parameter type\n (_: infer I) => unknown\n ? I\n : never;\n\n// Types that should not be included in SelectFields recursion\nexport type ExcludedODataTypes = Date | GeographyPoint;\n\n/**\n * Produces a union of valid Cognitive Search OData $select paths for T\n * using a post-order traversal of the field tree rooted at T.\n */\nexport type SelectFields<TModel extends object> =\n // If T is never, any, or object, resolves to string\n (<T>() => T extends TModel ? true : false) extends <T>() => T extends never ? true : false\n ? string\n : (<T>() => T extends TModel ? true : false) extends <T>() => T extends any ? true : false\n ? string\n : (<T>() => T extends TModel ? true : false) extends <T>() => T extends object ? true : false\n ? string\n : // If T is an array, allow selecting from fields in the array's element type\n TModel extends Array<infer Elem>\n ? // Allow selecting fields only from elements which are objects\n Elem extends object\n ? SelectFields<Elem>\n : never\n : {\n // Only consider string keys\n [Key in keyof TModel]: Key extends string\n ? NonNullable<TModel[Key]> extends object\n ? NonNullable<TModel[Key]> extends ExcludedODataTypes\n ? // Excluded, so don't recur\n Key\n : // Extract subpaths from T[Key]\n SelectFields<NonNullable<TModel[Key]>> extends infer NextPaths\n ? // This check is required to avoid distributing `never` over the condition\n (<T>() => T extends NextPaths ? true : false) extends <\n T,\n >() => T extends never ? true : false\n ? Key\n : NextPaths extends string\n ? Key | `${Key}/${NextPaths}`\n : Key\n : never\n : // Not an object, so can't recur\n Key\n : never;\n }[keyof TModel & string] &\n // Filter out undefined properties\n string;\n\n/**\n * Deeply pick fields of T using valid Cognitive Search OData $select\n * paths.\n */\nexport type SearchPick<TModel extends object, TFields extends SelectFields<TModel>> =\n (<T>() => T extends TModel ? true : false) extends <T>() => T extends object ? true : false\n ? // Picking from an untyped object should return `object`\n TModel\n : // If paths is any or never, yield the original type\n (<T>() => T extends TFields ? true : false) extends <T>() => T extends any ? true : false\n ? TModel\n : (<T>() => T extends TFields ? true : false) extends <T>() => T extends never ? true : false\n ? TModel\n : // We're going to get a union of individual interfaces for each field in T that's selected, so convert that to an intersection.\n UnionToIntersection<\n // Paths is a union or single string type, so if it's a union it will be _distributed_ over this conditional.\n // Fortunately, template literal types are not greedy, so we can infer the field name easily.\n TFields extends `${infer FieldName}/${infer RestPaths}`\n ? // Symbols and numbers are invalid types for field names\n FieldName extends keyof TModel & string\n ? NonNullable<TModel[FieldName]> extends Array<infer Elem>\n ? Elem extends object\n ? // Extends clause is necessary to refine the constraint of RestPaths\n RestPaths extends SelectFields<Elem>\n ? // Narrow the type of every element in the array\n {\n [Key in keyof TModel as Key & FieldName]: Array<\n SearchPick<Elem, RestPaths>\n >;\n }\n : // Unreachable by construction\n never\n : // Don't recur on arrays of non-object types\n never\n : NonNullable<TModel[FieldName]> extends object\n ? // Recur :)\n {\n [Key in keyof TModel as Key & FieldName]: RestPaths extends SelectFields<\n TModel[Key] & {\n // This empty intersection fixes `T[Key]` not being narrowed to an object type in older versions of TS\n }\n >\n ?\n | SearchPick<\n TModel[Key] & {\n // Ditto\n },\n RestPaths\n >\n | Extract<TModel[Key], null>\n : // Unreachable by construction\n never;\n }\n : // Unreachable by construction\n never\n : // Ignore symbols and numbers\n never\n : // Otherwise, capture the paths that are simple keys of T itself\n TFields extends keyof TModel\n ? Pick<TModel, TFields> | Extract<TModel, null>\n : never\n > & {\n // This useless intersection actually prevents the TypeScript language server from\n // expanding the definition of SearchPick<TModel, Paths> in IntelliSense. Since we're\n // sure the type always yields an object, this intersection does not alter the type\n // at all, only the display string of the type.\n };\n\nexport type ExtractDocumentKey<TModel> = {\n [K in keyof TModel as TModel[K] extends string | undefined ? K : never]: TModel[K];\n};\n\n/**\n * Narrows the Model type to include only the selected Fields\n */\nexport type NarrowedModel<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> =\n // If the model isn't specified, the type is the same as the input type\n (<T>() => T extends TModel ? true : false) extends <T>() => T extends never ? true : false\n ? TModel\n : (<T>() => T extends TModel ? true : false) extends <T>() => T extends object ? true : false\n ? TModel\n : (<T>() => T extends TModel ? true : false) extends <T>() => T extends any ? true : false\n ? TModel\n : (<T>() => T extends TModel ? true : false) extends <T>() => T extends unknown\n ? true\n : false\n ? TModel\n : (<T>() => T extends TFields ? true : false) extends <T>() => T extends never\n ? true\n : false\n ? // If fields aren't specified, this object can't exist\n never\n : (<T>() => T extends TFields ? true : false) extends <\n T,\n >() => T extends SelectFields<TModel> ? true : false\n ? // Avoid calculating the narrowed type if every field is specified\n TModel\n : SearchPick<TModel, TFields>;\n\nexport type SuggestNarrowedModel<\n TModel extends object,\n TFields extends SelectFields<TModel> = SelectFields<TModel>,\n> =\n (<T>() => T extends TModel ? true : false) extends <T>() => T extends never ? true : false\n ? TModel\n : (<T>() => T extends TModel ? true : false) extends <T>() => T extends object ? true : false\n ? TModel\n : (<T>() => T extends TFields ? true : false) extends <T>() => T extends never ? true : false\n ? // Filter nullable (i.e. non-key) properties from the model, as they're not returned by the\n // service by default\n keyof ExtractDocumentKey<TModel> extends never\n ? // Return the original model if none of the properties are non-nullable\n TModel\n : ExtractDocumentKey<TModel>\n : // TFields isn't narrowed to exclude null by the first condition, so it needs to be narrowed\n // here\n TFields extends SelectFields<TModel>\n ? NarrowedModel<TModel, TFields>\n : // Unreachable by construction\n never;\n\n/** Description of fields that were sent to the semantic enrichment process, as well as how they were used */\nexport interface QueryResultDocumentSemanticField {\n /**\n * The name of the field that was sent to the semantic enrichment process\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly name?: string;\n /**\n * The way the field was used for the semantic enrichment process (fully used, partially used, or unused)\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly state?: SemanticFieldState;\n}\n\n/** Contains debugging information that can be used to further explore your search results. */\nexport interface DocumentDebugInfo {\n /**\n * Contains debugging information specific to semantic search queries.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly semantic?: SemanticDebugInfo;\n}\n\n/**\n * Debug options for semantic search queries.\n */\nexport interface SemanticDebugInfo {\n /**\n * The title field that was sent to the semantic enrichment process, as well as how it was used\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly titleField?: QueryResultDocumentSemanticField;\n /**\n * The content fields that were sent to the semantic enrichment process, as well as how they were used\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly contentFields?: QueryResultDocumentSemanticField[];\n /**\n * The keyword fields that were sent to the semantic enrichment process, as well as how they were used\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly keywordFields?: QueryResultDocumentSemanticField[];\n /**\n * The raw concatenated strings that were sent to the semantic enrichment process.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly rerankerInput?: QueryResultDocumentRerankerInput;\n}\n\n/**\n * Extracts answer candidates from the contents of the documents returned in response to a query\n * expressed as a question in natural language.\n */\nexport interface ExtractiveQueryAnswer {\n answerType: \"extractive\";\n /**\n * The number of answers returned. Default count is 1\n */\n count?: number;\n /**\n * The confidence threshold. Default threshold is 0.7\n */\n threshold?: number;\n}\n\n/**\n * A value that specifies whether answers should be returned as part of the search response.\n * This parameter is only valid if the query type is 'semantic'. If set to `extractive`, the query\n * returns answers extracted from key passages in the highest ranked documents.\n */\nexport type QueryAnswer = ExtractiveQueryAnswer;\n\n/** Extracts captions from the matching documents that contain passages relevant to the search query. */\nexport interface ExtractiveQueryCaption {\n captionType: \"extractive\";\n highlight?: boolean;\n}\n\n/**\n * A value that specifies whether captions should be returned as part of the search response.\n * This parameter is only valid if the query type is 'semantic'. If set, the query returns captions\n * extracted from key passages in the highest ranked documents. When Captions is 'extractive',\n * highlighting is enabled by default. Defaults to 'none'.\n */\nexport type QueryCaption = ExtractiveQueryCaption;\n\n/**\n * Defines options for semantic search queries\n */\nexport interface SemanticSearchOptions {\n /**\n * The name of a semantic configuration that will be used when processing documents for queries of\n * type semantic.\n */\n configurationName?: string;\n /**\n * Allows the user to choose whether a semantic call should fail completely, or to return partial\n * results (default).\n */\n errorMode?: SemanticErrorMode;\n /**\n * Allows the user to set an upper bound on the amount of time it takes for semantic enrichment\n * to finish processing before the request fails.\n */\n maxWaitInMilliseconds?: number;\n /**\n * If set, the query returns answers extracted from key passages in the highest ranked documents.\n */\n answers?: QueryAnswer;\n /**\n * If set, the query returns captions extracted from key passages in the highest ranked\n * documents. When Captions is set to 'extractive', highlighting is enabled by default. Defaults\n * to 'None'.\n */\n captions?: QueryCaption;\n /**\n * Allows setting a separate search query that will be solely used for semantic reranking,\n * semantic captions and semantic answers. Is useful for scenarios where there is a need to use\n * different queries between the base retrieval and ranking phase, and the L2 semantic phase.\n */\n semanticQuery?: string;\n /**\n * The list of field names used for semantic search.\n */\n semanticFields?: string[];\n /**\n * Enables a debugging tool that can be used to further explore your search results.\n */\n debugMode?: QueryDebugMode;\n}\n\n/**\n * Defines options for vector search queries\n */\nexport interface VectorSearchOptions<TModel extends object> {\n /**\n * The query parameters for vector, hybrid, and multi-vector search queries.\n */\n queries: VectorQuery<TModel>[];\n /**\n * Determines whether or not filters are applied before or after the vector search is performed.\n * Default is 'preFilter'.\n */\n filterMode?: VectorFilterMode;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odata.js","sourceRoot":"","sources":["../../src/odata.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,SAAS,sBAAsB,CAAC,KAAc;IAC5C,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE;
|
|
1
|
+
{"version":3,"file":"odata.js","sourceRoot":"","sources":["../../src/odata.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,SAAS,sBAAsB,CAAC,KAAc;IAC5C,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QAC1C,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,oBAAoB,CAAC,KAAc,EAAE,QAAgB;IAC5D,IAAI,MAAM,GAAG,KAAK,CAAC;IAEnB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACnC,0CAA0C;QAC1C,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YACnC,MAAM,GAAG,IAAI,MAAM,GAAG,CAAC;QACzB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,KAAK,CAAC,OAA6B,EAAE,GAAG,MAAiB;IACvE,MAAM,OAAO,GAAG,EAAE,CAAC;IACnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACxC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QACzB,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;YACtB,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,SAAS,EAAE,CAAC;gBAClD,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAClD,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5D,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC1B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nfunction formatNullAndUndefined(input: unknown): string | unknown {\n if (input === null || input === undefined) {\n return \"null\";\n }\n\n return input;\n}\n\nfunction escapeQuotesIfString(input: unknown, previous: string): string | unknown {\n let result = input;\n\n if (typeof input === \"string\") {\n result = input.replace(/'/g, \"''\");\n // check if we need to escape this literal\n if (!previous.trim().endsWith(\"'\")) {\n result = `'${result}'`;\n }\n }\n\n return result;\n}\n\n/**\n * Escapes an odata filter expression to avoid errors with quoting string literals.\n * Example usage:\n * ```ts\n * const baseRateMax = 200;\n * const ratingMin = 4;\n * const filter = odata`Rooms/any(room: room/BaseRate lt ${baseRateMax}) and Rating ge ${ratingMin}`;\n * ```\n * For more information on supported syntax see: https://docs.microsoft.com/en-us/azure/search/search-query-odata-filter\n * @param strings - Array of strings for the expression\n * @param values - Array of values for the expression\n */\nexport function odata(strings: TemplateStringsArray, ...values: unknown[]): string {\n const results = [];\n for (let i = 0; i < strings.length; i++) {\n results.push(strings[i]);\n if (i < values.length) {\n if (values[i] === null || values[i] === undefined) {\n results.push(formatNullAndUndefined(values[i]));\n } else {\n results.push(escapeQuotesIfString(values[i], strings[i]));\n }\n }\n }\n return results.join(\"\");\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odataMetadataPolicy.js","sourceRoot":"","sources":["../../src/odataMetadataPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AASlC,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAGlC,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AAElD;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CAAC,aAA4B;IACpE,OAAO;QACL,IAAI,EAAE,mBAAmB;QACzB,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;YAC3D,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,mCAAmC,aAAa,EAAE,CAAC,CAAC;YAC1F,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n PipelinePolicy,\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\n\nconst AcceptHeaderName = \"Accept\";\n\
|
|
1
|
+
{"version":3,"file":"odataMetadataPolicy.js","sourceRoot":"","sources":["../../src/odataMetadataPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AASlC,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAGlC,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AAElD;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CAAC,aAA4B;IACpE,OAAO;QACL,IAAI,EAAE,mBAAmB;QACzB,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;YAC3D,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,mCAAmC,aAAa,EAAE,CAAC,CAAC;YAC1F,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n PipelinePolicy,\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\n\nconst AcceptHeaderName = \"Accept\";\n\ntype MetadataLevel = \"none\" | \"minimal\";\nconst odataMetadataPolicy = \"OdataMetadataPolicy\";\n\n/**\n * A policy factory for setting the Accept header to ignore odata metadata\n * @internal\n */\nexport function createOdataMetadataPolicy(metadataLevel: MetadataLevel): PipelinePolicy {\n return {\n name: odataMetadataPolicy,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n request.headers.set(AcceptHeaderName, `application/json;odata.metadata=${metadataLevel}`);\n return next(request);\n },\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchApiKeyCredentialPolicy.js","sourceRoot":"","sources":["../../src/searchApiKeyCredentialPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAUlC,MAAM,mBAAmB,GAAG,SAAS,CAAC;AACtC,MAAM,4BAA4B,GAAG,8BAA8B,CAAC;AAEpE;;;GAGG;AACH,MAAM,UAAU,kCAAkC,CAAC,UAAyB;IAC1E,OAAO;QACL,IAAI,EAAE,4BAA4B;QAClC,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;YAC3D,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,EAAE;
|
|
1
|
+
{"version":3,"file":"searchApiKeyCredentialPolicy.js","sourceRoot":"","sources":["../../src/searchApiKeyCredentialPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAUlC,MAAM,mBAAmB,GAAG,SAAS,CAAC;AACtC,MAAM,4BAA4B,GAAG,8BAA8B,CAAC;AAEpE;;;GAGG;AACH,MAAM,UAAU,kCAAkC,CAAC,UAAyB;IAC1E,OAAO;QACL,IAAI,EAAE,4BAA4B;QAClC,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;YAC3D,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,EAAE,CAAC;gBAC9C,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;YAC3D,CAAC;YACD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { KeyCredential } from \"@azure/core-auth\";\nimport {\n PipelinePolicy,\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\n\nconst API_KEY_HEADER_NAME = \"api-key\";\nconst searchApiKeyCredentialPolicy = \"SearchApiKeyCredentialPolicy\";\n\n/**\n * Create an HTTP pipeline policy to authenticate a request\n * using an `AzureKeyCredential` for Azure Cognitive Search\n */\nexport function createSearchApiKeyCredentialPolicy(credential: KeyCredential): PipelinePolicy {\n return {\n name: searchApiKeyCredentialPolicy,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n if (!request.headers.has(API_KEY_HEADER_NAME)) {\n request.headers.set(API_KEY_HEADER_NAME, credential.key);\n }\n return next(request);\n },\n };\n}\n"]}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
3
|
import { __asyncDelegator, __asyncGenerator, __asyncValues, __await, __rest } from "tslib";
|
|
4
|
+
/// <reference lib="esnext.asynciterable" />
|
|
5
|
+
import { isTokenCredential } from "@azure/core-auth";
|
|
4
6
|
import { bearerTokenAuthenticationPolicy } from "@azure/core-rest-pipeline";
|
|
7
|
+
import { decode, encode } from "./base64";
|
|
5
8
|
import { SearchClient as GeneratedClient } from "./generated/data/searchClient";
|
|
6
|
-
import {
|
|
7
|
-
import { createSearchApiKeyCredentialPolicy } from "./searchApiKeyCredentialPolicy";
|
|
9
|
+
import { IndexDocumentsBatch } from "./indexDocumentsBatch";
|
|
8
10
|
import { logger } from "./logger";
|
|
9
|
-
import { createSpan } from "./tracing";
|
|
10
|
-
import { deserialize, serialize } from "./serialization";
|
|
11
11
|
import { createOdataMetadataPolicy } from "./odataMetadataPolicy";
|
|
12
|
-
import {
|
|
13
|
-
import { decode, encode } from "./base64";
|
|
14
|
-
import * as utils from "./serviceUtils";
|
|
12
|
+
import { createSearchApiKeyCredentialPolicy } from "./searchApiKeyCredentialPolicy";
|
|
15
13
|
import { KnownSearchAudience } from "./searchAudience";
|
|
14
|
+
import { deserialize, serialize } from "./serialization";
|
|
15
|
+
import * as utils from "./serviceUtils";
|
|
16
|
+
import { createSpan } from "./tracing";
|
|
16
17
|
/**
|
|
17
18
|
* Class used to perform operations against a search index,
|
|
18
19
|
* including querying documents in the index as well as
|
|
@@ -88,6 +89,7 @@ export class SearchClient {
|
|
|
88
89
|
(_b = (_a = options.serviceVersion) !== null && _a !== void 0 ? _a : options.apiVersion) !== null && _b !== void 0 ? _b : utils.defaultServiceVersion;
|
|
89
90
|
this.apiVersion = this.serviceVersion;
|
|
90
91
|
this.client = new GeneratedClient(this.endpoint, this.indexName, this.serviceVersion, internalClientPipelineOptions);
|
|
92
|
+
this.pipeline = this.client.pipeline;
|
|
91
93
|
if (isTokenCredential(credential)) {
|
|
92
94
|
const scope = options.audience
|
|
93
95
|
? `${options.audience}/.default`
|
|
@@ -186,16 +188,17 @@ export class SearchClient {
|
|
|
186
188
|
}
|
|
187
189
|
}
|
|
188
190
|
async searchDocuments(searchText, options = {}, nextPageParameters = {}) {
|
|
189
|
-
const
|
|
190
|
-
const
|
|
191
|
+
const _a = options, { includeTotalCount, orderBy, searchFields, select, vectorSearchOptions, semanticSearchOptions } = _a, restOptions = __rest(_a, ["includeTotalCount", "orderBy", "searchFields", "select", "vectorSearchOptions", "semanticSearchOptions"]);
|
|
192
|
+
const _b = semanticSearchOptions !== null && semanticSearchOptions !== void 0 ? semanticSearchOptions : {}, { semanticFields, configurationName, errorMode, answers, captions, debugMode } = _b, restSemanticOptions = __rest(_b, ["semanticFields", "configurationName", "errorMode", "answers", "captions", "debugMode"]);
|
|
193
|
+
const _c = vectorSearchOptions !== null && vectorSearchOptions !== void 0 ? vectorSearchOptions : {}, { queries, filterMode } = _c, restVectorOptions = __rest(_c, ["queries", "filterMode"]);
|
|
194
|
+
const fullOptions = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, restSemanticOptions), restVectorOptions), restOptions), nextPageParameters), { searchFields: this.convertSearchFields(searchFields), semanticFields: this.convertSemanticFields(semanticFields), select: this.convertSelect(select) || "*", orderBy: this.convertOrderBy(orderBy), includeTotalResultCount: includeTotalCount, vectorQueries: queries === null || queries === void 0 ? void 0 : queries.map(this.convertVectorQuery.bind(this)), answers: this.convertQueryAnswers(answers), captions: this.convertQueryCaptions(captions), semanticErrorHandling: errorMode, semanticConfigurationName: configurationName, debug: debugMode, vectorFilterMode: filterMode });
|
|
191
195
|
const { span, updatedOptions } = createSpan("SearchClient-searchDocuments", options);
|
|
192
196
|
try {
|
|
193
197
|
const result = await this.client.documents.searchPost(Object.assign(Object.assign({}, fullOptions), { searchText: searchText }), updatedOptions);
|
|
194
|
-
const { results, nextLink, nextPageParameters: resultNextPageParameters, semanticPartialResponseReason, semanticPartialResponseType } =
|
|
198
|
+
const _d = result, { results, nextLink, nextPageParameters: resultNextPageParameters, semanticPartialResponseReason: semanticErrorReason, semanticPartialResponseType: semanticSearchResultsType } = _d, restResult = __rest(_d, ["results", "nextLink", "nextPageParameters", "semanticPartialResponseReason", "semanticPartialResponseType"]);
|
|
195
199
|
const modifiedResults = utils.generatedSearchResultToPublicSearchResult(results);
|
|
196
|
-
const converted = Object.assign(Object.assign({}, restResult), { results: modifiedResults,
|
|
197
|
-
|
|
198
|
-
: resultNextPageParameters) });
|
|
200
|
+
const converted = Object.assign(Object.assign({}, restResult), { results: modifiedResults, semanticErrorReason,
|
|
201
|
+
semanticSearchResultsType, continuationToken: this.encodeContinuationToken(nextLink, resultNextPageParameters) });
|
|
199
202
|
return deserialize(converted);
|
|
200
203
|
}
|
|
201
204
|
catch (e) {
|
|
@@ -231,16 +234,11 @@ export class SearchClient {
|
|
|
231
234
|
try {
|
|
232
235
|
for (var _d = true, _e = __asyncValues(this.listSearchResultsPage(searchText, options, {
|
|
233
236
|
continuationToken: firstPage.continuationToken,
|
|
234
|
-
})), _f; _f = yield __await(_e.next()), _a = _f.done, !_a;) {
|
|
237
|
+
})), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
235
238
|
_c = _f.value;
|
|
236
239
|
_d = false;
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
yield __await(yield* __asyncDelegator(__asyncValues(page.results)));
|
|
240
|
-
}
|
|
241
|
-
finally {
|
|
242
|
-
_d = true;
|
|
243
|
-
}
|
|
240
|
+
const page = _c;
|
|
241
|
+
yield __await(yield* __asyncDelegator(__asyncValues(page.results)));
|
|
244
242
|
}
|
|
245
243
|
}
|
|
246
244
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
@@ -591,15 +589,12 @@ export class SearchClient {
|
|
|
591
589
|
}
|
|
592
590
|
return orderBy;
|
|
593
591
|
}
|
|
594
|
-
|
|
595
|
-
if (!answers
|
|
592
|
+
convertQueryAnswers(answers) {
|
|
593
|
+
if (!answers) {
|
|
596
594
|
return answers;
|
|
597
595
|
}
|
|
598
|
-
if (answers.answers === "none") {
|
|
599
|
-
return answers.answers;
|
|
600
|
-
}
|
|
601
596
|
const config = [];
|
|
602
|
-
const {
|
|
597
|
+
const { answerType: output, count, threshold } = answers;
|
|
603
598
|
if (count) {
|
|
604
599
|
config.push(`count-${count}`);
|
|
605
600
|
}
|
|
@@ -611,6 +606,20 @@ export class SearchClient {
|
|
|
611
606
|
}
|
|
612
607
|
return output;
|
|
613
608
|
}
|
|
609
|
+
convertQueryCaptions(captions) {
|
|
610
|
+
if (!captions) {
|
|
611
|
+
return captions;
|
|
612
|
+
}
|
|
613
|
+
const config = [];
|
|
614
|
+
const { captionType: output, highlight } = captions;
|
|
615
|
+
if (highlight !== undefined) {
|
|
616
|
+
config.push(`highlight-${highlight}`);
|
|
617
|
+
}
|
|
618
|
+
if (config.length) {
|
|
619
|
+
return output + `|${config.join(",")}`;
|
|
620
|
+
}
|
|
621
|
+
return output;
|
|
622
|
+
}
|
|
614
623
|
convertVectorQuery(vectorQuery) {
|
|
615
624
|
if (!vectorQuery) {
|
|
616
625
|
return vectorQuery;
|