@azure/search-documents 12.0.0-alpha.20230622.2 → 12.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/README.md +56 -15
  2. package/dist/index.js +589 -99
  3. package/dist/index.js.map +1 -1
  4. package/dist-esm/src/generated/data/models/index.js +50 -6
  5. package/dist-esm/src/generated/data/models/index.js.map +1 -1
  6. package/dist-esm/src/generated/data/models/mappers.js +202 -0
  7. package/dist-esm/src/generated/data/models/mappers.js.map +1 -1
  8. package/dist-esm/src/generated/data/models/parameters.js +30 -0
  9. package/dist-esm/src/generated/data/models/parameters.js.map +1 -1
  10. package/dist-esm/src/generated/data/operations/documents.js +3 -0
  11. package/dist-esm/src/generated/data/operations/documents.js.map +1 -1
  12. package/dist-esm/src/generated/data/searchClient.js.map +1 -1
  13. package/dist-esm/src/generated/service/models/index.js +15 -14
  14. package/dist-esm/src/generated/service/models/index.js.map +1 -1
  15. package/dist-esm/src/generated/service/models/mappers.js +190 -7
  16. package/dist-esm/src/generated/service/models/mappers.js.map +1 -1
  17. package/dist-esm/src/generated/service/searchServiceClient.js.map +1 -1
  18. package/dist-esm/src/index.js.map +1 -1
  19. package/dist-esm/src/indexModels.js.map +1 -1
  20. package/dist-esm/src/searchClient.js +51 -46
  21. package/dist-esm/src/searchClient.js.map +1 -1
  22. package/dist-esm/src/searchIndexClient.js +1 -1
  23. package/dist-esm/src/searchIndexClient.js.map +1 -1
  24. package/dist-esm/src/searchIndexingBufferedSender.js.map +1 -1
  25. package/dist-esm/src/serviceModels.js.map +1 -1
  26. package/dist-esm/src/serviceUtils.js +39 -26
  27. package/dist-esm/src/serviceUtils.js.map +1 -1
  28. package/package.json +5 -4
  29. package/types/search-documents.d.ts +469 -110
@@ -115,15 +115,42 @@ export declare interface AnswerResult {
115
115
  }
116
116
 
117
117
  /**
118
- * Defines values for Answers. \
119
- * {@link KnownAnswers} can be used interchangeably with Answers,
120
- * this enum contains the known values that the service supports.
121
- * ### Known values supported by the service
122
- * **none**: Do not return answers for the query. \
123
- * **extractive**: Extracts answer candidates from the contents of the documents returned in response to a query expressed as a question in natural language.
118
+ * This parameter is only valid if the query type is 'semantic'. If set, the query returns answers
119
+ * extracted from key passages in the highest ranked documents. The number of answers returned can
120
+ * be configured by appending the pipe character '|' followed by the 'count-\<number of answers\>' option
121
+ * after the answers parameter value, such as 'extractive|count-3'. Default count is 1. The
122
+ * confidence threshold can be configured by appending the pipe character '|' followed by the
123
+ * 'threshold-\<confidence threshold\>' option after the answers parameter value, such as
124
+ * 'extractive|threshold-0.9'. Default threshold is 0.7.
124
125
  */
125
126
  export declare type Answers = string;
126
127
 
128
+ /**
129
+ * A value that specifies whether answers should be returned as part of the search response.
130
+ * This parameter is only valid if the query type is 'semantic'. If set to `extractive`, the query
131
+ * returns answers extracted from key passages in the highest ranked documents.
132
+ */
133
+ export declare type AnswersOptions = {
134
+ /**
135
+ * Extracts answer candidates from the contents of the documents returned in response to a
136
+ * query expressed as a question in natural language.
137
+ */
138
+ answers: "extractive";
139
+ /**
140
+ * The number of answers returned. Default count is 1
141
+ */
142
+ count?: number;
143
+ /**
144
+ * The confidence threshold. Default threshold is 0.7
145
+ */
146
+ threshold?: number;
147
+ } | {
148
+ /**
149
+ * Do not return answers for the query.
150
+ */
151
+ answers: "none";
152
+ };
153
+
127
154
  /** Converts alphabetic, numeric, and symbolic Unicode characters which are not in the first 127 ASCII characters (the "Basic Latin" Unicode block) into their ASCII equivalents, if such equivalents exist. This token filter is implemented using Apache Lucene. */
128
155
  export declare type AsciiFoldingTokenFilter = BaseTokenFilter & {
129
156
  /** Polymorphic discriminator, which specifies the different types this object can be */
@@ -152,12 +179,12 @@ export declare type AutocompleteMode = "oneTerm" | "twoTerms" | "oneTermWithCont
152
179
  /**
153
180
  * Options for retrieving completion text for a partial searchText.
154
181
  */
155
- export declare type AutocompleteOptions<Model extends object> = OperationOptions & AutocompleteRequest<Model>;
182
+ export declare type AutocompleteOptions<TModel extends object> = OperationOptions & AutocompleteRequest<TModel>;
156
183
 
157
184
  /**
158
185
  * Parameters for fuzzy matching, and other autocomplete query behaviors.
159
186
  */
160
- export declare interface AutocompleteRequest<Model extends object> {
187
+ export declare interface AutocompleteRequest<TModel extends object> {
161
188
  /**
162
189
  * Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms' to get shingles
163
190
  * and 'oneTermWithContext' to use the current context while producing auto-completed terms.
@@ -198,7 +225,7 @@ export declare interface AutocompleteRequest<Model extends object> {
198
225
  * The comma-separated list of field names to consider when querying for auto-completed terms.
199
226
  * Target fields must be included in the specified suggester.
200
227
  */
201
- searchFields?: SelectFields<Model>[] | Readonly<SelectFields<Model>[]>;
228
+ searchFields?: SearchFieldArray<TModel>;
202
229
  /**
203
230
  * The number of auto-completed terms to retrieve. This must be a value between 1 and 100. The
204
231
  * default is 5.
@@ -342,6 +369,14 @@ export declare interface BaseTokenFilter {
342
369
  name: string;
343
370
  }
344
371
 
372
+ /** Contains configuration options specific to the algorithm used during indexing time. */
373
+ export declare interface BaseVectorSearchAlgorithmConfiguration {
374
+ /** Polymorphic discriminator, which specifies the different types this object can be */
375
+ kind: "hnsw";
376
+ /** The name to associate with this particular configuration. */
377
+ name: string;
378
+ }
379
+
345
380
  /**
346
381
  * Defines values for BlobIndexerDataToExtract. \
347
382
  * {@link KnownBlobIndexerDataToExtract} can be used interchangeably with BlobIndexerDataToExtract,
@@ -907,6 +942,15 @@ export declare interface DistanceScoringParameters {
907
942
  boostingDistance: number;
908
943
  }
909
944
 
945
+ /** Contains debugging information that can be used to further explore your search results. */
946
+ export declare interface DocumentDebugInfo {
947
+ /**
948
+ * Contains debugging information specific to semantic search queries.
949
+ * NOTE: This property will not be serialized. It can only be populated by the server.
950
+ */
951
+ readonly semantic?: SemanticDebugInfo;
952
+ }
953
+
910
954
  /** A skill that extracts content from a file within the enrichment pipeline. */
911
955
  export declare type DocumentExtractionSkill = BaseSearchIndexerSkill & {
912
956
  /** Polymorphic discriminator, which specifies the different types this object can be */
@@ -917,7 +961,7 @@ export declare type DocumentExtractionSkill = BaseSearchIndexerSkill & {
917
961
  dataToExtract?: string;
918
962
  /** A dictionary of configurations for the skill. */
919
963
  configuration?: {
920
- [propertyName: string]: Record<string, unknown>;
964
+ [propertyName: string]: any;
921
965
  };
922
966
  };
923
967
 
@@ -1003,10 +1047,9 @@ export declare type EntityLinkingSkill = BaseSearchIndexerSkill & {
1003
1047
  };
1004
1048
 
1005
1049
  /**
1006
- * Text analytics entity recognition.
1050
+ * This skill is deprecated. Use the V3.EntityRecognitionSkill instead.
1007
1051
  *
1008
- * @deprecated EntityRecognitionSkill has been deprecated. See
1009
- * https://learn.microsoft.com/en-us/azure/search/cognitive-search-skill-deprecated
1052
+ * @deprecated
1010
1053
  */
1011
1054
  export declare type EntityRecognitionSkill = BaseSearchIndexerSkill & {
1012
1055
  /** Polymorphic discriminator, which specifies the different types this object can be */
@@ -1068,8 +1111,8 @@ export declare type EntityRecognitionSkillV3 = BaseSearchIndexerSkill & {
1068
1111
 
1069
1112
  export declare type ExcludedODataTypes = Date | GeographyPoint;
1070
1113
 
1071
- export declare type ExtractDocumentKey<Model> = {
1072
- [K in keyof Model as Model[K] extends string | undefined ? K : never]: Model[K];
1114
+ export declare type ExtractDocumentKey<TModel> = {
1115
+ [K in keyof TModel as TModel[K] extends string | undefined ? K : never]: TModel[K];
1073
1116
  };
1074
1117
 
1075
1118
  /** A single bucket of a facet query result. Reports the number of documents with a field value falling within a particular range or having a particular value or interval. */
@@ -1099,7 +1142,7 @@ export declare interface FieldMappingFunction {
1099
1142
  name: string;
1100
1143
  /** A dictionary of parameter name/value pairs to pass to the function. Each value must be of a primitive type. */
1101
1144
  parameters?: {
1102
- [propertyName: string]: Record<string, unknown>;
1145
+ [propertyName: string]: any;
1103
1146
  };
1104
1147
  }
1105
1148
 
@@ -1157,12 +1200,12 @@ export declare type GetDataSourceConnectionOptions = OperationOptions;
1157
1200
  /**
1158
1201
  * Options for retrieving a single document.
1159
1202
  */
1160
- export declare interface GetDocumentOptions<Model extends object, Fields extends SelectFields<Model> = SelectFields<Model>> extends OperationOptions {
1203
+ export declare interface GetDocumentOptions<TModel extends object, TFields extends SelectFields<TModel> = SelectFields<TModel>> extends OperationOptions {
1161
1204
  /**
1162
1205
  * List of field names to retrieve for the document; Any field not retrieved will be missing from
1163
1206
  * the returned document.
1164
1207
  */
1165
- selectedFields?: [string] extends [Fields] ? string[] : Fields[] | Readonly<Fields[]>;
1208
+ selectedFields?: SelectArray<TFields>;
1166
1209
  }
1167
1210
 
1168
1211
  /**
@@ -1208,6 +1251,51 @@ export declare type HighWaterMarkChangeDetectionPolicy = BaseDataChangeDetection
1208
1251
  highWaterMarkColumnName: string;
1209
1252
  };
1210
1253
 
1254
+ /**
1255
+ * Contains the parameters specific to hnsw algorithm.
1256
+ */
1257
+ export declare interface HnswParameters {
1258
+ /**
1259
+ * The number of bi-directional links created for every new element during construction.
1260
+ * Increasing this parameter value may improve recall and reduce retrieval times for datasets
1261
+ * with high intrinsic dimensionality at the expense of increased memory consumption and longer
1262
+ * indexing time.
1263
+ */
1264
+ m?: number;
1265
+ /**
1266
+ * The size of the dynamic list containing the nearest neighbors, which is used during index
1267
+ * time. Increasing this parameter may improve index quality, at the expense of increased
1268
+ * indexing time. At a certain point, increasing this parameter leads to diminishing returns.
1269
+ */
1270
+ efConstruction?: number;
1271
+ /**
1272
+ * The size of the dynamic list containing the nearest neighbors, which is used during search
1273
+ * time. Increasing this parameter may improve search results, at the expense of slower search.
1274
+ * Increasing this parameter leads to diminishing returns.
1275
+ */
1276
+ efSearch?: number;
1277
+ /**
1278
+ * The similarity metric to use for vector comparisons.
1279
+ */
1280
+ metric?: VectorSearchAlgorithmMetric;
1281
+ }
1282
+
1283
+ /**
1284
+ * Contains configuration options specific to the hnsw approximate nearest neighbors algorithm
1285
+ * used during indexing time.
1286
+ */
1287
+ export declare type HnswVectorSearchAlgorithmConfiguration = BaseVectorSearchAlgorithmConfiguration & {
1288
+ /**
1289
+ * Polymorphic discriminator, which specifies the different types this object can be
1290
+ */
1291
+ kind: "hnsw";
1292
+ /**
1293
+ * Contains the parameters specific to hnsw algorithm.
1294
+ *
1295
+ */
1296
+ parameters?: HnswParameters;
1297
+ };
1298
+
1211
1299
  /** A skill that analyzes image files. It extracts a rich set of visual features based on the image content. */
1212
1300
  export declare type ImageAnalysisSkill = BaseSearchIndexerSkill & {
1213
1301
  /** Polymorphic discriminator, which specifies the different types this object can be */
@@ -4084,7 +4172,10 @@ export declare type MicrosoftStemmingTokenizerLanguage = "arabic" | "bangla" | "
4084
4172
  /** Defines values for MicrosoftTokenizerLanguage. */
4085
4173
  export declare type MicrosoftTokenizerLanguage = "bangla" | "bulgarian" | "catalan" | "chineseSimplified" | "chineseTraditional" | "croatian" | "czech" | "danish" | "dutch" | "english" | "french" | "german" | "greek" | "gujarati" | "hindi" | "icelandic" | "indonesian" | "italian" | "japanese" | "kannada" | "korean" | "malay" | "malayalam" | "marathi" | "norwegianBokmaal" | "polish" | "portuguese" | "portugueseBrazilian" | "punjabi" | "romanian" | "russian" | "serbianCyrillic" | "serbianLatin" | "slovenian" | "spanish" | "swedish" | "tamil" | "telugu" | "thai" | "ukrainian" | "urdu" | "vietnamese";
4086
4174
 
4087
- export declare type NarrowedModel<Model extends object, Fields extends SelectFields<Model> = SelectFields<Model>> = SelectFields<Model> extends Fields ? Model : SearchPick<Model, Fields>;
4175
+ /**
4176
+ * Narrows the Model type to include only the selected Fields
4177
+ */
4178
+ export declare type NarrowedModel<TModel extends object, TFields extends SelectFields<TModel> = SelectFields<TModel>> = (<T>() => T extends TModel ? true : false) extends <T>() => T extends never ? true : false ? TModel : (<T>() => T extends TModel ? true : false) extends <T>() => T extends object ? true : false ? TModel : (<T>() => T extends TModel ? true : false) extends <T>() => T extends any ? true : false ? TModel : (<T>() => T extends TModel ? true : false) extends <T>() => T extends unknown ? true : false ? TModel : (<T>() => T extends TFields ? true : false) extends <T>() => T extends never ? true : false ? never : (<T>() => T extends TFields ? true : false) extends <T>() => T extends SelectFields<TModel> ? true : false ? TModel : SearchPick<TModel, TFields>;
4088
4179
 
4089
4180
  /**
4090
4181
  * Generates n-grams of the given size(s). This token filter is implemented using Apache Lucene.
@@ -4521,6 +4612,13 @@ export declare type QueryAnswerType = string;
4521
4612
  */
4522
4613
  export declare type QueryCaptionType = string;
4523
4614
 
4615
+ /**
4616
+ * disabled: No query debugging information will be returned.
4617
+ *
4618
+ * semantic: Allows the user to further explore their Semantic search results.
4619
+ */
4620
+ export declare type QueryDebugMode = "disabled" | "semantic";
4621
+
4524
4622
  /**
4525
4623
  * Defines values for QueryLanguage. \
4526
4624
  * {@link KnownQueryLanguage} can be used interchangeably with QueryLanguage,
@@ -4601,6 +4699,39 @@ export declare type QueryCaptionType = string;
4601
4699
  */
4602
4700
  export declare type QueryLanguage = string;
4603
4701
 
4702
+ /** The raw concatenated strings that were sent to the semantic enrichment process. */
4703
+ export declare interface QueryResultDocumentRerankerInput {
4704
+ /**
4705
+ * The raw string for the title field that was used for semantic enrichment.
4706
+ * NOTE: This property will not be serialized. It can only be populated by the server.
4707
+ */
4708
+ readonly title?: string;
4709
+ /**
4710
+ * The raw concatenated strings for the content fields that were used for semantic enrichment.
4711
+ * NOTE: This property will not be serialized. It can only be populated by the server.
4712
+ */
4713
+ readonly content?: string;
4714
+ /**
4715
+ * The raw concatenated strings for the keyword fields that were used for semantic enrichment.
4716
+ * NOTE: This property will not be serialized. It can only be populated by the server.
4717
+ */
4718
+ readonly keywords?: string;
4719
+ }
4720
+
4721
+ /** Description of fields that were sent to the semantic enrichment process, as well as how they were used */
4722
+ export declare interface QueryResultDocumentSemanticField {
4723
+ /**
4724
+ * The name of the field that was sent to the semantic enrichment process
4725
+ * NOTE: This property will not be serialized. It can only be populated by the server.
4726
+ */
4727
+ readonly name?: string;
4728
+ /**
4729
+ * The way the field was used for the semantic enrichment process (fully used, partially used, or unused)
4730
+ * NOTE: This property will not be serialized. It can only be populated by the server.
4731
+ */
4732
+ readonly state?: SemanticFieldState;
4733
+ }
4734
+
4604
4735
  /**
4605
4736
  * Defines values for QuerySpellerType. \
4606
4737
  * {@link KnownQuerySpellerType} can be used interchangeably with QuerySpellerType,
@@ -4794,7 +4925,7 @@ export declare class SearchClient<TModel extends object> implements IndexDocumen
4794
4925
  * import {
4795
4926
  * AzureKeyCredential,
4796
4927
  * SearchClient,
4797
- * SelectFields,
4928
+ * SearchFieldArray,
4798
4929
  * } from "@azure/search-documents";
4799
4930
  *
4800
4931
  * type TModel = {
@@ -4808,7 +4939,7 @@ export declare class SearchClient<TModel extends object> implements IndexDocumen
4808
4939
  * new AzureKeyCredential("key")
4809
4940
  * );
4810
4941
  *
4811
- * const searchFields: SelectFields<TModel>[] = ["azure/sdk"];
4942
+ * const searchFields: SearchFieldArray<TModel> = ["azure/sdk"];
4812
4943
  *
4813
4944
  * const autocompleteResult = await client.autocomplete(
4814
4945
  * "searchText",
@@ -4832,7 +4963,7 @@ export declare class SearchClient<TModel extends object> implements IndexDocumen
4832
4963
  * import {
4833
4964
  * AzureKeyCredential,
4834
4965
  * SearchClient,
4835
- * SelectFields,
4966
+ * SearchFieldArray,
4836
4967
  * } from "@azure/search-documents";
4837
4968
  *
4838
4969
  * type TModel = {
@@ -4847,7 +4978,7 @@ export declare class SearchClient<TModel extends object> implements IndexDocumen
4847
4978
  * );
4848
4979
  *
4849
4980
  * const select = ["azure/sdk"] as const;
4850
- * const searchFields: SelectFields<TModel>[] = ["azure/sdk"];
4981
+ * const searchFields: SearchFieldArray<TModel> = ["azure/sdk"];
4851
4982
  *
4852
4983
  * const searchResult = await client.search("searchText", {
4853
4984
  * select,
@@ -4855,7 +4986,7 @@ export declare class SearchClient<TModel extends object> implements IndexDocumen
4855
4986
  * });
4856
4987
  * ```
4857
4988
  */
4858
- search<Fields extends SelectFields<TModel>>(searchText?: string, options?: SearchOptions<TModel, Fields>): Promise<SearchDocumentsResult<TModel, Fields>>;
4989
+ search<TFields extends SelectFields<TModel>>(searchText?: string, options?: SearchOptions<TModel, TFields>): Promise<SearchDocumentsResult<TModel, TFields>>;
4859
4990
  /**
4860
4991
  * Returns a short list of suggestions based on the searchText
4861
4992
  * and specified suggester.
@@ -4867,7 +4998,7 @@ export declare class SearchClient<TModel extends object> implements IndexDocumen
4867
4998
  * import {
4868
4999
  * AzureKeyCredential,
4869
5000
  * SearchClient,
4870
- * SelectFields,
5001
+ * SearchFieldArray,
4871
5002
  * } from "@azure/search-documents";
4872
5003
  *
4873
5004
  * type TModel = {
@@ -4882,7 +5013,7 @@ export declare class SearchClient<TModel extends object> implements IndexDocumen
4882
5013
  * );
4883
5014
  *
4884
5015
  * const select = ["azure/sdk"] as const;
4885
- * const searchFields: SelectFields<TModel>[] = ["azure/sdk"];
5016
+ * const searchFields: SearchFieldArray<TModel> = ["azure/sdk"];
4886
5017
  *
4887
5018
  * const suggestResult = await client.suggest("searchText", "suggesterName", {
4888
5019
  * select,
@@ -4890,13 +5021,13 @@ export declare class SearchClient<TModel extends object> implements IndexDocumen
4890
5021
  * });
4891
5022
  * ```
4892
5023
  */
4893
- suggest<Fields extends SelectFields<TModel> = never>(searchText: string, suggesterName: string, options?: SuggestOptions<TModel, Fields>): Promise<SuggestDocumentsResult<TModel, Fields>>;
5024
+ suggest<TFields extends SelectFields<TModel> = never>(searchText: string, suggesterName: string, options?: SuggestOptions<TModel, TFields>): Promise<SuggestDocumentsResult<TModel, TFields>>;
4894
5025
  /**
4895
5026
  * Retrieve a particular document from the index by key.
4896
5027
  * @param key - The primary key value of the document
4897
5028
  * @param options - Additional options
4898
5029
  */
4899
- getDocument<Fields extends SelectFields<TModel>>(key: string, options?: GetDocumentOptions<TModel, Fields>): Promise<NarrowedModel<TModel, Fields>>;
5030
+ getDocument<TFields extends SelectFields<TModel>>(key: string, options?: GetDocumentOptions<TModel, TFields>): Promise<NarrowedModel<TModel, TFields>>;
4900
5031
  /**
4901
5032
  * Perform a set of index modifications (upload, merge, mergeOrUpload, delete)
4902
5033
  * for the given set of documents.
@@ -4943,11 +5074,13 @@ export declare class SearchClient<TModel extends object> implements IndexDocumen
4943
5074
  deleteDocuments(keyName: keyof TModel, keyValues: string[], options?: DeleteDocumentsOptions): Promise<IndexDocumentsResult>;
4944
5075
  private encodeContinuationToken;
4945
5076
  private decodeContinuationToken;
4946
- private extractOperationOptions;
4947
5077
  private convertSelect;
5078
+ private convertVectorFields;
4948
5079
  private convertSearchFields;
4949
5080
  private convertSemanticFields;
4950
5081
  private convertOrderBy;
5082
+ private convertAnswers;
5083
+ private convertVector;
4951
5084
  }
4952
5085
 
4953
5086
  /**
@@ -4974,12 +5107,12 @@ export declare interface SearchClientOptions extends ExtendedCommonClientOptions
4974
5107
  /**
4975
5108
  * Response containing search page results from an index.
4976
5109
  */
4977
- export declare interface SearchDocumentsPageResult<Model extends object, Fields extends SelectFields<Model> = SelectFields<Model>> extends SearchDocumentsResultBase {
5110
+ export declare interface SearchDocumentsPageResult<TModel extends object, TFields extends SelectFields<TModel> = SelectFields<TModel>> extends SearchDocumentsResultBase {
4978
5111
  /**
4979
5112
  * The sequence of results returned by the query.
4980
5113
  * **NOTE: This property will not be serialized. It can only be populated by the server.**
4981
5114
  */
4982
- readonly results: SearchResult<Model, Fields>[];
5115
+ readonly results: SearchResult<TModel, TFields>[];
4983
5116
  /**
4984
5117
  * A token used for retrieving the next page of results when the server
4985
5118
  * enforces pagination.
@@ -4990,12 +5123,12 @@ export declare interface SearchDocumentsPageResult<Model extends object, Fields
4990
5123
  /**
4991
5124
  * Response containing search results from an index.
4992
5125
  */
4993
- export declare interface SearchDocumentsResult<Model extends object, Fields extends SelectFields<Model> = SelectFields<Model>> extends SearchDocumentsResultBase {
5126
+ export declare interface SearchDocumentsResult<TModel extends object, TFields extends SelectFields<TModel> = SelectFields<TModel>> extends SearchDocumentsResultBase {
4994
5127
  /**
4995
5128
  * The sequence of results returned by the query.
4996
5129
  * **NOTE: This property will not be serialized. It can only be populated by the server.**
4997
5130
  */
4998
- readonly results: SearchIterator<Model, Fields>;
5131
+ readonly results: SearchIterator<TModel, TFields>;
4999
5132
  }
5000
5133
 
5001
5134
  /**
@@ -5030,6 +5163,16 @@ export declare interface SearchDocumentsResultBase {
5030
5163
  * NOTE: This property will not be serialized. It can only be populated by the server.
5031
5164
  */
5032
5165
  readonly answers?: AnswerResult[];
5166
+ /**
5167
+ * Reason that a partial response was returned for a semantic search request.
5168
+ * NOTE: This property will not be serialized. It can only be populated by the server.
5169
+ */
5170
+ readonly semanticPartialResponseReason?: SemanticPartialResponseReason;
5171
+ /**
5172
+ * Type of partial response that was returned for a semantic search request.
5173
+ * NOTE: This property will not be serialized. It can only be populated by the server.
5174
+ */
5175
+ readonly semanticPartialResponseType?: SemanticPartialResponseType;
5033
5176
  }
5034
5177
 
5035
5178
  /**
@@ -5038,15 +5181,23 @@ export declare interface SearchDocumentsResultBase {
5038
5181
  */
5039
5182
  export declare type SearchField = SimpleField | ComplexField;
5040
5183
 
5184
+ /**
5185
+ * If `TModel` is an untyped object, an untyped string array
5186
+ * Otherwise, the slash-delimited fields of `TModel`.
5187
+ */
5188
+ export declare type SearchFieldArray<TModel extends object = object> = (<T>() => T extends TModel ? true : false) extends <T>() => T extends object ? true : false ? readonly string[] : readonly SelectFields<TModel>[];
5189
+
5041
5190
  /**
5042
5191
  * Defines values for SearchFieldDataType.
5043
5192
  * Possible values include: 'Edm.String', 'Edm.Int32', 'Edm.Int64', 'Edm.Double', 'Edm.Boolean',
5044
- * 'Edm.DateTimeOffset', 'Edm.GeographyPoint', 'Collection(Edm.String)',
5045
- * 'Collection(Edm.Int32)', 'Collection(Edm.Int64)', 'Collection(Edm.Double)',
5046
- * 'Collection(Edm.Boolean)', 'Collection(Edm.DateTimeOffset)', 'Collection(Edm.GeographyPoint)'
5193
+ * 'Edm.DateTimeOffset', 'Edm.GeographyPoint', 'Collection(Edm.String)', 'Collection(Edm.Int32)',
5194
+ * 'Collection(Edm.Int64)', 'Collection(Edm.Double)', 'Collection(Edm.Boolean)',
5195
+ * 'Collection(Edm.DateTimeOffset)', 'Collection(Edm.GeographyPoint)', 'Collection(Edm.Single)'
5196
+ *
5197
+ * NB: `Edm.Single` alone is not a valid data type. It must be used as part of a collection type.
5047
5198
  * @readonly
5048
5199
  */
5049
- export declare type SearchFieldDataType = "Edm.String" | "Edm.Int32" | "Edm.Int64" | "Edm.Double" | "Edm.Boolean" | "Edm.DateTimeOffset" | "Edm.GeographyPoint" | "Collection(Edm.String)" | "Collection(Edm.Int32)" | "Collection(Edm.Int64)" | "Collection(Edm.Double)" | "Collection(Edm.Boolean)" | "Collection(Edm.DateTimeOffset)" | "Collection(Edm.GeographyPoint)";
5200
+ export declare type SearchFieldDataType = "Edm.String" | "Edm.Int32" | "Edm.Int64" | "Edm.Double" | "Edm.Boolean" | "Edm.DateTimeOffset" | "Edm.GeographyPoint" | "Collection(Edm.String)" | "Collection(Edm.Int32)" | "Collection(Edm.Int64)" | "Collection(Edm.Double)" | "Collection(Edm.Boolean)" | "Collection(Edm.DateTimeOffset)" | "Collection(Edm.GeographyPoint)" | "Collection(Edm.Single)";
5050
5201
 
5051
5202
  /**
5052
5203
  * Represents a search index definition, which describes the fields and search behavior of an
@@ -5120,6 +5271,10 @@ export declare interface SearchIndex {
5120
5271
  * Defines parameters for a search index that influence semantic capabilities.
5121
5272
  */
5122
5273
  semanticSettings?: SemanticSettings;
5274
+ /**
5275
+ * Contains configuration options related to vector search.
5276
+ */
5277
+ vectorSearch?: VectorSearch;
5123
5278
  /**
5124
5279
  * The ETag of the index.
5125
5280
  */
@@ -5303,12 +5458,12 @@ export declare class SearchIndexClient {
5303
5458
  * Retrieves the SearchClient corresponding to this SearchIndexClient
5304
5459
  * @param indexName - Name of the index
5305
5460
  * @param options - SearchClient Options
5306
- * @typeParam Model - An optional type that represents the documents stored in
5461
+ * @typeParam TModel - An optional type that represents the documents stored in
5307
5462
  * the search index. For the best typing experience, all non-key fields should
5308
5463
  * be marked optional and nullable, and the key property should have the
5309
5464
  * non-nullable type `string`.
5310
5465
  */
5311
- getSearchClient<Model extends object>(indexName: string, options?: SearchClientOptions): SearchClient<Model>;
5466
+ getSearchClient<TModel extends object>(indexName: string, options?: SearchClientOptions): SearchClient<TModel>;
5312
5467
  }
5313
5468
 
5314
5469
  /**
@@ -5401,10 +5556,21 @@ export declare interface SearchIndexer {
5401
5556
  }
5402
5557
 
5403
5558
  export declare interface SearchIndexerCache {
5404
- /** The connection string to the storage account where the cache data will be persisted. */
5559
+ /**
5560
+ * The connection string to the storage account where the cache data will be persisted.
5561
+ */
5405
5562
  storageConnectionString?: string;
5406
- /** Specifies whether incremental reprocessing is enabled. */
5563
+ /**
5564
+ * Specifies whether incremental reprocessing is enabled.
5565
+ */
5407
5566
  enableReprocessing?: boolean;
5567
+ /** The user-assigned managed identity used for connections to the enrichment cache. If the
5568
+ * connection string indicates an identity (ResourceId) and it's not specified, the
5569
+ * system-assigned managed identity is used. On updates to the indexer, if the identity is
5570
+ * unspecified, the value remains unchanged. If set to "none", the value of this property is
5571
+ * cleared.
5572
+ */
5573
+ identity?: SearchIndexerDataIdentity;
5408
5574
  }
5409
5575
 
5410
5576
  /**
@@ -5732,12 +5898,26 @@ export declare interface SearchIndexerError {
5732
5898
  readonly documentationLink?: string;
5733
5899
  }
5734
5900
 
5735
- /** Definition of additional projections to azure blob, table, or files, of enriched data. */
5901
+ /**
5902
+ * Definition of additional projections to azure blob, table, or files, of enriched data.
5903
+ */
5736
5904
  export declare interface SearchIndexerKnowledgeStore {
5737
- /** The connection string to the storage account projections will be stored in. */
5905
+ /**
5906
+ * The connection string to the storage account projections will be stored in.
5907
+ */
5738
5908
  storageConnectionString: string;
5739
- /** A list of additional projections to perform during indexing. */
5909
+ /**
5910
+ * A list of additional projections to perform during indexing.
5911
+ */
5740
5912
  projections: SearchIndexerKnowledgeStoreProjection[];
5913
+ /**
5914
+ * The user-assigned managed identity used for connections to Azure Storage when writing
5915
+ * knowledge store projections. If the connection string indicates an identity (ResourceId) and
5916
+ * it's not specified, the system-assigned managed identity is used. On updates to the indexer,
5917
+ * if the identity is unspecified, the value remains unchanged. If set to "none", the value of
5918
+ * this property is cleared.
5919
+ */
5920
+ identity?: SearchIndexerDataIdentity;
5741
5921
  }
5742
5922
 
5743
5923
  /** Abstract class to share properties between concrete selectors. */
@@ -5903,7 +6083,7 @@ export declare interface SearchIndexerWarning {
5903
6083
  * Class used to perform buffered operations against a search index,
5904
6084
  * including adding, updating, and removing them.
5905
6085
  */
5906
- export declare class SearchIndexingBufferedSender<Model extends object> {
6086
+ export declare class SearchIndexingBufferedSender<TModel extends object> {
5907
6087
  /**
5908
6088
  * Search Client used to call the underlying IndexBatch operations.
5909
6089
  */
@@ -5955,35 +6135,35 @@ export declare class SearchIndexingBufferedSender<Model extends object> {
5955
6135
  * @param options - Options to modify auto flush.
5956
6136
  *
5957
6137
  */
5958
- constructor(client: IndexDocumentsClient<Model>, documentKeyRetriever: (document: Model) => string, options?: SearchIndexingBufferedSenderOptions);
6138
+ constructor(client: IndexDocumentsClient<TModel>, documentKeyRetriever: (document: TModel) => string, options?: SearchIndexingBufferedSenderOptions);
5959
6139
  /**
5960
6140
  * Uploads the documents/Adds the documents to the upload queue.
5961
6141
  *
5962
6142
  * @param documents - Documents to be uploaded.
5963
6143
  * @param options - Upload options.
5964
6144
  */
5965
- uploadDocuments(documents: Model[], options?: SearchIndexingBufferedSenderUploadDocumentsOptions): Promise<void>;
6145
+ uploadDocuments(documents: TModel[], options?: SearchIndexingBufferedSenderUploadDocumentsOptions): Promise<void>;
5966
6146
  /**
5967
6147
  * Merges the documents/Adds the documents to the merge queue.
5968
6148
  *
5969
6149
  * @param documents - Documents to be merged.
5970
6150
  * @param options - Upload options.
5971
6151
  */
5972
- mergeDocuments(documents: Model[], options?: SearchIndexingBufferedSenderMergeDocumentsOptions): Promise<void>;
6152
+ mergeDocuments(documents: TModel[], options?: SearchIndexingBufferedSenderMergeDocumentsOptions): Promise<void>;
5973
6153
  /**
5974
6154
  * Merges/Uploads the documents/Adds the documents to the merge/upload queue.
5975
6155
  *
5976
6156
  * @param documents - Documents to be merged/uploaded.
5977
6157
  * @param options - Upload options.
5978
6158
  */
5979
- mergeOrUploadDocuments(documents: Model[], options?: SearchIndexingBufferedSenderMergeOrUploadDocumentsOptions): Promise<void>;
6159
+ mergeOrUploadDocuments(documents: TModel[], options?: SearchIndexingBufferedSenderMergeOrUploadDocumentsOptions): Promise<void>;
5980
6160
  /**
5981
6161
  * Deletes the documents/Adds the documents to the delete queue.
5982
6162
  *
5983
6163
  * @param documents - Documents to be deleted.
5984
6164
  * @param options - Upload options.
5985
6165
  */
5986
- deleteDocuments(documents: Model[], options?: SearchIndexingBufferedSenderDeleteDocumentsOptions): Promise<void>;
6166
+ deleteDocuments(documents: TModel[], options?: SearchIndexingBufferedSenderDeleteDocumentsOptions): Promise<void>;
5987
6167
  /**
5988
6168
  * Flushes the queue manually.
5989
6169
  *
@@ -6002,7 +6182,7 @@ export declare class SearchIndexingBufferedSender<Model extends object> {
6002
6182
  */
6003
6183
  on(event: "batchAdded", listener: (e: {
6004
6184
  action: string;
6005
- documents: Model[];
6185
+ documents: TModel[];
6006
6186
  }) => void): void;
6007
6187
  /**
6008
6188
  * Attach Batch Sent Event
@@ -6010,7 +6190,7 @@ export declare class SearchIndexingBufferedSender<Model extends object> {
6010
6190
  * @param event - Event to be emitted
6011
6191
  * @param listener - Event Listener
6012
6192
  */
6013
- on(event: "beforeDocumentSent", listener: (e: IndexDocumentsAction<Model>) => void): void;
6193
+ on(event: "beforeDocumentSent", listener: (e: IndexDocumentsAction<TModel>) => void): void;
6014
6194
  /**
6015
6195
  * Attach Batch Succeeded Event
6016
6196
  *
@@ -6033,7 +6213,7 @@ export declare class SearchIndexingBufferedSender<Model extends object> {
6033
6213
  */
6034
6214
  off(event: "batchAdded", listener: (e: {
6035
6215
  action: string;
6036
- documents: Model[];
6216
+ documents: TModel[];
6037
6217
  }) => void): void;
6038
6218
  /**
6039
6219
  * Detach Batch Sent Event
@@ -6041,7 +6221,7 @@ export declare class SearchIndexingBufferedSender<Model extends object> {
6041
6221
  * @param event - Event to be emitted
6042
6222
  * @param listener - Event Listener
6043
6223
  */
6044
- off(event: "beforeDocumentSent", listener: (e: IndexDocumentsAction<Model>) => void): void;
6224
+ off(event: "beforeDocumentSent", listener: (e: IndexDocumentsAction<TModel>) => void): void;
6045
6225
  /**
6046
6226
  * Detach Batch Succeeded Event
6047
6227
  *
@@ -6139,6 +6319,11 @@ export declare interface SearchIndexStatistics {
6139
6319
  * **NOTE: This property will not be serialized. It can only be populated by the server.**
6140
6320
  */
6141
6321
  readonly storageSize: number;
6322
+ /**
6323
+ * The amount of memory in bytes consumed by vectors in the index.
6324
+ * NOTE: This property will not be serialized. It can only be populated by the server.
6325
+ */
6326
+ readonly vectorIndexSize?: number;
6142
6327
  }
6143
6328
 
6144
6329
  /**
@@ -6146,7 +6331,7 @@ export declare interface SearchIndexStatistics {
6146
6331
  * as needed during iteration. Use .byPage() to make one request to the server
6147
6332
  * per iteration.
6148
6333
  */
6149
- export declare type SearchIterator<Model extends object, Fields extends SelectFields<Model> = SelectFields<Model>> = PagedAsyncIterableIterator<SearchResult<Model, Fields>, SearchDocumentsPageResult<Model, Fields>, ListSearchResultsPageSettings>;
6334
+ export declare type SearchIterator<TModel extends object, TFields extends SelectFields<TModel> = SelectFields<TModel>> = PagedAsyncIterableIterator<SearchResult<TModel, TFields>, SearchDocumentsPageResult<TModel, TFields>, ListSearchResultsPageSettings>;
6150
6335
 
6151
6336
  /** Defines values for SearchMode. */
6152
6337
  export declare type SearchMode = "any" | "all";
@@ -6154,26 +6339,23 @@ export declare type SearchMode = "any" | "all";
6154
6339
  /**
6155
6340
  * Options for committing a full search request.
6156
6341
  */
6157
- export declare type SearchOptions<Model extends object, Fields extends SelectFields<Model> = SelectFields<Model>> = OperationOptions & SearchRequestOptions<Model, Fields>;
6342
+ export declare type SearchOptions<TModel extends object, TFields extends SelectFields<TModel> = SelectFields<TModel>> = OperationOptions & SearchRequestOptions<TModel, TFields>;
6158
6343
 
6159
6344
  /**
6160
6345
  * Deeply pick fields of T using valid Cognitive Search OData $select
6161
6346
  * paths.
6162
6347
  */
6163
- export declare type SearchPick<T extends object, Paths extends SelectFields<T>> = [
6164
- T
6165
- ] extends [never] ? object : // We're going to get a union of individual interfaces for each field in T that's selected, so convert that to an intersection.
6166
- UnionToIntersection<Paths extends `${infer FieldName}/${infer RestPaths}` ? FieldName extends keyof T & string ? NonNullable<T[FieldName]> extends Array<infer Elem> ? Elem extends object ? RestPaths extends SelectFields<Elem> ? {
6167
- [Key in keyof T as Key & FieldName]: Array<SearchPick<Elem, RestPaths>>;
6168
- } : never : never : NonNullable<T[FieldName]> extends object ? {
6169
- [Key in keyof T as Key & FieldName]: RestPaths extends SelectFields<T[Key] & {}> ? SearchPick<T[Key] & {}, RestPaths> | Extract<T[Key], null> : never;
6170
- } : never : never : // Otherwise, capture the paths that are simple keys of T itself
6171
- Pick<T, Paths> | Extract<T, null>> & {};
6348
+ export declare type SearchPick<TModel extends object, TFields extends SelectFields<TModel>> = (<T>() => T extends TModel ? true : false) extends <T>() => T extends object ? true : false ? TModel : (<T>() => T extends TFields ? true : false) extends <T>() => T extends any ? true : false ? TModel : (<T>() => T extends TFields ? true : false) extends <T>() => T extends never ? true : false ? TModel : // We're going to get a union of individual interfaces for each field in T that's selected, so convert that to an intersection.
6349
+ UnionToIntersection<TFields extends `${infer FieldName}/${infer RestPaths}` ? FieldName extends keyof TModel & string ? NonNullable<TModel[FieldName]> extends Array<infer Elem> ? Elem extends object ? RestPaths extends SelectFields<Elem> ? {
6350
+ [Key in keyof TModel as Key & FieldName]: Array<SearchPick<Elem, RestPaths>>;
6351
+ } : never : never : NonNullable<TModel[FieldName]> extends object ? {
6352
+ [Key in keyof TModel as Key & FieldName]: RestPaths extends SelectFields<TModel[Key] & {}> ? SearchPick<TModel[Key] & {}, RestPaths> | Extract<TModel[Key], null> : never;
6353
+ } : never : never : TFields extends keyof TModel ? Pick<TModel, TFields> | Extract<TModel, null> : never> & {};
6172
6354
 
6173
6355
  /**
6174
6356
  * Parameters for filtering, sorting, faceting, paging, and other search query behaviors.
6175
6357
  */
6176
- export declare interface SearchRequest {
6358
+ export declare interface SearchRequest<TModel extends object = never> {
6177
6359
  /**
6178
6360
  * A value that specifies whether to fetch the total count of results. Default is false. Setting
6179
6361
  * this value to true may have a performance impact. Note that the count returned is an
@@ -6257,6 +6439,20 @@ export declare interface SearchRequest {
6257
6439
  * type semantic.
6258
6440
  */
6259
6441
  semanticConfiguration?: string;
6442
+ /**
6443
+ * Allows the user to choose whether a semantic call should fail completely (default / current
6444
+ * behavior), or to return partial results.
6445
+ */
6446
+ semanticErrorHandlingMode?: SemanticErrorHandlingMode;
6447
+ /**
6448
+ * Allows the user to set an upper bound on the amount of time it takes for semantic enrichment
6449
+ * to finish processing before the request fails.
6450
+ */
6451
+ semanticMaxWaitInMilliseconds?: number;
6452
+ /**
6453
+ * Enables a debugging tool that can be used to further explore your Semantic search results.
6454
+ */
6455
+ debugMode?: QueryDebugMode;
6260
6456
  /**
6261
6457
  * A full-text search query expression; Use "*" or omit this parameter to match all documents.
6262
6458
  */
@@ -6311,12 +6507,16 @@ export declare interface SearchRequest {
6311
6507
  * The comma-separated list of field names used for semantic search.
6312
6508
  */
6313
6509
  semanticFields?: string;
6510
+ /**
6511
+ * The query parameters for vector and hybrid search queries.
6512
+ */
6513
+ vector?: Vector<TModel>;
6314
6514
  }
6315
6515
 
6316
6516
  /**
6317
6517
  * Parameters for filtering, sorting, faceting, paging, and other search query behaviors.
6318
6518
  */
6319
- export declare interface SearchRequestOptions<Model extends object, Fields extends SelectFields<Model> = SelectFields<Model>> {
6519
+ export declare interface SearchRequestOptions<TModel extends object, TFields extends SelectFields<TModel> = SelectFields<TModel>> {
6320
6520
  /**
6321
6521
  * A value that specifies whether to fetch the total count of results. Default is false. Setting
6322
6522
  * this value to true may have a performance impact. Note that the count returned is an
@@ -6364,7 +6564,7 @@ export declare interface SearchRequestOptions<Model extends object, Fields exten
6364
6564
  orderBy?: string[];
6365
6565
  /**
6366
6566
  * A value that specifies the syntax of the search query. The default is 'simple'. Use 'full' if
6367
- * your query uses the Lucene query syntax. Possible values include: 'simple', 'full'
6567
+ * your query uses the Lucene query syntax. Possible values include: 'simple', 'full', 'semantic'
6368
6568
  */
6369
6569
  queryType?: QueryType;
6370
6570
  /**
@@ -6379,12 +6579,30 @@ export declare interface SearchRequestOptions<Model extends object, Fields exten
6379
6579
  * the results.
6380
6580
  */
6381
6581
  scoringProfile?: string;
6582
+ /**
6583
+ * The name of a semantic configuration that will be used when processing documents for queries of
6584
+ * type semantic.
6585
+ */
6586
+ semanticConfiguration?: string;
6587
+ /**
6588
+ * Allows the user to choose whether a semantic call should fail completely, or to return partial results.
6589
+ */
6590
+ semanticErrorHandlingMode?: SemanticErrorHandlingMode;
6591
+ /**
6592
+ * Allows the user to set an upper bound on the amount of time it takes for semantic enrichment to finish
6593
+ * processing before the request fails.
6594
+ */
6595
+ semanticMaxWaitInMilliseconds?: number;
6596
+ /**
6597
+ * Enables a debugging tool that can be used to further explore your search results.
6598
+ */
6599
+ debugMode?: QueryDebugMode;
6382
6600
  /**
6383
6601
  * The comma-separated list of field names to which to scope the full-text search. When using
6384
6602
  * fielded search (fieldName:searchExpression) in a full Lucene query, the field names of each
6385
6603
  * fielded search expression take precedence over any field names listed in this parameter.
6386
6604
  */
6387
- searchFields?: SelectFields<Model>[] | Readonly<SelectFields<Model>[]>;
6605
+ searchFields?: SearchFieldArray<TModel>;
6388
6606
  /**
6389
6607
  * The language of the query.
6390
6608
  */
@@ -6395,11 +6613,9 @@ export declare interface SearchRequestOptions<Model extends object, Fields exten
6395
6613
  speller?: Speller;
6396
6614
  /**
6397
6615
  * This parameter is only valid if the query type is 'semantic'. If set, the query returns answers
6398
- * extracted from key passages in the highest ranked documents. The number of answers returned can
6399
- * be configured by appending the pipe character '|' followed by the 'count-\<number of answers\>' option
6400
- * after the answers parameter value, such as 'extractive|count-3'. Default count is 1.
6616
+ * extracted from key passages in the highest ranked documents.
6401
6617
  */
6402
- answers?: Answers;
6618
+ answers?: Answers | AnswersOptions;
6403
6619
  /**
6404
6620
  * A value that specifies whether any or all of the search terms must be matched in order to
6405
6621
  * count the document as a match. Possible values include: 'any', 'all'
@@ -6423,7 +6639,7 @@ export declare interface SearchRequestOptions<Model extends object, Fields exten
6423
6639
  * The list of fields to retrieve. If unspecified, all fields marked as
6424
6640
  * retrievable in the schema are included.
6425
6641
  */
6426
- select?: [string] extends [Fields] ? string[] : Fields[] | Readonly<Fields[]>;
6642
+ select?: SelectArray<TFields>;
6427
6643
  /**
6428
6644
  * The number of search results to skip. This value cannot be greater than 100,000. If you need
6429
6645
  * to scan documents in sequence, but cannot use skip due to this limitation, consider using
@@ -6448,6 +6664,10 @@ export declare interface SearchRequestOptions<Model extends object, Fields exten
6448
6664
  * The list of field names used for semantic search.
6449
6665
  */
6450
6666
  semanticFields?: string[];
6667
+ /**
6668
+ * The query parameters for vector and hybrid search queries.
6669
+ */
6670
+ vector?: Vector<TModel>;
6451
6671
  }
6452
6672
 
6453
6673
  /**
@@ -6492,7 +6712,7 @@ export declare interface SearchResourceEncryptionKey {
6492
6712
  /**
6493
6713
  * Contains a document found by a search query, plus associated metadata.
6494
6714
  */
6495
- export declare type SearchResult<Model extends object, Fields extends SelectFields<Model> = SelectFields<Model>> = {
6715
+ export declare type SearchResult<TModel extends object, TFields extends SelectFields<TModel> = SelectFields<TModel>> = {
6496
6716
  /**
6497
6717
  * The relevance score of the document compared to other documents returned by the query.
6498
6718
  * **NOTE: This property will not be serialized. It can only be populated by the server.**
@@ -6509,14 +6729,19 @@ export declare type SearchResult<Model extends object, Fields extends SelectFiel
6509
6729
  * **NOTE: This property will not be serialized. It can only be populated by the server.**
6510
6730
  */
6511
6731
  readonly highlights?: {
6512
- [k in SelectFields<Model>]?: string[];
6732
+ [k in SelectFields<TModel>]?: string[];
6513
6733
  };
6514
6734
  /**
6515
6735
  * 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'.
6516
6736
  * NOTE: This property will not be serialized. It can only be populated by the server.
6517
6737
  */
6518
6738
  readonly captions?: CaptionResult[];
6519
- document: NarrowedModel<Model, Fields>;
6739
+ document: NarrowedModel<TModel, TFields>;
6740
+ /**
6741
+ * Contains debugging information that can be used to further explore your search results.
6742
+ * NOTE: This property will not be serialized. It can only be populated by the server.
6743
+ */
6744
+ readonly documentDebugInfo?: DocumentDebugInfo[];
6520
6745
  };
6521
6746
 
6522
6747
  /**
@@ -6544,14 +6769,19 @@ export declare interface SearchSuggester {
6544
6769
  sourceFields: string[];
6545
6770
  }
6546
6771
 
6772
+ /**
6773
+ * If `TFields` is never, an untyped string array
6774
+ * Otherwise, a narrowed `Fields[]` type to be used elsewhere in the consuming type.
6775
+ */
6776
+ export declare type SelectArray<TFields = never> = [string] extends [TFields] ? readonly TFields[] : (<T>() => T extends TFields ? true : false) extends <T>() => T extends never ? true : false ? readonly string[] : readonly TFields[];
6777
+
6547
6778
  /**
6548
6779
  * Produces a union of valid Cognitive Search OData $select paths for T
6549
6780
  * using a post-order traversal of the field tree rooted at T.
6550
6781
  */
6551
- export declare type SelectFields<T extends object> = T extends Array<infer Elem> ? Elem extends object ? SelectFields<Elem> : never : {
6552
- [Key in keyof T]: Key extends string ? NonNullable<T[Key]> extends object ? NonNullable<T[Key]> extends ExcludedODataTypes ? Key : SelectFields<NonNullable<T[Key]>> extends infer NextPaths ? NextPaths extends string ? // Union this key with all the next paths separated with '/'
6553
- Key | `${Key}/${NextPaths}` : Key : never : Key : never;
6554
- }[keyof T & string] & string;
6782
+ export declare type SelectFields<TModel extends object> = (<T>() => T extends TModel ? true : false) extends <T>() => T extends never ? true : false ? string : (<T>() => T extends TModel ? true : false) extends <T>() => T extends any ? true : false ? string : (<T>() => T extends TModel ? true : false) extends <T>() => T extends object ? true : false ? string : TModel extends Array<infer Elem> ? Elem extends object ? SelectFields<Elem> : never : {
6783
+ [Key in keyof TModel]: Key extends string ? NonNullable<TModel[Key]> extends object ? NonNullable<TModel[Key]> extends ExcludedODataTypes ? Key : SelectFields<NonNullable<TModel[Key]>> extends infer NextPaths ? (<T>() => T extends NextPaths ? true : false) extends <T>() => T extends never ? true : false ? Key : NextPaths extends string ? Key | `${Key}/${NextPaths}` : Key : never : Key : never;
6784
+ }[keyof TModel & string] & string;
6555
6785
 
6556
6786
  /** Defines a specific configuration to be used in the context of semantic capabilities. */
6557
6787
  export declare interface SemanticConfiguration {
@@ -6561,22 +6791,85 @@ export declare interface SemanticConfiguration {
6561
6791
  prioritizedFields: PrioritizedFields;
6562
6792
  }
6563
6793
 
6794
+ /**
6795
+ * Debug options for semantic search queries.
6796
+ */
6797
+ export declare interface SemanticDebugInfo {
6798
+ /**
6799
+ * The title field that was sent to the semantic enrichment process, as well as how it was used
6800
+ * NOTE: This property will not be serialized. It can only be populated by the server.
6801
+ */
6802
+ readonly titleField?: QueryResultDocumentSemanticField;
6803
+ /**
6804
+ * The content fields that were sent to the semantic enrichment process, as well as how they were used
6805
+ * NOTE: This property will not be serialized. It can only be populated by the server.
6806
+ */
6807
+ readonly contentFields?: QueryResultDocumentSemanticField[];
6808
+ /**
6809
+ * The keyword fields that were sent to the semantic enrichment process, as well as how they were used
6810
+ * NOTE: This property will not be serialized. It can only be populated by the server.
6811
+ */
6812
+ readonly keywordFields?: QueryResultDocumentSemanticField[];
6813
+ /**
6814
+ * The raw concatenated strings that were sent to the semantic enrichment process.
6815
+ * NOTE: This property will not be serialized. It can only be populated by the server.
6816
+ */
6817
+ readonly rerankerInput?: QueryResultDocumentRerankerInput;
6818
+ }
6819
+
6820
+ /**
6821
+ * partial: If the semantic processing fails, partial results still return. The definition of
6822
+ * partial results depends on what semantic step failed and what was the reason for failure.
6823
+ *
6824
+ * fail: If there is an exception during the semantic processing step, the query will fail and
6825
+ * return the appropriate HTTP code depending on the error.
6826
+ */
6827
+ export declare type SemanticErrorHandlingMode = "partial" | "fail";
6828
+
6564
6829
  /** A field that is used as part of the semantic configuration. */
6565
6830
  export declare interface SemanticField {
6566
6831
  name?: string;
6567
6832
  }
6568
6833
 
6834
+ /**
6835
+ * used: The field was fully used for semantic enrichment.
6836
+ *
6837
+ * unused: The field was not used for semantic enrichment.
6838
+ *
6839
+ * partial: The field was partially used for semantic enrichment.
6840
+ */
6841
+ export declare type SemanticFieldState = "used" | "unused" | "partial";
6842
+
6843
+ /**
6844
+ * maxWaitExceeded: If 'semanticMaxWaitInMilliseconds' was set and the semantic processing duration
6845
+ * exceeded that value. Only the base results were returned.
6846
+ *
6847
+ * capacityOverloaded: The request was throttled. Only the base results were returned.
6848
+ *
6849
+ * transient: At least one step of the semantic process failed.
6850
+ */
6851
+ export declare type SemanticPartialResponseReason = "maxWaitExceeded" | "capacityOverloaded" | "transient";
6852
+
6853
+ /**
6854
+ * baseResults: Results without any semantic enrichment or reranking.
6855
+ *
6856
+ * rerankedResults: Results have been reranked with the reranker model and will include semantic
6857
+ * captions. They will not include any answers, answers highlights or caption highlights.
6858
+ */
6859
+ export declare type SemanticPartialResponseType = "baseResults" | "rerankedResults";
6860
+
6569
6861
  /** Defines parameters for a search index that influence semantic capabilities. */
6570
6862
  export declare interface SemanticSettings {
6863
+ /** Allows you to set the name of a default semantic configuration in your index, making it optional to pass it on as a query parameter every time. */
6864
+ defaultConfiguration?: string;
6571
6865
  /** The semantic configurations for the index. */
6572
6866
  configurations?: SemanticConfiguration[];
6573
6867
  }
6574
6868
 
6575
6869
  /**
6576
- * Text analytics positive-negative sentiment analysis, scored as a floating point value in a range of zero to 1.
6870
+ * This skill is deprecated. Use the V3.SentimentSkill instead.
6577
6871
  *
6578
- * @deprecated SentimentSkill has been deprecated. See
6579
- * https://learn.microsoft.com/en-us/azure/search/cognitive-search-skill-deprecated
6872
+ * @deprecated
6580
6873
  */
6581
6874
  export declare type SentimentSkill = BaseSearchIndexerSkill & {
6582
6875
  /** Polymorphic discriminator, which specifies the different types this object can be */
@@ -6623,7 +6916,7 @@ export declare type SentimentSkillV3 = BaseSearchIndexerSkill & {
6623
6916
  /** Represents service-level resource counters and quotas. */
6624
6917
  export declare interface ServiceCounters {
6625
6918
  /** Total number of aliases. */
6626
- aliasCounter?: ResourceCounter;
6919
+ aliasCounter: ResourceCounter;
6627
6920
  /** Total number of documents across all indexes in the service. */
6628
6921
  documentCounter: ResourceCounter;
6629
6922
  /** Total number of indexes. */
@@ -6637,7 +6930,9 @@ export declare interface ServiceCounters {
6637
6930
  /** Total number of synonym maps. */
6638
6931
  synonymMapCounter: ResourceCounter;
6639
6932
  /** Total number of skillsets. */
6640
- skillsetCounter?: ResourceCounter;
6933
+ skillsetCounter: ResourceCounter;
6934
+ /** Total memory consumption of all vector indexes within the service, in bytes. */
6935
+ vectorIndexSizeCounter: ResourceCounter;
6641
6936
  }
6642
6937
 
6643
6938
  /** Represents various service level limits. */
@@ -6699,10 +6994,10 @@ export declare interface SimpleField {
6699
6994
  name: string;
6700
6995
  /**
6701
6996
  * The data type of the field. Possible values include: 'Edm.String', 'Edm.Int32', 'Edm.Int64',
6702
- * 'Edm.Double', 'Edm.Boolean', 'Edm.DateTimeOffset', 'Edm.GeographyPoint'
6997
+ * 'Edm.Double', 'Edm.Boolean', 'Edm.DateTimeOffset', 'Edm.GeographyPoint',
6703
6998
  * 'Collection(Edm.String)', 'Collection(Edm.Int32)', 'Collection(Edm.Int64)',
6704
6999
  * 'Collection(Edm.Double)', 'Collection(Edm.Boolean)', 'Collection(Edm.DateTimeOffset)',
6705
- * 'Collection(Edm.GeographyPoint)'
7000
+ * 'Collection(Edm.GeographyPoint)', 'Collection(Edm.Single)'
6706
7001
  */
6707
7002
  type: SearchFieldDataType;
6708
7003
  /**
@@ -6792,6 +7087,15 @@ export declare interface SimpleField {
6792
7087
  * The name of the normalizer used at indexing time for the field.
6793
7088
  */
6794
7089
  normalizerName?: LexicalNormalizerName;
7090
+ /**
7091
+ * The dimensionality of the vector field.
7092
+ */
7093
+ vectorSearchDimensions?: number;
7094
+ /**
7095
+ * The name of the vector search algorithm configuration that specifies the algorithm and
7096
+ * optional parameters for searching the vector field.
7097
+ */
7098
+ vectorSearchConfiguration?: string;
6795
7099
  }
6796
7100
 
6797
7101
  /** A filter that stems words using a Snowball-generated stemmer. This token filter is implemented using Apache Lucene. */
@@ -6907,12 +7211,12 @@ export declare type StopwordsTokenFilter = BaseTokenFilter & {
6907
7211
  /**
6908
7212
  * Response containing suggestion query results from an index.
6909
7213
  */
6910
- export declare interface SuggestDocumentsResult<Model extends object, Fields extends SelectFields<Model> = SelectFields<Model>> {
7214
+ export declare interface SuggestDocumentsResult<TModel extends object, TFields extends SelectFields<TModel> = SelectFields<TModel>> {
6911
7215
  /**
6912
7216
  * The sequence of results returned by the query.
6913
7217
  * **NOTE: This property will not be serialized. It can only be populated by the server.**
6914
7218
  */
6915
- readonly results: SuggestResult<Model, Fields>[];
7219
+ readonly results: SuggestResult<TModel, TFields>[];
6916
7220
  /**
6917
7221
  * A value indicating the percentage of the index that was included in the query, or null if
6918
7222
  * minimumCoverage was not set in the request.
@@ -6921,19 +7225,17 @@ export declare interface SuggestDocumentsResult<Model extends object, Fields ext
6921
7225
  readonly coverage?: number;
6922
7226
  }
6923
7227
 
6924
- export declare type SuggestNarrowedModel<Model extends object, Fields extends SelectFields<Model> = SelectFields<Model>> = [Model] extends [never] ? object : [
6925
- Fields
6926
- ] extends [never] ? keyof ExtractDocumentKey<Model> extends never ? Model : ExtractDocumentKey<Model> : Fields extends SelectFields<Model> ? NarrowedModel<Model, Fields> : never;
7228
+ export declare type SuggestNarrowedModel<TModel extends object, TFields extends SelectFields<TModel> = SelectFields<TModel>> = (<T>() => T extends TModel ? true : false) extends <T>() => T extends never ? true : false ? TModel : (<T>() => T extends TModel ? true : false) extends <T>() => T extends object ? true : false ? TModel : (<T>() => T extends TFields ? true : false) extends <T>() => T extends never ? true : false ? keyof ExtractDocumentKey<TModel> extends never ? TModel : ExtractDocumentKey<TModel> : TFields extends SelectFields<TModel> ? NarrowedModel<TModel, TFields> : never;
6927
7229
 
6928
7230
  /**
6929
7231
  * Options for retrieving suggestions based on the searchText.
6930
7232
  */
6931
- export declare type SuggestOptions<Model extends object, Fields extends SelectFields<Model> = SelectFields<Model>> = OperationOptions & SuggestRequest<Model, Fields>;
7233
+ export declare type SuggestOptions<TModel extends object, TFields extends SelectFields<TModel> = SelectFields<TModel>> = OperationOptions & SuggestRequest<TModel, TFields>;
6932
7234
 
6933
7235
  /**
6934
7236
  * Parameters for filtering, sorting, fuzzy matching, and other suggestions query behaviors.
6935
7237
  */
6936
- export declare interface SuggestRequest<Model extends object, Fields extends SelectFields<Model> = SelectFields<Model>> {
7238
+ export declare interface SuggestRequest<TModel extends object, TFields extends SelectFields<TModel> = SelectFields<TModel>> {
6937
7239
  /**
6938
7240
  * An OData expression that filters the documents considered for suggestions.
6939
7241
  */
@@ -6976,12 +7278,12 @@ export declare interface SuggestRequest<Model extends object, Fields extends Sel
6976
7278
  * The comma-separated list of field names to search for the specified search text. Target fields
6977
7279
  * must be included in the specified suggester.
6978
7280
  */
6979
- searchFields?: SelectFields<Model>[] | Readonly<SelectFields<Model>[]>;
7281
+ searchFields?: SearchFieldArray<TModel>;
6980
7282
  /**
6981
7283
  * The list of fields to retrieve. If unspecified, only the key field will be
6982
7284
  * included in the results.
6983
7285
  */
6984
- select?: [string] extends [Fields] ? string[] : Fields[] | Readonly<Fields[]>;
7286
+ select?: SelectArray<TFields>;
6985
7287
  /**
6986
7288
  /**
6987
7289
  * The number of suggestions to retrieve. This must be a value between 1 and 100. The default is
@@ -6993,13 +7295,13 @@ export declare interface SuggestRequest<Model extends object, Fields extends Sel
6993
7295
  /**
6994
7296
  * A result containing a document found by a suggestion query, plus associated metadata.
6995
7297
  */
6996
- export declare type SuggestResult<Model extends object, Fields extends SelectFields<Model> = SelectFields<Model>> = {
7298
+ export declare type SuggestResult<TModel extends object, TFields extends SelectFields<TModel> = SelectFields<TModel>> = {
6997
7299
  /**
6998
7300
  * The text of the suggestion result.
6999
7301
  * **NOTE: This property will not be serialized. It can only be populated by the server.**
7000
7302
  */
7001
7303
  readonly text: string;
7002
- document: SuggestNarrowedModel<Model, Fields>;
7304
+ document: SuggestNarrowedModel<TModel, TFields>;
7003
7305
  };
7004
7306
 
7005
7307
  /**
@@ -7233,7 +7535,7 @@ export declare type UaxUrlEmailTokenizer = BaseLexicalTokenizer & {
7233
7535
  maxTokenLength?: number;
7234
7536
  };
7235
7537
 
7236
- export declare type UnionToIntersection<U> = (U extends unknown ? (_: U) => unknown : never) extends (_: infer I) => unknown ? I : never;
7538
+ export declare type UnionToIntersection<Union> = (Union extends unknown ? (_: Union) => unknown : never) extends (_: infer I) => unknown ? I : never;
7237
7539
 
7238
7540
  /** Filters out tokens with same text as the previous token. This token filter is implemented using Apache Lucene. */
7239
7541
  export declare type UniqueTokenFilter = BaseTokenFilter & {
@@ -7248,6 +7550,30 @@ export declare type UniqueTokenFilter = BaseTokenFilter & {
7248
7550
  */
7249
7551
  export declare type UploadDocumentsOptions = IndexDocumentsOptions;
7250
7552
 
7553
+ /** The query parameters for vector and hybrid search queries. */
7554
+ export declare interface Vector<T extends object> {
7555
+ /** The vector representation of a search query. */
7556
+ value?: number[];
7557
+ /** Number of nearest neighbors to return as top hits. */
7558
+ kNearestNeighborsCount?: number;
7559
+ /** Vector Fields of type Collection(Edm.Single) to be included in the vector searched. */
7560
+ fields?: SearchFieldArray<T>;
7561
+ }
7562
+
7563
+ /**
7564
+ * Contains configuration options related to vector search.
7565
+ */
7566
+ export declare interface VectorSearch {
7567
+ /**
7568
+ * Contains configuration options specific to the algorithm used during indexing time.
7569
+ */
7570
+ algorithmConfigurations?: VectorSearchAlgorithmConfiguration[];
7571
+ }
7572
+
7573
+ export declare type VectorSearchAlgorithmConfiguration = BaseVectorSearchAlgorithmConfiguration | HnswVectorSearchAlgorithmConfiguration;
7574
+
7575
+ export declare type VectorSearchAlgorithmMetric = "cosine" | "euclidean" | "dotProduct";
7576
+
7251
7577
  /**
7252
7578
  * Defines values for VisualFeature. \
7253
7579
  * {@link KnownVisualFeature} can be used interchangeably with VisualFeature,
@@ -7263,25 +7589,58 @@ export declare type UploadDocumentsOptions = IndexDocumentsOptions;
7263
7589
  */
7264
7590
  export declare type VisualFeature = string;
7265
7591
 
7266
- /** A skill that can call a Web API endpoint, allowing you to extend a skillset by having it call your custom code. */
7267
- export declare type WebApiSkill = BaseSearchIndexerSkill & {
7268
- /** Polymorphic discriminator, which specifies the different types this object can be */
7592
+ /**
7593
+ * A skill that can call a Web API endpoint, allowing you to extend a skillset by having it call
7594
+ * your custom code.
7595
+ */
7596
+ export declare interface WebApiSkill extends BaseSearchIndexerSkill {
7597
+ /**
7598
+ * Polymorphic discriminator, which specifies the different types this object can be
7599
+ */
7269
7600
  odatatype: "#Microsoft.Skills.Custom.WebApiSkill";
7270
- /** The url for the Web API. */
7601
+ /**
7602
+ * The url for the Web API.
7603
+ */
7271
7604
  uri: string;
7272
- /** The headers required to make the http request. */
7605
+ /**
7606
+ * The headers required to make the http request.
7607
+ */
7273
7608
  httpHeaders?: {
7274
7609
  [propertyName: string]: string;
7275
7610
  };
7276
- /** The method for the http request. */
7611
+ /**
7612
+ * The method for the http request.
7613
+ */
7277
7614
  httpMethod?: string;
7278
- /** The desired timeout for the request. Default is 30 seconds. */
7615
+ /**
7616
+ * The desired timeout for the request. Default is 30 seconds.
7617
+ */
7279
7618
  timeout?: string;
7280
- /** The desired batch size which indicates number of documents. */
7619
+ /**
7620
+ * The desired batch size which indicates number of documents.
7621
+ */
7281
7622
  batchSize?: number;
7282
- /** If set, the number of parallel calls that can be made to the Web API. */
7623
+ /**
7624
+ * If set, the number of parallel calls that can be made to the Web API.
7625
+ */
7283
7626
  degreeOfParallelism?: number;
7284
- };
7627
+ /**
7628
+ * Applies to custom skills that connect to external code in an Azure function or some other
7629
+ * application that provides the transformations. This value should be the application ID
7630
+ * created for the function or app when it was registered with Azure Active Directory. When
7631
+ * specified, the custom skill connects to the function or app using a managed ID (either system
7632
+ * or user-assigned) of the search service and the access token of the function or app, using
7633
+ * this value as the resource id for creating the scope of the access token.
7634
+ */
7635
+ authResourceId?: string;
7636
+ /**
7637
+ * The user-assigned managed identity used for outbound connections. If an authResourceId is
7638
+ * provided and it's not specified, the system-assigned managed identity is used. On updates to
7639
+ * the indexer, if the identity is unspecified, the value remains unchanged. If undefined, the
7640
+ * value of this property is cleared.
7641
+ */
7642
+ authIdentity?: SearchIndexerDataIdentity;
7643
+ }
7285
7644
 
7286
7645
  /** Splits words into subwords and performs optional transformations on subword groups. This token filter is implemented using Apache Lucene. */
7287
7646
  export declare type WordDelimiterTokenFilter = BaseTokenFilter & {