@azure/search-documents 12.0.0-beta.1 → 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 (35) hide show
  1. package/README.md +56 -15
  2. package/dist/index.js +595 -139
  3. package/dist/index.js.map +1 -1
  4. package/dist-esm/src/constants.js +1 -1
  5. package/dist-esm/src/constants.js.map +1 -1
  6. package/dist-esm/src/generated/data/models/index.js +50 -6
  7. package/dist-esm/src/generated/data/models/index.js.map +1 -1
  8. package/dist-esm/src/generated/data/models/mappers.js +202 -0
  9. package/dist-esm/src/generated/data/models/mappers.js.map +1 -1
  10. package/dist-esm/src/generated/data/models/parameters.js +30 -0
  11. package/dist-esm/src/generated/data/models/parameters.js.map +1 -1
  12. package/dist-esm/src/generated/data/operations/documents.js +3 -0
  13. package/dist-esm/src/generated/data/operations/documents.js.map +1 -1
  14. package/dist-esm/src/generated/data/searchClient.js +1 -1
  15. package/dist-esm/src/generated/data/searchClient.js.map +1 -1
  16. package/dist-esm/src/generated/service/models/index.js +15 -14
  17. package/dist-esm/src/generated/service/models/index.js.map +1 -1
  18. package/dist-esm/src/generated/service/models/mappers.js +190 -7
  19. package/dist-esm/src/generated/service/models/mappers.js.map +1 -1
  20. package/dist-esm/src/generated/service/searchServiceClient.js +1 -1
  21. package/dist-esm/src/generated/service/searchServiceClient.js.map +1 -1
  22. package/dist-esm/src/index.js.map +1 -1
  23. package/dist-esm/src/indexModels.js.map +1 -1
  24. package/dist-esm/src/searchClient.js +51 -57
  25. package/dist-esm/src/searchClient.js.map +1 -1
  26. package/dist-esm/src/searchIndexClient.js +5 -16
  27. package/dist-esm/src/searchIndexClient.js.map +1 -1
  28. package/dist-esm/src/searchIndexerClient.js +0 -11
  29. package/dist-esm/src/searchIndexerClient.js.map +1 -1
  30. package/dist-esm/src/searchIndexingBufferedSender.js.map +1 -1
  31. package/dist-esm/src/serviceModels.js.map +1 -1
  32. package/dist-esm/src/serviceUtils.js +39 -26
  33. package/dist-esm/src/serviceUtils.js.map +1 -1
  34. package/package.json +14 -5
  35. package/types/search-documents.d.ts +469 -110
package/dist/index.js CHANGED
@@ -134,6 +134,20 @@ const SearchDocumentsResult = {
134
134
  className: "SearchRequest"
135
135
  }
136
136
  },
137
+ semanticPartialResponseReason: {
138
+ serializedName: "@search\\.semanticPartialResponseReason",
139
+ readOnly: true,
140
+ type: {
141
+ name: "String"
142
+ }
143
+ },
144
+ semanticPartialResponseType: {
145
+ serializedName: "@search\\.semanticPartialResponseType",
146
+ readOnly: true,
147
+ type: {
148
+ name: "String"
149
+ }
150
+ },
137
151
  results: {
138
152
  serializedName: "value",
139
153
  required: true,
@@ -316,6 +330,28 @@ const SearchRequest = {
316
330
  name: "String"
317
331
  }
318
332
  },
333
+ semanticErrorHandling: {
334
+ serializedName: "semanticErrorHandling",
335
+ type: {
336
+ name: "String"
337
+ }
338
+ },
339
+ semanticMaxWaitInMilliseconds: {
340
+ constraints: {
341
+ InclusiveMinimum: 700
342
+ },
343
+ serializedName: "semanticMaxWaitInMilliseconds",
344
+ nullable: true,
345
+ type: {
346
+ name: "Number"
347
+ }
348
+ },
349
+ debug: {
350
+ serializedName: "debug",
351
+ type: {
352
+ name: "String"
353
+ }
354
+ },
319
355
  searchText: {
320
356
  serializedName: "search",
321
357
  type: {
@@ -382,6 +418,44 @@ const SearchRequest = {
382
418
  type: {
383
419
  name: "String"
384
420
  }
421
+ },
422
+ vector: {
423
+ serializedName: "vector",
424
+ type: {
425
+ name: "Composite",
426
+ className: "Vector"
427
+ }
428
+ }
429
+ }
430
+ }
431
+ };
432
+ const Vector = {
433
+ type: {
434
+ name: "Composite",
435
+ className: "Vector",
436
+ modelProperties: {
437
+ value: {
438
+ serializedName: "value",
439
+ type: {
440
+ name: "Sequence",
441
+ element: {
442
+ type: {
443
+ name: "Number"
444
+ }
445
+ }
446
+ }
447
+ },
448
+ kNearestNeighborsCount: {
449
+ serializedName: "k",
450
+ type: {
451
+ name: "Number"
452
+ }
453
+ },
454
+ fields: {
455
+ serializedName: "fields",
456
+ type: {
457
+ name: "String"
458
+ }
385
459
  }
386
460
  }
387
461
  }
@@ -431,6 +505,20 @@ const SearchResult = {
431
505
  }
432
506
  }
433
507
  }
508
+ },
509
+ documentDebugInfo: {
510
+ serializedName: "@search\\.documentDebugInfo",
511
+ readOnly: true,
512
+ nullable: true,
513
+ type: {
514
+ name: "Sequence",
515
+ element: {
516
+ type: {
517
+ name: "Composite",
518
+ className: "DocumentDebugInfo"
519
+ }
520
+ }
521
+ }
434
522
  }
435
523
  }
436
524
  }
@@ -459,6 +547,120 @@ const CaptionResult = {
459
547
  }
460
548
  }
461
549
  };
550
+ const DocumentDebugInfo = {
551
+ type: {
552
+ name: "Composite",
553
+ className: "DocumentDebugInfo",
554
+ modelProperties: {
555
+ semantic: {
556
+ serializedName: "semantic",
557
+ type: {
558
+ name: "Composite",
559
+ className: "SemanticDebugInfo"
560
+ }
561
+ }
562
+ }
563
+ }
564
+ };
565
+ const SemanticDebugInfo = {
566
+ type: {
567
+ name: "Composite",
568
+ className: "SemanticDebugInfo",
569
+ modelProperties: {
570
+ titleField: {
571
+ serializedName: "titleField",
572
+ type: {
573
+ name: "Composite",
574
+ className: "QueryResultDocumentSemanticField"
575
+ }
576
+ },
577
+ contentFields: {
578
+ serializedName: "contentFields",
579
+ readOnly: true,
580
+ type: {
581
+ name: "Sequence",
582
+ element: {
583
+ type: {
584
+ name: "Composite",
585
+ className: "QueryResultDocumentSemanticField"
586
+ }
587
+ }
588
+ }
589
+ },
590
+ keywordFields: {
591
+ serializedName: "keywordFields",
592
+ readOnly: true,
593
+ type: {
594
+ name: "Sequence",
595
+ element: {
596
+ type: {
597
+ name: "Composite",
598
+ className: "QueryResultDocumentSemanticField"
599
+ }
600
+ }
601
+ }
602
+ },
603
+ rerankerInput: {
604
+ serializedName: "rerankerInput",
605
+ type: {
606
+ name: "Composite",
607
+ className: "QueryResultDocumentRerankerInput"
608
+ }
609
+ }
610
+ }
611
+ }
612
+ };
613
+ const QueryResultDocumentSemanticField = {
614
+ type: {
615
+ name: "Composite",
616
+ className: "QueryResultDocumentSemanticField",
617
+ modelProperties: {
618
+ name: {
619
+ serializedName: "name",
620
+ readOnly: true,
621
+ type: {
622
+ name: "String"
623
+ }
624
+ },
625
+ state: {
626
+ serializedName: "state",
627
+ readOnly: true,
628
+ type: {
629
+ name: "String"
630
+ }
631
+ }
632
+ }
633
+ }
634
+ };
635
+ const QueryResultDocumentRerankerInput = {
636
+ type: {
637
+ name: "Composite",
638
+ className: "QueryResultDocumentRerankerInput",
639
+ modelProperties: {
640
+ title: {
641
+ serializedName: "title",
642
+ readOnly: true,
643
+ type: {
644
+ name: "String"
645
+ }
646
+ },
647
+ content: {
648
+ serializedName: "content",
649
+ readOnly: true,
650
+ type: {
651
+ name: "String"
652
+ }
653
+ },
654
+ keywords: {
655
+ serializedName: "keywords",
656
+ readOnly: true,
657
+ type: {
658
+ name: "String"
659
+ }
660
+ }
661
+ }
662
+ }
663
+ };
462
664
  const SuggestDocumentsResult = {
463
665
  type: {
464
666
  name: "Composite",
@@ -812,8 +1014,13 @@ var Mappers$1 = /*#__PURE__*/Object.freeze({
812
1014
  FacetResult: FacetResult,
813
1015
  AnswerResult: AnswerResult,
814
1016
  SearchRequest: SearchRequest,
1017
+ Vector: Vector,
815
1018
  SearchResult: SearchResult,
816
1019
  CaptionResult: CaptionResult,
1020
+ DocumentDebugInfo: DocumentDebugInfo,
1021
+ SemanticDebugInfo: SemanticDebugInfo,
1022
+ QueryResultDocumentSemanticField: QueryResultDocumentSemanticField,
1023
+ QueryResultDocumentRerankerInput: QueryResultDocumentRerankerInput,
817
1024
  SuggestDocumentsResult: SuggestDocumentsResult,
818
1025
  SuggestResult: SuggestResult,
819
1026
  SuggestRequest: SuggestRequest,
@@ -1017,6 +1224,36 @@ const semanticConfiguration = {
1017
1224
  }
1018
1225
  }
1019
1226
  };
1227
+ const semanticErrorHandling = {
1228
+ parameterPath: ["options", "searchOptions", "semanticErrorHandling"],
1229
+ mapper: {
1230
+ serializedName: "semanticErrorHandling",
1231
+ type: {
1232
+ name: "String"
1233
+ }
1234
+ }
1235
+ };
1236
+ const semanticMaxWaitInMilliseconds = {
1237
+ parameterPath: ["options", "searchOptions", "semanticMaxWaitInMilliseconds"],
1238
+ mapper: {
1239
+ constraints: {
1240
+ InclusiveMinimum: 700
1241
+ },
1242
+ serializedName: "semanticMaxWaitInMilliseconds",
1243
+ type: {
1244
+ name: "Number"
1245
+ }
1246
+ }
1247
+ };
1248
+ const debug = {
1249
+ parameterPath: ["options", "searchOptions", "debug"],
1250
+ mapper: {
1251
+ serializedName: "debug",
1252
+ type: {
1253
+ name: "String"
1254
+ }
1255
+ }
1256
+ };
1020
1257
  const searchFields = {
1021
1258
  parameterPath: ["options", "searchOptions", "searchFields"],
1022
1259
  mapper: {
@@ -1532,6 +1769,9 @@ const searchGetOperationSpec = {
1532
1769
  scoringParameters,
1533
1770
  scoringProfile,
1534
1771
  semanticConfiguration,
1772
+ semanticErrorHandling,
1773
+ semanticMaxWaitInMilliseconds,
1774
+ debug,
1535
1775
  searchFields,
1536
1776
  queryLanguage,
1537
1777
  speller,
@@ -1734,7 +1974,7 @@ class SearchClient$1 extends coreHttpCompat__namespace.ExtendedServiceClient {
1734
1974
  const defaults = {
1735
1975
  requestContentType: "application/json; charset=utf-8"
1736
1976
  };
1737
- const packageDetails = `azsdk-js-search-documents/12.0.0-beta.1`;
1977
+ const packageDetails = `azsdk-js-search-documents/12.0.0-beta.2`;
1738
1978
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
1739
1979
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
1740
1980
  : `${packageDetails}`;
@@ -1770,10 +2010,6 @@ function createSearchApiKeyCredentialPolicy(credential) {
1770
2010
  };
1771
2011
  }
1772
2012
 
1773
- // Copyright (c) Microsoft Corporation.
1774
- // Licensed under the MIT license.
1775
- const SDK_VERSION = "12.0.0-beta.1";
1776
-
1777
2013
  // Copyright (c) Microsoft Corporation.
1778
2014
  /**
1779
2015
  * The `@azure/logger` configuration for this package.
@@ -2891,15 +3127,16 @@ function convertFieldsToPublic(fields) {
2891
3127
  return fields;
2892
3128
  }
2893
3129
  return fields.map((field) => {
2894
- let result;
2895
3130
  if (field.type === "Collection(Edm.ComplexType)" || field.type === "Edm.ComplexType") {
2896
- return {
3131
+ const result = {
2897
3132
  name: field.name,
2898
3133
  type: field.type,
2899
3134
  fields: convertFieldsToPublic(field.fields),
2900
3135
  };
3136
+ return result;
2901
3137
  }
2902
3138
  else {
3139
+ const type = field.type;
2903
3140
  const analyzerName = field.analyzer;
2904
3141
  const searchAnalyzerName = field.searchAnalyzer;
2905
3142
  const indexAnalyzerName = field.indexAnalyzer;
@@ -2907,14 +3144,15 @@ function convertFieldsToPublic(fields) {
2907
3144
  const normalizerName = field.normalizer;
2908
3145
  const { retrievable } = field, restField = tslib.__rest(field, ["retrievable"]);
2909
3146
  const hidden = typeof retrievable === "boolean" ? !retrievable : retrievable;
2910
- result = Object.assign(Object.assign({}, restField), { hidden,
3147
+ const result = Object.assign(Object.assign({}, restField), { type,
3148
+ hidden,
2911
3149
  analyzerName,
2912
3150
  searchAnalyzerName,
2913
3151
  indexAnalyzerName,
2914
3152
  synonymMapNames,
2915
3153
  normalizerName });
3154
+ return result;
2916
3155
  }
2917
- return result;
2918
3156
  });
2919
3157
  }
2920
3158
  function convertFieldsToGenerated(fields) {
@@ -3036,11 +3274,12 @@ function generatedIndexToPublicIndex(generatedIndex) {
3036
3274
  fields: convertFieldsToPublic(generatedIndex.fields),
3037
3275
  similarity: convertSimilarityToPublic(generatedIndex.similarity),
3038
3276
  semanticSettings: generatedIndex.semanticSettings,
3277
+ vectorSearch: generatedIndex.vectorSearch,
3039
3278
  };
3040
3279
  }
3041
3280
  function generatedSearchResultToPublicSearchResult(results) {
3042
3281
  const returnValues = results.map((result) => {
3043
- const { _score, _highlights, rerankerScore, captions } = result, restProps = tslib.__rest(result, ["_score", "_highlights", "rerankerScore", "captions"]);
3282
+ const { _score, _highlights, rerankerScore, captions, documentDebugInfo } = result, restProps = tslib.__rest(result, ["_score", "_highlights", "rerankerScore", "captions", "documentDebugInfo"]);
3044
3283
  const doc = Object.assign({}, restProps);
3045
3284
  const obj = {
3046
3285
  score: _score,
@@ -3048,6 +3287,7 @@ function generatedSearchResultToPublicSearchResult(results) {
3048
3287
  rerankerScore,
3049
3288
  captions,
3050
3289
  document: doc,
3290
+ documentDebugInfo,
3051
3291
  };
3052
3292
  return obj;
3053
3293
  });
@@ -3070,23 +3310,8 @@ function generatedSuggestDocumentsResultToPublicSuggestDocumentsResult(searchDoc
3070
3310
  return result;
3071
3311
  }
3072
3312
  function publicIndexToGeneratedIndex(index) {
3073
- return {
3074
- name: index.name,
3075
- defaultScoringProfile: index.defaultScoringProfile,
3076
- corsOptions: index.corsOptions,
3077
- suggesters: index.suggesters,
3078
- encryptionKey: convertEncryptionKeyToGenerated(index.encryptionKey),
3079
- etag: index.etag,
3080
- tokenFilters: convertTokenFiltersToGenerated(index.tokenFilters),
3081
- charFilters: index.charFilters,
3082
- normalizers: index.normalizers,
3083
- scoringProfiles: index.scoringProfiles,
3084
- analyzers: convertAnalyzersToGenerated(index.analyzers),
3085
- tokenizers: convertTokenizersToGenerated(index.tokenizers),
3086
- fields: convertFieldsToGenerated(index.fields),
3087
- similarity: convertSimilarityToGenerated(index.similarity),
3088
- semanticSettings: index.semanticSettings,
3089
- };
3313
+ const { encryptionKey, tokenFilters, analyzers, tokenizers, fields, similarity } = index;
3314
+ return Object.assign(Object.assign({}, index), { encryptionKey: convertEncryptionKeyToGenerated(encryptionKey), tokenFilters: convertTokenFiltersToGenerated(tokenFilters), analyzers: convertAnalyzersToGenerated(analyzers), tokenizers: convertTokenizersToGenerated(tokenizers), fields: convertFieldsToGenerated(fields), similarity: convertSimilarityToGenerated(similarity) });
3090
3315
  }
3091
3316
  function generatedSkillsetToPublicSkillset(generatedSkillset) {
3092
3317
  return {
@@ -3094,7 +3319,7 @@ function generatedSkillsetToPublicSkillset(generatedSkillset) {
3094
3319
  description: generatedSkillset.description,
3095
3320
  skills: convertSkillsToPublic(generatedSkillset.skills),
3096
3321
  cognitiveServicesAccount: convertCognitiveServicesAccountToPublic(generatedSkillset.cognitiveServicesAccount),
3097
- knowledgeStore: generatedSkillset.knowledgeStore,
3322
+ knowledgeStore: convertKnowledgeStoreToPublic(generatedSkillset.knowledgeStore),
3098
3323
  etag: generatedSkillset.etag,
3099
3324
  encryptionKey: convertEncryptionKeyToPublic(generatedSkillset.encryptionKey),
3100
3325
  };
@@ -3137,7 +3362,11 @@ function publicSearchIndexerToGeneratedSearchIndexer(indexer) {
3137
3362
  return Object.assign(Object.assign({}, indexer), { encryptionKey: convertEncryptionKeyToGenerated(indexer.encryptionKey) });
3138
3363
  }
3139
3364
  function generatedSearchIndexerToPublicSearchIndexer(indexer) {
3140
- return Object.assign(Object.assign({}, indexer), { encryptionKey: convertEncryptionKeyToPublic(indexer.encryptionKey) });
3365
+ return Object.assign(Object.assign({}, indexer), { encryptionKey: convertEncryptionKeyToPublic(indexer.encryptionKey), cache: convertSearchIndexerCacheToPublic(indexer.cache) });
3366
+ }
3367
+ function generatedSearchRequestToPublicSearchRequest(request) {
3368
+ const { semanticErrorHandling, debug, vector } = request, props = tslib.__rest(request, ["semanticErrorHandling", "debug", "vector"]);
3369
+ return Object.assign({ semanticErrorHandlingMode: semanticErrorHandling, debugMode: debug, vector: convertVectorToPublic(vector) }, props);
3141
3370
  }
3142
3371
  function publicDataSourceToGeneratedDataSource(dataSource) {
3143
3372
  return {
@@ -3198,6 +3427,14 @@ function convertDataDeletionDetectionPolicyToPublic(dataDeletionDetectionPolicy)
3198
3427
  }
3199
3428
  return dataDeletionDetectionPolicy;
3200
3429
  }
3430
+ function convertVectorToPublic(vector) {
3431
+ var _a;
3432
+ if (!vector) {
3433
+ return vector;
3434
+ }
3435
+ const fields = (_a = vector.fields) === null || _a === void 0 ? void 0 : _a.split(",");
3436
+ return Object.assign(Object.assign({}, vector), { fields });
3437
+ }
3201
3438
  function getRandomIntegerInclusive(min, max) {
3202
3439
  // Make sure inputs are integers.
3203
3440
  min = Math.ceil(min);
@@ -3216,7 +3453,19 @@ function getRandomIntegerInclusive(min, max) {
3216
3453
  function delay(timeInMs) {
3217
3454
  return new Promise((resolve) => setTimeout(() => resolve(), timeInMs));
3218
3455
  }
3219
- const defaultServiceVersion = "2021-04-30-Preview";
3456
+ const defaultServiceVersion = "2023-07-01-Preview";
3457
+ function convertKnowledgeStoreToPublic(knowledgeStore) {
3458
+ if (!knowledgeStore) {
3459
+ return knowledgeStore;
3460
+ }
3461
+ return Object.assign(Object.assign({}, knowledgeStore), { identity: convertSearchIndexerDataIdentityToPublic(knowledgeStore.identity) });
3462
+ }
3463
+ function convertSearchIndexerCacheToPublic(cache) {
3464
+ if (!cache) {
3465
+ return cache;
3466
+ }
3467
+ return Object.assign(Object.assign({}, cache), { identity: convertSearchIndexerDataIdentityToPublic(cache.identity) });
3468
+ }
3220
3469
 
3221
3470
  // Copyright (c) Microsoft Corporation.
3222
3471
  // Licensed under the MIT license.
@@ -3298,16 +3547,6 @@ class SearchClient {
3298
3547
  this.apiVersion = defaultServiceVersion;
3299
3548
  this.endpoint = endpoint;
3300
3549
  this.indexName = indexName;
3301
- const libInfo = `azsdk-js-search-documents/${SDK_VERSION}`;
3302
- if (!options.userAgentOptions) {
3303
- options.userAgentOptions = {};
3304
- }
3305
- if (options.userAgentOptions.userAgentPrefix) {
3306
- options.userAgentOptions.userAgentPrefix = `${options.userAgentOptions.userAgentPrefix} ${libInfo}`;
3307
- }
3308
- else {
3309
- options.userAgentOptions.userAgentPrefix = libInfo;
3310
- }
3311
3550
  const internalClientPipelineOptions = Object.assign(Object.assign({}, options), {
3312
3551
  loggingOptions: {
3313
3552
  logger: logger.info,
@@ -3374,7 +3613,7 @@ class SearchClient {
3374
3613
  * import {
3375
3614
  * AzureKeyCredential,
3376
3615
  * SearchClient,
3377
- * SelectFields,
3616
+ * SearchFieldArray,
3378
3617
  * } from "@azure/search-documents";
3379
3618
  *
3380
3619
  * type TModel = {
@@ -3388,7 +3627,7 @@ class SearchClient {
3388
3627
  * new AzureKeyCredential("key")
3389
3628
  * );
3390
3629
  *
3391
- * const searchFields: SelectFields<TModel>[] = ["azure/sdk"];
3630
+ * const searchFields: SearchFieldArray<TModel> = ["azure/sdk"];
3392
3631
  *
3393
3632
  * const autocompleteResult = await client.autocomplete(
3394
3633
  * "searchText",
@@ -3398,8 +3637,7 @@ class SearchClient {
3398
3637
  * ```
3399
3638
  */
3400
3639
  async autocomplete(searchText, suggesterName, options = {}) {
3401
- const { operationOptions, restOptions } = this.extractOperationOptions(Object.assign({}, options));
3402
- const { searchFields } = restOptions, nonFieldOptions = tslib.__rest(restOptions, ["searchFields"]);
3640
+ const { searchFields } = options, nonFieldOptions = tslib.__rest(options, ["searchFields"]);
3403
3641
  const fullOptions = Object.assign({ searchText: searchText, suggesterName: suggesterName, searchFields: this.convertSearchFields(searchFields) }, nonFieldOptions);
3404
3642
  if (!fullOptions.searchText) {
3405
3643
  throw new RangeError("searchText must be provided.");
@@ -3407,7 +3645,7 @@ class SearchClient {
3407
3645
  if (!fullOptions.suggesterName) {
3408
3646
  throw new RangeError("suggesterName must be provided.");
3409
3647
  }
3410
- const { span, updatedOptions } = createSpan("SearchClient-autocomplete", operationOptions);
3648
+ const { span, updatedOptions } = createSpan("SearchClient-autocomplete", options);
3411
3649
  try {
3412
3650
  const result = await this.client.documents.autocompletePost(fullOptions, updatedOptions);
3413
3651
  return result;
@@ -3424,22 +3662,16 @@ class SearchClient {
3424
3662
  }
3425
3663
  }
3426
3664
  async searchDocuments(searchText, options = {}, nextPageParameters = {}) {
3427
- const { operationOptions, restOptions } = this.extractOperationOptions(Object.assign({}, options));
3428
- const { select, searchFields, orderBy, semanticFields } = restOptions, nonFieldOptions = tslib.__rest(restOptions, ["select", "searchFields", "orderBy", "semanticFields"]);
3429
- const fullOptions = Object.assign(Object.assign({ searchFields: this.convertSearchFields(searchFields), semanticFields: this.convertSemanticFields(semanticFields), select: this.convertSelect(select) || "*", orderBy: this.convertOrderBy(orderBy) }, nonFieldOptions), nextPageParameters);
3430
- const { span, updatedOptions } = createSpan("SearchClient-searchDocuments", operationOptions);
3665
+ const { searchFields, semanticFields, select, orderBy, includeTotalCount, vector, answers, semanticErrorHandlingMode, debugMode } = options, restOptions = tslib.__rest(options, ["searchFields", "semanticFields", "select", "orderBy", "includeTotalCount", "vector", "answers", "semanticErrorHandlingMode", "debugMode"]);
3666
+ const fullOptions = Object.assign(Object.assign(Object.assign({}, restOptions), nextPageParameters), { searchFields: this.convertSearchFields(searchFields), semanticFields: this.convertSemanticFields(semanticFields), select: this.convertSelect(select) || "*", orderBy: this.convertOrderBy(orderBy), includeTotalResultCount: includeTotalCount, vector: this.convertVector(vector), answers: this.convertAnswers(answers), semanticErrorHandling: semanticErrorHandlingMode, debug: debugMode });
3667
+ const { span, updatedOptions } = createSpan("SearchClient-searchDocuments", options);
3431
3668
  try {
3432
- const result = await this.client.documents.searchPost(Object.assign(Object.assign({}, fullOptions), { includeTotalResultCount: fullOptions.includeTotalCount, searchText: searchText }), updatedOptions);
3433
- const { results, count, coverage, facets, answers, nextLink } = result;
3669
+ const result = await this.client.documents.searchPost(Object.assign(Object.assign({}, fullOptions), { searchText: searchText }), updatedOptions);
3670
+ const { results, nextLink, nextPageParameters: resultNextPageParameters, semanticPartialResponseReason, semanticPartialResponseType } = result, restResult = tslib.__rest(result, ["results", "nextLink", "nextPageParameters", "semanticPartialResponseReason", "semanticPartialResponseType"]);
3434
3671
  const modifiedResults = generatedSearchResultToPublicSearchResult(results);
3435
- const converted = {
3436
- results: modifiedResults,
3437
- count,
3438
- coverage,
3439
- facets,
3440
- answers,
3441
- continuationToken: this.encodeContinuationToken(nextLink, result.nextPageParameters),
3442
- };
3672
+ const converted = Object.assign(Object.assign({}, restResult), { results: modifiedResults, semanticPartialResponseReason: semanticPartialResponseReason, semanticPartialResponseType: semanticPartialResponseType, continuationToken: this.encodeContinuationToken(nextLink, resultNextPageParameters
3673
+ ? generatedSearchRequestToPublicSearchRequest(resultNextPageParameters)
3674
+ : resultNextPageParameters) });
3443
3675
  return deserialize(converted);
3444
3676
  }
3445
3677
  catch (e) {
@@ -3521,7 +3753,7 @@ class SearchClient {
3521
3753
  * import {
3522
3754
  * AzureKeyCredential,
3523
3755
  * SearchClient,
3524
- * SelectFields,
3756
+ * SearchFieldArray,
3525
3757
  * } from "@azure/search-documents";
3526
3758
  *
3527
3759
  * type TModel = {
@@ -3536,7 +3768,7 @@ class SearchClient {
3536
3768
  * );
3537
3769
  *
3538
3770
  * const select = ["azure/sdk"] as const;
3539
- * const searchFields: SelectFields<TModel>[] = ["azure/sdk"];
3771
+ * const searchFields: SearchFieldArray<TModel> = ["azure/sdk"];
3540
3772
  *
3541
3773
  * const searchResult = await client.search("searchText", {
3542
3774
  * select,
@@ -3548,14 +3780,7 @@ class SearchClient {
3548
3780
  const { span, updatedOptions } = createSpan("SearchClient-search", options);
3549
3781
  try {
3550
3782
  const pageResult = await this.searchDocuments(searchText, updatedOptions);
3551
- const { count, coverage, facets, answers } = pageResult;
3552
- return {
3553
- count,
3554
- coverage,
3555
- facets,
3556
- answers,
3557
- results: this.listSearchResults(pageResult, searchText, updatedOptions),
3558
- };
3783
+ return Object.assign(Object.assign({}, pageResult), { results: this.listSearchResults(pageResult, searchText, updatedOptions) });
3559
3784
  }
3560
3785
  catch (e) {
3561
3786
  span.setStatus({
@@ -3579,7 +3804,7 @@ class SearchClient {
3579
3804
  * import {
3580
3805
  * AzureKeyCredential,
3581
3806
  * SearchClient,
3582
- * SelectFields,
3807
+ * SearchFieldArray,
3583
3808
  * } from "@azure/search-documents";
3584
3809
  *
3585
3810
  * type TModel = {
@@ -3594,7 +3819,7 @@ class SearchClient {
3594
3819
  * );
3595
3820
  *
3596
3821
  * const select = ["azure/sdk"] as const;
3597
- * const searchFields: SelectFields<TModel>[] = ["azure/sdk"];
3822
+ * const searchFields: SearchFieldArray<TModel> = ["azure/sdk"];
3598
3823
  *
3599
3824
  * const suggestResult = await client.suggest("searchText", "suggesterName", {
3600
3825
  * select,
@@ -3603,8 +3828,7 @@ class SearchClient {
3603
3828
  * ```
3604
3829
  */
3605
3830
  async suggest(searchText, suggesterName, options = {}) {
3606
- const { operationOptions, restOptions } = this.extractOperationOptions(Object.assign({}, options));
3607
- const { select, searchFields, orderBy } = restOptions, nonFieldOptions = tslib.__rest(restOptions, ["select", "searchFields", "orderBy"]);
3831
+ const { select, searchFields, orderBy } = options, nonFieldOptions = tslib.__rest(options, ["select", "searchFields", "orderBy"]);
3608
3832
  const fullOptions = Object.assign({ searchText: searchText, suggesterName: suggesterName, searchFields: this.convertSearchFields(searchFields), select: this.convertSelect(select), orderBy: this.convertOrderBy(orderBy) }, nonFieldOptions);
3609
3833
  if (!fullOptions.searchText) {
3610
3834
  throw new RangeError("searchText must be provided.");
@@ -3612,7 +3836,7 @@ class SearchClient {
3612
3836
  if (!fullOptions.suggesterName) {
3613
3837
  throw new RangeError("suggesterName must be provided.");
3614
3838
  }
3615
- const { span, updatedOptions } = createSpan("SearchClient-suggest", operationOptions);
3839
+ const { span, updatedOptions } = createSpan("SearchClient-suggest", options);
3616
3840
  try {
3617
3841
  const result = await this.client.documents.suggestPost(fullOptions, updatedOptions);
3618
3842
  const modifiedResult = generatedSuggestDocumentsResultToPublicSuggestDocumentsResult(result);
@@ -3813,24 +4037,18 @@ class SearchClient {
3813
4037
  throw new Error(`Corrupted or invalid continuation token: ${decodedToken}`);
3814
4038
  }
3815
4039
  }
3816
- // eslint-disable-next-line @typescript-eslint/no-shadow
3817
- extractOperationOptions(obj) {
3818
- const { abortSignal, requestOptions, tracingOptions } = obj, restOptions = tslib.__rest(obj, ["abortSignal", "requestOptions", "tracingOptions"]);
3819
- return {
3820
- operationOptions: {
3821
- abortSignal,
3822
- requestOptions,
3823
- tracingOptions,
3824
- },
3825
- restOptions,
3826
- };
3827
- }
3828
4040
  convertSelect(select) {
3829
4041
  if (select) {
3830
4042
  return select.join(",");
3831
4043
  }
3832
4044
  return select;
3833
4045
  }
4046
+ convertVectorFields(fields) {
4047
+ if (fields) {
4048
+ return fields.join(",");
4049
+ }
4050
+ return fields;
4051
+ }
3834
4052
  convertSearchFields(searchFields) {
3835
4053
  if (searchFields) {
3836
4054
  return searchFields.join(",");
@@ -3849,6 +4067,32 @@ class SearchClient {
3849
4067
  }
3850
4068
  return orderBy;
3851
4069
  }
4070
+ convertAnswers(answers) {
4071
+ if (!answers || typeof answers === "string") {
4072
+ return answers;
4073
+ }
4074
+ if (answers.answers === "none") {
4075
+ return answers.answers;
4076
+ }
4077
+ const config = [];
4078
+ const { answers: output, count, threshold } = answers;
4079
+ if (count) {
4080
+ config.push(`count-${count}`);
4081
+ }
4082
+ if (threshold) {
4083
+ config.push(`threshold-${threshold}`);
4084
+ }
4085
+ if (config.length) {
4086
+ return output + `|${config.join(",")}`;
4087
+ }
4088
+ return output;
4089
+ }
4090
+ convertVector(vector) {
4091
+ if (!vector) {
4092
+ return vector;
4093
+ }
4094
+ return Object.assign(Object.assign({}, vector), { fields: this.convertVectorFields(vector === null || vector === void 0 ? void 0 : vector.fields) });
4095
+ }
3852
4096
  }
3853
4097
 
3854
4098
  // Copyright (c) Microsoft Corporation.
@@ -4787,9 +5031,7 @@ const FieldMappingFunction = {
4787
5031
  nullable: true,
4788
5032
  type: {
4789
5033
  name: "Dictionary",
4790
- value: {
4791
- type: { name: "Dictionary", value: { type: { name: "any" } } }
4792
- }
5034
+ value: { type: { name: "any" } }
4793
5035
  }
4794
5036
  }
4795
5037
  }
@@ -4812,6 +5054,13 @@ const SearchIndexerCache = {
4812
5054
  type: {
4813
5055
  name: "Boolean"
4814
5056
  }
5057
+ },
5058
+ identity: {
5059
+ serializedName: "identity",
5060
+ type: {
5061
+ name: "Composite",
5062
+ className: "SearchIndexerDataIdentity"
5063
+ }
4815
5064
  }
4816
5065
  }
4817
5066
  }
@@ -5421,6 +5670,13 @@ const SearchIndexerKnowledgeStore = {
5421
5670
  }
5422
5671
  }
5423
5672
  }
5673
+ },
5674
+ identity: {
5675
+ serializedName: "identity",
5676
+ type: {
5677
+ name: "Composite",
5678
+ className: "SearchIndexerDataIdentity"
5679
+ }
5424
5680
  }
5425
5681
  }
5426
5682
  }
@@ -5762,6 +6018,13 @@ const SearchIndex = {
5762
6018
  className: "SemanticSettings"
5763
6019
  }
5764
6020
  },
6021
+ vectorSearch: {
6022
+ serializedName: "vectorSearch",
6023
+ type: {
6024
+ name: "Composite",
6025
+ className: "VectorSearch"
6026
+ }
6027
+ },
5765
6028
  etag: {
5766
6029
  serializedName: "@odata\\.etag",
5767
6030
  type: {
@@ -5854,6 +6117,24 @@ const SearchField = {
5854
6117
  name: "String"
5855
6118
  }
5856
6119
  },
6120
+ vectorSearchDimensions: {
6121
+ constraints: {
6122
+ InclusiveMaximum: 2048,
6123
+ InclusiveMinimum: 2
6124
+ },
6125
+ serializedName: "dimensions",
6126
+ nullable: true,
6127
+ type: {
6128
+ name: "Number"
6129
+ }
6130
+ },
6131
+ vectorSearchConfiguration: {
6132
+ serializedName: "vectorSearchConfiguration",
6133
+ nullable: true,
6134
+ type: {
6135
+ name: "String"
6136
+ }
6137
+ },
5857
6138
  synonymMaps: {
5858
6139
  serializedName: "synonymMaps",
5859
6140
  type: {
@@ -6206,6 +6487,12 @@ const SemanticSettings = {
6206
6487
  name: "Composite",
6207
6488
  className: "SemanticSettings",
6208
6489
  modelProperties: {
6490
+ defaultConfiguration: {
6491
+ serializedName: "defaultConfiguration",
6492
+ type: {
6493
+ name: "String"
6494
+ }
6495
+ },
6209
6496
  configurations: {
6210
6497
  serializedName: "configurations",
6211
6498
  type: {
@@ -6296,6 +6583,53 @@ const SemanticField = {
6296
6583
  }
6297
6584
  }
6298
6585
  };
6586
+ const VectorSearch = {
6587
+ type: {
6588
+ name: "Composite",
6589
+ className: "VectorSearch",
6590
+ modelProperties: {
6591
+ algorithmConfigurations: {
6592
+ serializedName: "algorithmConfigurations",
6593
+ type: {
6594
+ name: "Sequence",
6595
+ element: {
6596
+ type: {
6597
+ name: "Composite",
6598
+ className: "VectorSearchAlgorithmConfiguration"
6599
+ }
6600
+ }
6601
+ }
6602
+ }
6603
+ }
6604
+ }
6605
+ };
6606
+ const VectorSearchAlgorithmConfiguration = {
6607
+ type: {
6608
+ name: "Composite",
6609
+ className: "VectorSearchAlgorithmConfiguration",
6610
+ uberParent: "VectorSearchAlgorithmConfiguration",
6611
+ polymorphicDiscriminator: {
6612
+ serializedName: "kind",
6613
+ clientName: "kind"
6614
+ },
6615
+ modelProperties: {
6616
+ name: {
6617
+ serializedName: "name",
6618
+ required: true,
6619
+ type: {
6620
+ name: "String"
6621
+ }
6622
+ },
6623
+ kind: {
6624
+ serializedName: "kind",
6625
+ required: true,
6626
+ type: {
6627
+ name: "String"
6628
+ }
6629
+ }
6630
+ }
6631
+ }
6632
+ };
6299
6633
  const ListIndexesResult = {
6300
6634
  type: {
6301
6635
  name: "Composite",
@@ -6338,6 +6672,13 @@ const GetIndexStatisticsResult = {
6338
6672
  type: {
6339
6673
  name: "Number"
6340
6674
  }
6675
+ },
6676
+ vectorIndexSize: {
6677
+ serializedName: "vectorIndexSize",
6678
+ readOnly: true,
6679
+ type: {
6680
+ name: "Number"
6681
+ }
6341
6682
  }
6342
6683
  }
6343
6684
  }
@@ -6595,6 +6936,13 @@ const ServiceCounters = {
6595
6936
  name: "Composite",
6596
6937
  className: "ResourceCounter"
6597
6938
  }
6939
+ },
6940
+ vectorIndexSizeCounter: {
6941
+ serializedName: "vectorIndexSize",
6942
+ type: {
6943
+ name: "Composite",
6944
+ className: "ResourceCounter"
6945
+ }
6598
6946
  }
6599
6947
  }
6600
6948
  }
@@ -6657,6 +7005,57 @@ const ServiceLimits = {
6657
7005
  }
6658
7006
  }
6659
7007
  };
7008
+ const HnswParameters = {
7009
+ type: {
7010
+ name: "Composite",
7011
+ className: "HnswParameters",
7012
+ modelProperties: {
7013
+ m: {
7014
+ defaultValue: 4,
7015
+ constraints: {
7016
+ InclusiveMaximum: 10,
7017
+ InclusiveMinimum: 4
7018
+ },
7019
+ serializedName: "m",
7020
+ nullable: true,
7021
+ type: {
7022
+ name: "Number"
7023
+ }
7024
+ },
7025
+ efConstruction: {
7026
+ defaultValue: 400,
7027
+ constraints: {
7028
+ InclusiveMaximum: 1000,
7029
+ InclusiveMinimum: 100
7030
+ },
7031
+ serializedName: "efConstruction",
7032
+ nullable: true,
7033
+ type: {
7034
+ name: "Number"
7035
+ }
7036
+ },
7037
+ efSearch: {
7038
+ defaultValue: 500,
7039
+ constraints: {
7040
+ InclusiveMaximum: 1000,
7041
+ InclusiveMinimum: 100
7042
+ },
7043
+ serializedName: "efSearch",
7044
+ nullable: true,
7045
+ type: {
7046
+ name: "Number"
7047
+ }
7048
+ },
7049
+ metric: {
7050
+ serializedName: "metric",
7051
+ nullable: true,
7052
+ type: {
7053
+ name: "String"
7054
+ }
7055
+ }
7056
+ }
7057
+ }
7058
+ };
6660
7059
  const DistanceScoringParameters = {
6661
7060
  type: {
6662
7061
  name: "Composite",
@@ -7440,9 +7839,7 @@ const DocumentExtractionSkill = {
7440
7839
  nullable: true,
7441
7840
  type: {
7442
7841
  name: "Dictionary",
7443
- value: {
7444
- type: { name: "Dictionary", value: { type: { name: "any" } } }
7445
- }
7842
+ value: { type: { name: "any" } }
7446
7843
  }
7447
7844
  } })
7448
7845
  }
@@ -7488,6 +7885,18 @@ const WebApiSkill = {
7488
7885
  type: {
7489
7886
  name: "Number"
7490
7887
  }
7888
+ }, authResourceId: {
7889
+ serializedName: "authResourceId",
7890
+ nullable: true,
7891
+ type: {
7892
+ name: "String"
7893
+ }
7894
+ }, authIdentity: {
7895
+ serializedName: "authIdentity",
7896
+ type: {
7897
+ name: "Composite",
7898
+ className: "SearchIndexerDataIdentity"
7899
+ }
7491
7900
  } })
7492
7901
  }
7493
7902
  };
@@ -9145,6 +9554,22 @@ const BM25Similarity = {
9145
9554
  } })
9146
9555
  }
9147
9556
  };
9557
+ const HnswVectorSearchAlgorithmConfiguration = {
9558
+ serializedName: "hnsw",
9559
+ type: {
9560
+ name: "Composite",
9561
+ className: "HnswVectorSearchAlgorithmConfiguration",
9562
+ uberParent: "VectorSearchAlgorithmConfiguration",
9563
+ polymorphicDiscriminator: VectorSearchAlgorithmConfiguration.type.polymorphicDiscriminator,
9564
+ modelProperties: Object.assign(Object.assign({}, VectorSearchAlgorithmConfiguration.type.modelProperties), { parameters: {
9565
+ serializedName: "hnswParameters",
9566
+ type: {
9567
+ name: "Composite",
9568
+ className: "HnswParameters"
9569
+ }
9570
+ } })
9571
+ }
9572
+ };
9148
9573
  const SearchIndexerKnowledgeStoreObjectProjectionSelector = {
9149
9574
  type: {
9150
9575
  name: "Composite",
@@ -9172,6 +9597,7 @@ let discriminators = {
9172
9597
  CharFilter: CharFilter,
9173
9598
  LexicalNormalizer: LexicalNormalizer,
9174
9599
  Similarity: Similarity,
9600
+ VectorSearchAlgorithmConfiguration: VectorSearchAlgorithmConfiguration,
9175
9601
  "SearchIndexerDataIdentity.#Microsoft.Azure.Search.DataNoneIdentity": SearchIndexerDataNoneIdentity,
9176
9602
  "SearchIndexerDataIdentity.#Microsoft.Azure.Search.DataUserAssignedIdentity": SearchIndexerDataUserAssignedIdentity,
9177
9603
  "DataChangeDetectionPolicy.#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy": HighWaterMarkChangeDetectionPolicy,
@@ -9247,7 +9673,8 @@ let discriminators = {
9247
9673
  "CharFilter.#Microsoft.Azure.Search.PatternReplaceCharFilter": PatternReplaceCharFilter,
9248
9674
  "LexicalNormalizer.#Microsoft.Azure.Search.CustomNormalizer": CustomNormalizer,
9249
9675
  "Similarity.#Microsoft.Azure.Search.ClassicSimilarity": ClassicSimilarity,
9250
- "Similarity.#Microsoft.Azure.Search.BM25Similarity": BM25Similarity
9676
+ "Similarity.#Microsoft.Azure.Search.BM25Similarity": BM25Similarity,
9677
+ "VectorSearchAlgorithmConfiguration.hnsw": HnswVectorSearchAlgorithmConfiguration
9251
9678
  };
9252
9679
 
9253
9680
  var Mappers = /*#__PURE__*/Object.freeze({
@@ -9306,6 +9733,8 @@ var Mappers = /*#__PURE__*/Object.freeze({
9306
9733
  SemanticConfiguration: SemanticConfiguration,
9307
9734
  PrioritizedFields: PrioritizedFields,
9308
9735
  SemanticField: SemanticField,
9736
+ VectorSearch: VectorSearch,
9737
+ VectorSearchAlgorithmConfiguration: VectorSearchAlgorithmConfiguration,
9309
9738
  ListIndexesResult: ListIndexesResult,
9310
9739
  GetIndexStatisticsResult: GetIndexStatisticsResult,
9311
9740
  AnalyzeRequest: AnalyzeRequest,
@@ -9317,6 +9746,7 @@ var Mappers = /*#__PURE__*/Object.freeze({
9317
9746
  ServiceCounters: ServiceCounters,
9318
9747
  ResourceCounter: ResourceCounter,
9319
9748
  ServiceLimits: ServiceLimits,
9749
+ HnswParameters: HnswParameters,
9320
9750
  DistanceScoringParameters: DistanceScoringParameters,
9321
9751
  FreshnessScoringParameters: FreshnessScoringParameters,
9322
9752
  MagnitudeScoringParameters: MagnitudeScoringParameters,
@@ -9401,6 +9831,7 @@ var Mappers = /*#__PURE__*/Object.freeze({
9401
9831
  CustomNormalizer: CustomNormalizer,
9402
9832
  ClassicSimilarity: ClassicSimilarity,
9403
9833
  BM25Similarity: BM25Similarity,
9834
+ HnswVectorSearchAlgorithmConfiguration: HnswVectorSearchAlgorithmConfiguration,
9404
9835
  SearchIndexerKnowledgeStoreObjectProjectionSelector: SearchIndexerKnowledgeStoreObjectProjectionSelector,
9405
9836
  SearchIndexerKnowledgeStoreFileProjectionSelector: SearchIndexerKnowledgeStoreFileProjectionSelector,
9406
9837
  discriminators: discriminators
@@ -10776,7 +11207,7 @@ class SearchServiceClient extends coreHttpCompat__namespace.ExtendedServiceClien
10776
11207
  const defaults = {
10777
11208
  requestContentType: "application/json; charset=utf-8"
10778
11209
  };
10779
- const packageDetails = `azsdk-js-search-documents/12.0.0-beta.1`;
11210
+ const packageDetails = `azsdk-js-search-documents/12.0.0-beta.2`;
10780
11211
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
10781
11212
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
10782
11213
  : `${packageDetails}`;
@@ -10858,17 +11289,7 @@ class SearchIndexClient {
10858
11289
  this.endpoint = endpoint;
10859
11290
  this.credential = credential;
10860
11291
  this.options = options;
10861
- const libInfo = `azsdk-js-search-documents/${SDK_VERSION}`;
10862
- if (!options.userAgentOptions) {
10863
- options.userAgentOptions = {};
10864
- }
10865
- if (options.userAgentOptions.userAgentPrefix) {
10866
- options.userAgentOptions.userAgentPrefix = `${options.userAgentOptions.userAgentPrefix} ${libInfo}`;
10867
- }
10868
- else {
10869
- options.userAgentOptions.userAgentPrefix = libInfo;
10870
- }
10871
- const internalClientPipelineOptions = Object.assign(Object.assign({}, options), {
11292
+ const internalClientPipelineOptions = Object.assign(Object.assign({}, this.options), {
10872
11293
  loggingOptions: {
10873
11294
  logger: logger.info,
10874
11295
  additionalAllowedHeaderNames: [
@@ -10882,12 +11303,12 @@ class SearchIndexClient {
10882
11303
  },
10883
11304
  });
10884
11305
  this.serviceVersion =
10885
- (_b = (_a = options.serviceVersion) !== null && _a !== void 0 ? _a : options.apiVersion) !== null && _b !== void 0 ? _b : defaultServiceVersion;
11306
+ (_b = (_a = this.options.serviceVersion) !== null && _a !== void 0 ? _a : this.options.apiVersion) !== null && _b !== void 0 ? _b : defaultServiceVersion;
10886
11307
  this.apiVersion = this.serviceVersion;
10887
11308
  this.client = new SearchServiceClient(this.endpoint, this.serviceVersion, internalClientPipelineOptions);
10888
11309
  if (coreAuth.isTokenCredential(credential)) {
10889
- const scope = options.audience
10890
- ? `${options.audience}/.default`
11310
+ const scope = this.options.audience
11311
+ ? `${this.options.audience}/.default`
10891
11312
  : `${exports.KnownSearchAudience.AzurePublicCloud}/.default`;
10892
11313
  this.client.pipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({ credential, scopes: scope }));
10893
11314
  }
@@ -11478,7 +11899,7 @@ class SearchIndexClient {
11478
11899
  * Retrieves the SearchClient corresponding to this SearchIndexClient
11479
11900
  * @param indexName - Name of the index
11480
11901
  * @param options - SearchClient Options
11481
- * @typeParam Model - An optional type that represents the documents stored in
11902
+ * @typeParam TModel - An optional type that represents the documents stored in
11482
11903
  * the search index. For the best typing experience, all non-key fields should
11483
11904
  * be marked optional and nullable, and the key property should have the
11484
11905
  * non-nullable type `string`.
@@ -11523,16 +11944,6 @@ class SearchIndexerClient {
11523
11944
  */
11524
11945
  this.apiVersion = defaultServiceVersion;
11525
11946
  this.endpoint = endpoint;
11526
- const libInfo = `azsdk-js-search-documents/${SDK_VERSION}`;
11527
- if (!options.userAgentOptions) {
11528
- options.userAgentOptions = {};
11529
- }
11530
- if (options.userAgentOptions.userAgentPrefix) {
11531
- options.userAgentOptions.userAgentPrefix = `${options.userAgentOptions.userAgentPrefix} ${libInfo}`;
11532
- }
11533
- else {
11534
- options.userAgentOptions.userAgentPrefix = libInfo;
11535
- }
11536
11947
  const internalClientPipelineOptions = Object.assign(Object.assign({}, options), {
11537
11948
  loggingOptions: {
11538
11949
  logger: logger.info,
@@ -12135,12 +12546,28 @@ function odata(strings, ...values) {
12135
12546
  * Code generated by Microsoft (R) AutoRest Code Generator.
12136
12547
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
12137
12548
  */
12138
- /** Known values of {@link ApiVersion20210430Preview} that the service accepts. */
12139
- var KnownApiVersion20210430Preview$1;
12140
- (function (KnownApiVersion20210430Preview) {
12141
- /** Api Version '2021-04-30-Preview' */
12142
- KnownApiVersion20210430Preview["TwoThousandTwentyOne0430Preview"] = "2021-04-30-Preview";
12143
- })(KnownApiVersion20210430Preview$1 || (KnownApiVersion20210430Preview$1 = {}));
12549
+ /** Known values of {@link ApiVersion20230701Preview} that the service accepts. */
12550
+ var KnownApiVersion20230701Preview$1;
12551
+ (function (KnownApiVersion20230701Preview) {
12552
+ /** Api Version '2023-07-01-Preview' */
12553
+ KnownApiVersion20230701Preview["TwoThousandTwentyThree0701Preview"] = "2023-07-01-Preview";
12554
+ })(KnownApiVersion20230701Preview$1 || (KnownApiVersion20230701Preview$1 = {}));
12555
+ /** Known values of {@link SemanticErrorHandling} that the service accepts. */
12556
+ var KnownSemanticErrorHandling;
12557
+ (function (KnownSemanticErrorHandling) {
12558
+ /** If the semantic processing fails, partial results still return. The definition of partial results depends on what semantic step failed and what was the reason for failure. */
12559
+ KnownSemanticErrorHandling["Partial"] = "partial";
12560
+ /** If there is an exception during the semantic processing step, the query will fail and return the appropriate HTTP code depending on the error. */
12561
+ KnownSemanticErrorHandling["Fail"] = "fail";
12562
+ })(KnownSemanticErrorHandling || (KnownSemanticErrorHandling = {}));
12563
+ /** Known values of {@link QueryDebugMode} that the service accepts. */
12564
+ var KnownQueryDebugMode;
12565
+ (function (KnownQueryDebugMode) {
12566
+ /** No query debugging information will be returned. */
12567
+ KnownQueryDebugMode["Disabled"] = "disabled";
12568
+ /** Allows the user to further explore their Semantic search results. */
12569
+ KnownQueryDebugMode["Semantic"] = "semantic";
12570
+ })(KnownQueryDebugMode || (KnownQueryDebugMode = {}));
12144
12571
  /** Known values of {@link QueryLanguage} that the service accepts. */
12145
12572
  exports.KnownQueryLanguage = void 0;
12146
12573
  (function (KnownQueryLanguage) {
@@ -12337,6 +12764,34 @@ exports.KnownQueryCaptionType = void 0;
12337
12764
  /** Extracts captions from the matching documents that contain passages relevant to the search query. */
12338
12765
  KnownQueryCaptionType["Extractive"] = "extractive";
12339
12766
  })(exports.KnownQueryCaptionType || (exports.KnownQueryCaptionType = {}));
12767
+ /** Known values of {@link SemanticPartialResponseReason} that the service accepts. */
12768
+ var KnownSemanticPartialResponseReason;
12769
+ (function (KnownSemanticPartialResponseReason) {
12770
+ /** If 'semanticMaxWaitInMilliseconds' was set and the semantic processing duration exceeded that value. Only the base results were returned. */
12771
+ KnownSemanticPartialResponseReason["MaxWaitExceeded"] = "maxWaitExceeded";
12772
+ /** The request was throttled. Only the base results were returned. */
12773
+ KnownSemanticPartialResponseReason["CapacityOverloaded"] = "capacityOverloaded";
12774
+ /** At least one step of the semantic process failed. */
12775
+ KnownSemanticPartialResponseReason["Transient"] = "transient";
12776
+ })(KnownSemanticPartialResponseReason || (KnownSemanticPartialResponseReason = {}));
12777
+ /** Known values of {@link SemanticPartialResponseType} that the service accepts. */
12778
+ var KnownSemanticPartialResponseType;
12779
+ (function (KnownSemanticPartialResponseType) {
12780
+ /** Results without any semantic enrichment or reranking. */
12781
+ KnownSemanticPartialResponseType["BaseResults"] = "baseResults";
12782
+ /** Results have been reranked with the reranker model and will include semantic captions. They will not include any answers, answers highlights or caption highlights. */
12783
+ KnownSemanticPartialResponseType["RerankedResults"] = "rerankedResults";
12784
+ })(KnownSemanticPartialResponseType || (KnownSemanticPartialResponseType = {}));
12785
+ /** Known values of {@link SemanticFieldState} that the service accepts. */
12786
+ var KnownSemanticFieldState;
12787
+ (function (KnownSemanticFieldState) {
12788
+ /** The field was fully used for semantic enrichment. */
12789
+ KnownSemanticFieldState["Used"] = "used";
12790
+ /** The field was not used for semantic enrichment. */
12791
+ KnownSemanticFieldState["Unused"] = "unused";
12792
+ /** The field was partially used for semantic enrichment. */
12793
+ KnownSemanticFieldState["Partial"] = "partial";
12794
+ })(KnownSemanticFieldState || (KnownSemanticFieldState = {}));
12340
12795
 
12341
12796
  /*
12342
12797
  * Copyright (c) Microsoft Corporation.
@@ -12345,12 +12800,12 @@ exports.KnownQueryCaptionType = void 0;
12345
12800
  * Code generated by Microsoft (R) AutoRest Code Generator.
12346
12801
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
12347
12802
  */
12348
- /** Known values of {@link ApiVersion20210430Preview} that the service accepts. */
12349
- var KnownApiVersion20210430Preview;
12350
- (function (KnownApiVersion20210430Preview) {
12351
- /** Api Version '2021-04-30-Preview' */
12352
- KnownApiVersion20210430Preview["TwoThousandTwentyOne0430Preview"] = "2021-04-30-Preview";
12353
- })(KnownApiVersion20210430Preview || (KnownApiVersion20210430Preview = {}));
12803
+ /** Known values of {@link ApiVersion20230701Preview} that the service accepts. */
12804
+ var KnownApiVersion20230701Preview;
12805
+ (function (KnownApiVersion20230701Preview) {
12806
+ /** Api Version '2023-07-01-Preview' */
12807
+ KnownApiVersion20230701Preview["TwoThousandTwentyThree0701Preview"] = "2023-07-01-Preview";
12808
+ })(KnownApiVersion20230701Preview || (KnownApiVersion20230701Preview = {}));
12354
12809
  /** Known values of {@link SearchIndexerDataSourceType} that the service accepts. */
12355
12810
  exports.KnownSearchIndexerDataSourceType = void 0;
12356
12811
  (function (KnownSearchIndexerDataSourceType) {
@@ -12452,14 +12907,8 @@ var KnownSearchFieldDataType;
12452
12907
  KnownSearchFieldDataType["GeographyPoint"] = "Edm.GeographyPoint";
12453
12908
  /** Indicates that a field contains one or more complex objects that in turn have sub-fields of other types. */
12454
12909
  KnownSearchFieldDataType["Complex"] = "Edm.ComplexType";
12455
- KnownSearchFieldDataType["CollectionEdmString"] = "Collection(Edm.String)";
12456
- KnownSearchFieldDataType["CollectionEdmInt32"] = "Collection(Edm.Int32)";
12457
- KnownSearchFieldDataType["CollectionEdmInt64"] = "Collection(Edm.Int64)";
12458
- KnownSearchFieldDataType["CollectionEdmDouble"] = "Collection(Edm.Double)";
12459
- KnownSearchFieldDataType["CollectionEdmBoolean"] = "Collection(Edm.Boolean)";
12460
- KnownSearchFieldDataType["CollectionEdmDateTimeOffset"] = "Collection(Edm.DateTimeOffset)";
12461
- KnownSearchFieldDataType["CollectionEdmGeographyPoint"] = "Collection(Edm.GeographyPoint)";
12462
- KnownSearchFieldDataType["CollectionEdmComplexType"] = "Collection(Edm.ComplexType)";
12910
+ /** Indicates that a field contains a single-precision floating point number. This is only valid when used with Collection(Edm.Single). */
12911
+ KnownSearchFieldDataType["Single"] = "Edm.Single";
12463
12912
  })(KnownSearchFieldDataType || (KnownSearchFieldDataType = {}));
12464
12913
  /** Known values of {@link LexicalAnalyzerName} that the service accepts. */
12465
12914
  exports.KnownLexicalAnalyzerName = void 0;
@@ -12743,6 +13192,13 @@ exports.KnownCharFilterName = void 0;
12743
13192
  /** A character filter that attempts to strip out HTML constructs. See https://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/charfilter/HTMLStripCharFilter.html */
12744
13193
  KnownCharFilterName["HtmlStrip"] = "html_strip";
12745
13194
  })(exports.KnownCharFilterName || (exports.KnownCharFilterName = {}));
13195
+ /** Known values of {@link VectorSearchAlgorithmMetric} that the service accepts. */
13196
+ var KnownVectorSearchAlgorithmMetric;
13197
+ (function (KnownVectorSearchAlgorithmMetric) {
13198
+ KnownVectorSearchAlgorithmMetric["Cosine"] = "cosine";
13199
+ KnownVectorSearchAlgorithmMetric["Euclidean"] = "euclidean";
13200
+ KnownVectorSearchAlgorithmMetric["DotProduct"] = "dotProduct";
13201
+ })(KnownVectorSearchAlgorithmMetric || (KnownVectorSearchAlgorithmMetric = {}));
12746
13202
  /** Known values of {@link KeyPhraseExtractionSkillLanguage} that the service accepts. */
12747
13203
  exports.KnownKeyPhraseExtractionSkillLanguage = void 0;
12748
13204
  (function (KnownKeyPhraseExtractionSkillLanguage) {