@azure/search-documents 11.3.1 → 11.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -41
- package/dist/index.js +786 -1021
- package/dist/index.js.map +1 -1
- package/dist-esm/src/constants.js +1 -1
- package/dist-esm/src/constants.js.map +1 -1
- package/dist-esm/src/generated/data/index.js +1 -0
- package/dist-esm/src/generated/data/index.js.map +1 -1
- package/dist-esm/src/generated/data/models/index.js.map +1 -1
- package/dist-esm/src/generated/data/models/mappers.js.map +1 -1
- package/dist-esm/src/generated/data/models/parameters.js +11 -21
- package/dist-esm/src/generated/data/models/parameters.js.map +1 -1
- package/dist-esm/src/generated/data/operations/documents.js +21 -73
- package/dist-esm/src/generated/data/operations/documents.js.map +1 -1
- package/dist-esm/src/generated/data/operationsInterfaces/documents.js +9 -0
- package/dist-esm/src/generated/data/operationsInterfaces/documents.js.map +1 -0
- package/dist-esm/src/generated/data/operationsInterfaces/index.js +9 -0
- package/dist-esm/src/generated/data/operationsInterfaces/index.js.map +1 -0
- package/dist-esm/src/generated/data/searchClient.js +2 -2
- package/dist-esm/src/generated/data/searchClient.js.map +1 -1
- package/dist-esm/src/generated/data/searchClientContext.js +7 -11
- package/dist-esm/src/generated/data/searchClientContext.js.map +1 -1
- package/dist-esm/src/generated/service/index.js +1 -0
- package/dist-esm/src/generated/service/index.js.map +1 -1
- package/dist-esm/src/generated/service/models/index.js.map +1 -1
- package/dist-esm/src/generated/service/models/mappers.js.map +1 -1
- package/dist-esm/src/generated/service/models/parameters.js +0 -9
- package/dist-esm/src/generated/service/models/parameters.js.map +1 -1
- package/dist-esm/src/generated/service/operations/dataSources.js +11 -37
- package/dist-esm/src/generated/service/operations/dataSources.js.map +1 -1
- package/dist-esm/src/generated/service/operations/indexers.js +17 -55
- package/dist-esm/src/generated/service/operations/indexers.js.map +1 -1
- package/dist-esm/src/generated/service/operations/indexes.js +15 -54
- package/dist-esm/src/generated/service/operations/indexes.js.map +1 -1
- package/dist-esm/src/generated/service/operations/skillsets.js +11 -37
- package/dist-esm/src/generated/service/operations/skillsets.js.map +1 -1
- package/dist-esm/src/generated/service/operations/synonymMaps.js +11 -37
- package/dist-esm/src/generated/service/operations/synonymMaps.js.map +1 -1
- package/dist-esm/src/generated/service/operationsInterfaces/dataSources.js +9 -0
- package/dist-esm/src/generated/service/operationsInterfaces/dataSources.js.map +1 -0
- package/dist-esm/src/generated/service/operationsInterfaces/index.js +13 -0
- package/dist-esm/src/generated/service/operationsInterfaces/index.js.map +1 -0
- package/dist-esm/src/generated/service/operationsInterfaces/indexers.js +9 -0
- package/dist-esm/src/generated/service/operationsInterfaces/indexers.js.map +1 -0
- package/dist-esm/src/generated/service/operationsInterfaces/indexes.js +9 -0
- package/dist-esm/src/generated/service/operationsInterfaces/indexes.js.map +1 -0
- package/dist-esm/src/generated/service/operationsInterfaces/skillsets.js +9 -0
- package/dist-esm/src/generated/service/operationsInterfaces/skillsets.js.map +1 -0
- package/dist-esm/src/generated/service/operationsInterfaces/synonymMaps.js +9 -0
- package/dist-esm/src/generated/service/operationsInterfaces/synonymMaps.js.map +1 -0
- package/dist-esm/src/generated/service/searchServiceClient.js +10 -13
- package/dist-esm/src/generated/service/searchServiceClient.js.map +1 -1
- package/dist-esm/src/generated/service/searchServiceClientContext.js +7 -11
- package/dist-esm/src/generated/service/searchServiceClientContext.js.map +1 -1
- package/dist-esm/src/geographyPoint.js +1 -1
- package/dist-esm/src/geographyPoint.js.map +1 -1
- package/dist-esm/src/index.js +2 -2
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/indexDocumentsBatch.js +1 -1
- package/dist-esm/src/indexDocumentsBatch.js.map +1 -1
- package/dist-esm/src/indexModels.js.map +1 -1
- package/dist-esm/src/odataMetadataPolicy.js +7 -15
- package/dist-esm/src/odataMetadataPolicy.js.map +1 -1
- package/dist-esm/src/searchApiKeyCredentialPolicy.js +8 -21
- package/dist-esm/src/searchApiKeyCredentialPolicy.js.map +1 -1
- package/dist-esm/src/searchAudience.js.map +1 -1
- package/dist-esm/src/searchClient.js +108 -126
- package/dist-esm/src/searchClient.js.map +1 -1
- package/dist-esm/src/searchIndexClient.js +112 -101
- package/dist-esm/src/searchIndexClient.js.map +1 -1
- package/dist-esm/src/searchIndexerClient.js +94 -106
- package/dist-esm/src/searchIndexerClient.js.map +1 -1
- package/dist-esm/src/searchIndexingBufferedSender.js +16 -17
- package/dist-esm/src/searchIndexingBufferedSender.js.map +1 -1
- package/dist-esm/src/serialization.js +6 -6
- package/dist-esm/src/serialization.js.map +1 -1
- package/dist-esm/src/serviceModels.js.map +1 -1
- package/dist-esm/src/serviceUtils.js +43 -61
- package/dist-esm/src/serviceUtils.js.map +1 -1
- package/dist-esm/src/synonymMapHelper.js +6 -2
- package/dist-esm/src/synonymMapHelper.js.map +1 -1
- package/dist-esm/src/tracing.js +6 -5
- package/dist-esm/src/tracing.js.map +1 -1
- package/package.json +53 -53
- package/types/search-documents.d.ts +137 -117
- package/CHANGELOG.md +0 -233
- package/dist-esm/src/generated/data/models/documentsMappers.js +0 -9
- package/dist-esm/src/generated/data/models/documentsMappers.js.map +0 -1
- package/dist-esm/src/generated/service/models/dataSourcesMappers.js +0 -9
- package/dist-esm/src/generated/service/models/dataSourcesMappers.js.map +0 -1
- package/dist-esm/src/generated/service/models/indexersMappers.js +0 -9
- package/dist-esm/src/generated/service/models/indexersMappers.js.map +0 -1
- package/dist-esm/src/generated/service/models/indexesMappers.js +0 -9
- package/dist-esm/src/generated/service/models/indexesMappers.js.map +0 -1
- package/dist-esm/src/generated/service/models/skillsetsMappers.js +0 -9
- package/dist-esm/src/generated/service/models/skillsetsMappers.js.map +0 -1
- package/dist-esm/src/generated/service/models/synonymMapsMappers.js +0 -9
- package/dist-esm/src/generated/service/models/synonymMapsMappers.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -2,17 +2,40 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
|
6
|
-
|
|
7
5
|
var tslib = require('tslib');
|
|
8
|
-
var
|
|
6
|
+
var coreRestPipeline = require('@azure/core-rest-pipeline');
|
|
7
|
+
var coreClient = require('@azure/core-client');
|
|
9
8
|
var coreAuth = require('@azure/core-auth');
|
|
10
9
|
var logger$1 = require('@azure/logger');
|
|
11
10
|
var coreTracing = require('@azure/core-tracing');
|
|
12
|
-
var EventEmitter =
|
|
11
|
+
var EventEmitter = require('events');
|
|
13
12
|
var util = require('util');
|
|
14
13
|
var fs = require('fs');
|
|
15
14
|
|
|
15
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
|
+
|
|
17
|
+
function _interopNamespace(e) {
|
|
18
|
+
if (e && e.__esModule) return e;
|
|
19
|
+
var n = Object.create(null);
|
|
20
|
+
if (e) {
|
|
21
|
+
Object.keys(e).forEach(function (k) {
|
|
22
|
+
if (k !== 'default') {
|
|
23
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
24
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () { return e[k]; }
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
n["default"] = e;
|
|
32
|
+
return Object.freeze(n);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
|
|
36
|
+
var EventEmitter__default = /*#__PURE__*/_interopDefaultLegacy(EventEmitter);
|
|
37
|
+
var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
|
|
38
|
+
|
|
16
39
|
/*
|
|
17
40
|
* Copyright (c) Microsoft Corporation.
|
|
18
41
|
* Licensed under the MIT License.
|
|
@@ -20,7 +43,7 @@ var fs = require('fs');
|
|
|
20
43
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
21
44
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
22
45
|
*/
|
|
23
|
-
const SearchError = {
|
|
46
|
+
const SearchError$1 = {
|
|
24
47
|
type: {
|
|
25
48
|
name: "Composite",
|
|
26
49
|
className: "SearchError",
|
|
@@ -643,9 +666,9 @@ const AutocompleteRequest = {
|
|
|
643
666
|
}
|
|
644
667
|
};
|
|
645
668
|
|
|
646
|
-
var Mappers = /*#__PURE__*/Object.freeze({
|
|
669
|
+
var Mappers$1 = /*#__PURE__*/Object.freeze({
|
|
647
670
|
__proto__: null,
|
|
648
|
-
SearchError: SearchError,
|
|
671
|
+
SearchError: SearchError$1,
|
|
649
672
|
SearchDocumentsResult: SearchDocumentsResult,
|
|
650
673
|
FacetResult: FacetResult,
|
|
651
674
|
SearchRequest: SearchRequest,
|
|
@@ -669,7 +692,7 @@ var Mappers = /*#__PURE__*/Object.freeze({
|
|
|
669
692
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
670
693
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
671
694
|
*/
|
|
672
|
-
const accept = {
|
|
695
|
+
const accept$1 = {
|
|
673
696
|
parameterPath: "accept",
|
|
674
697
|
mapper: {
|
|
675
698
|
defaultValue: "application/json",
|
|
@@ -680,7 +703,7 @@ const accept = {
|
|
|
680
703
|
}
|
|
681
704
|
}
|
|
682
705
|
};
|
|
683
|
-
const endpoint = {
|
|
706
|
+
const endpoint$1 = {
|
|
684
707
|
parameterPath: "endpoint",
|
|
685
708
|
mapper: {
|
|
686
709
|
serializedName: "endpoint",
|
|
@@ -691,7 +714,7 @@ const endpoint = {
|
|
|
691
714
|
},
|
|
692
715
|
skipEncoding: true
|
|
693
716
|
};
|
|
694
|
-
const indexName = {
|
|
717
|
+
const indexName$1 = {
|
|
695
718
|
parameterPath: "indexName",
|
|
696
719
|
mapper: {
|
|
697
720
|
serializedName: "indexName",
|
|
@@ -701,16 +724,7 @@ const indexName = {
|
|
|
701
724
|
}
|
|
702
725
|
}
|
|
703
726
|
};
|
|
704
|
-
const
|
|
705
|
-
parameterPath: ["options", "requestOptionsParam", "xMsClientRequestId"],
|
|
706
|
-
mapper: {
|
|
707
|
-
serializedName: "x-ms-client-request-id",
|
|
708
|
-
type: {
|
|
709
|
-
name: "Uuid"
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
};
|
|
713
|
-
const apiVersion = {
|
|
727
|
+
const apiVersion$1 = {
|
|
714
728
|
parameterPath: "apiVersion",
|
|
715
729
|
mapper: {
|
|
716
730
|
serializedName: "api-version",
|
|
@@ -751,7 +765,7 @@ const facets = {
|
|
|
751
765
|
}
|
|
752
766
|
}
|
|
753
767
|
},
|
|
754
|
-
collectionFormat:
|
|
768
|
+
collectionFormat: "Multi"
|
|
755
769
|
};
|
|
756
770
|
const filter = {
|
|
757
771
|
parameterPath: ["options", "searchOptions", "filter"],
|
|
@@ -775,7 +789,7 @@ const highlightFields = {
|
|
|
775
789
|
}
|
|
776
790
|
}
|
|
777
791
|
},
|
|
778
|
-
collectionFormat:
|
|
792
|
+
collectionFormat: "CSV"
|
|
779
793
|
};
|
|
780
794
|
const highlightPostTag = {
|
|
781
795
|
parameterPath: ["options", "searchOptions", "highlightPostTag"],
|
|
@@ -817,7 +831,7 @@ const orderBy = {
|
|
|
817
831
|
}
|
|
818
832
|
}
|
|
819
833
|
},
|
|
820
|
-
collectionFormat:
|
|
834
|
+
collectionFormat: "CSV"
|
|
821
835
|
};
|
|
822
836
|
const queryType = {
|
|
823
837
|
parameterPath: ["options", "searchOptions", "queryType"],
|
|
@@ -842,7 +856,7 @@ const scoringParameters = {
|
|
|
842
856
|
}
|
|
843
857
|
}
|
|
844
858
|
},
|
|
845
|
-
collectionFormat:
|
|
859
|
+
collectionFormat: "Multi"
|
|
846
860
|
};
|
|
847
861
|
const scoringProfile = {
|
|
848
862
|
parameterPath: ["options", "searchOptions", "scoringProfile"],
|
|
@@ -866,7 +880,7 @@ const searchFields = {
|
|
|
866
880
|
}
|
|
867
881
|
}
|
|
868
882
|
},
|
|
869
|
-
collectionFormat:
|
|
883
|
+
collectionFormat: "CSV"
|
|
870
884
|
};
|
|
871
885
|
const searchMode = {
|
|
872
886
|
parameterPath: ["options", "searchOptions", "searchMode"],
|
|
@@ -897,7 +911,7 @@ const sessionId = {
|
|
|
897
911
|
}
|
|
898
912
|
}
|
|
899
913
|
};
|
|
900
|
-
const select = {
|
|
914
|
+
const select$1 = {
|
|
901
915
|
parameterPath: ["options", "searchOptions", "select"],
|
|
902
916
|
mapper: {
|
|
903
917
|
serializedName: "$select",
|
|
@@ -910,7 +924,7 @@ const select = {
|
|
|
910
924
|
}
|
|
911
925
|
}
|
|
912
926
|
},
|
|
913
|
-
collectionFormat:
|
|
927
|
+
collectionFormat: "CSV"
|
|
914
928
|
};
|
|
915
929
|
const skip = {
|
|
916
930
|
parameterPath: ["options", "searchOptions", "skip"],
|
|
@@ -930,7 +944,7 @@ const top = {
|
|
|
930
944
|
}
|
|
931
945
|
}
|
|
932
946
|
};
|
|
933
|
-
const contentType = {
|
|
947
|
+
const contentType$1 = {
|
|
934
948
|
parameterPath: ["options", "contentType"],
|
|
935
949
|
mapper: {
|
|
936
950
|
defaultValue: "application/json",
|
|
@@ -968,7 +982,7 @@ const selectedFields = {
|
|
|
968
982
|
}
|
|
969
983
|
}
|
|
970
984
|
},
|
|
971
|
-
collectionFormat:
|
|
985
|
+
collectionFormat: "CSV"
|
|
972
986
|
};
|
|
973
987
|
const searchText1 = {
|
|
974
988
|
parameterPath: "searchText",
|
|
@@ -1048,7 +1062,7 @@ const orderBy1 = {
|
|
|
1048
1062
|
}
|
|
1049
1063
|
}
|
|
1050
1064
|
},
|
|
1051
|
-
collectionFormat:
|
|
1065
|
+
collectionFormat: "CSV"
|
|
1052
1066
|
};
|
|
1053
1067
|
const searchFields1 = {
|
|
1054
1068
|
parameterPath: ["options", "suggestOptions", "searchFields"],
|
|
@@ -1063,7 +1077,7 @@ const searchFields1 = {
|
|
|
1063
1077
|
}
|
|
1064
1078
|
}
|
|
1065
1079
|
},
|
|
1066
|
-
collectionFormat:
|
|
1080
|
+
collectionFormat: "CSV"
|
|
1067
1081
|
};
|
|
1068
1082
|
const select1 = {
|
|
1069
1083
|
parameterPath: ["options", "suggestOptions", "select"],
|
|
@@ -1078,7 +1092,7 @@ const select1 = {
|
|
|
1078
1092
|
}
|
|
1079
1093
|
}
|
|
1080
1094
|
},
|
|
1081
|
-
collectionFormat:
|
|
1095
|
+
collectionFormat: "CSV"
|
|
1082
1096
|
};
|
|
1083
1097
|
const top1 = {
|
|
1084
1098
|
parameterPath: ["options", "suggestOptions", "top"],
|
|
@@ -1165,7 +1179,7 @@ const searchFields2 = {
|
|
|
1165
1179
|
}
|
|
1166
1180
|
}
|
|
1167
1181
|
},
|
|
1168
|
-
collectionFormat:
|
|
1182
|
+
collectionFormat: "CSV"
|
|
1169
1183
|
};
|
|
1170
1184
|
const top2 = {
|
|
1171
1185
|
parameterPath: ["options", "autocompleteOptions", "top"],
|
|
@@ -1189,7 +1203,7 @@ const autocompleteRequest = {
|
|
|
1189
1203
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
1190
1204
|
*/
|
|
1191
1205
|
/** Class representing a Documents. */
|
|
1192
|
-
class
|
|
1206
|
+
class DocumentsImpl {
|
|
1193
1207
|
/**
|
|
1194
1208
|
* Initialize a new instance of the class Documents class.
|
|
1195
1209
|
* @param client Reference to the service client
|
|
@@ -1202,20 +1216,14 @@ class Documents {
|
|
|
1202
1216
|
* @param options The options parameters.
|
|
1203
1217
|
*/
|
|
1204
1218
|
count(options) {
|
|
1205
|
-
|
|
1206
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
1207
|
-
};
|
|
1208
|
-
return this.client.sendOperationRequest(operationArguments, countOperationSpec);
|
|
1219
|
+
return this.client.sendOperationRequest({ options }, countOperationSpec);
|
|
1209
1220
|
}
|
|
1210
1221
|
/**
|
|
1211
1222
|
* Searches for documents in the index.
|
|
1212
1223
|
* @param options The options parameters.
|
|
1213
1224
|
*/
|
|
1214
1225
|
searchGet(options) {
|
|
1215
|
-
|
|
1216
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
1217
|
-
};
|
|
1218
|
-
return this.client.sendOperationRequest(operationArguments, searchGetOperationSpec);
|
|
1226
|
+
return this.client.sendOperationRequest({ options }, searchGetOperationSpec);
|
|
1219
1227
|
}
|
|
1220
1228
|
/**
|
|
1221
1229
|
* Searches for documents in the index.
|
|
@@ -1223,11 +1231,7 @@ class Documents {
|
|
|
1223
1231
|
* @param options The options parameters.
|
|
1224
1232
|
*/
|
|
1225
1233
|
searchPost(searchRequest, options) {
|
|
1226
|
-
|
|
1227
|
-
searchRequest,
|
|
1228
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
1229
|
-
};
|
|
1230
|
-
return this.client.sendOperationRequest(operationArguments, searchPostOperationSpec);
|
|
1234
|
+
return this.client.sendOperationRequest({ searchRequest, options }, searchPostOperationSpec);
|
|
1231
1235
|
}
|
|
1232
1236
|
/**
|
|
1233
1237
|
* Retrieves a document from the index.
|
|
@@ -1235,11 +1239,7 @@ class Documents {
|
|
|
1235
1239
|
* @param options The options parameters.
|
|
1236
1240
|
*/
|
|
1237
1241
|
get(key, options) {
|
|
1238
|
-
|
|
1239
|
-
key,
|
|
1240
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
1241
|
-
};
|
|
1242
|
-
return this.client.sendOperationRequest(operationArguments, getOperationSpec);
|
|
1242
|
+
return this.client.sendOperationRequest({ key, options }, getOperationSpec$5);
|
|
1243
1243
|
}
|
|
1244
1244
|
/**
|
|
1245
1245
|
* Suggests documents in the index that match the given partial query text.
|
|
@@ -1250,12 +1250,7 @@ class Documents {
|
|
|
1250
1250
|
* @param options The options parameters.
|
|
1251
1251
|
*/
|
|
1252
1252
|
suggestGet(searchText, suggesterName, options) {
|
|
1253
|
-
|
|
1254
|
-
searchText,
|
|
1255
|
-
suggesterName,
|
|
1256
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
1257
|
-
};
|
|
1258
|
-
return this.client.sendOperationRequest(operationArguments, suggestGetOperationSpec);
|
|
1253
|
+
return this.client.sendOperationRequest({ searchText, suggesterName, options }, suggestGetOperationSpec);
|
|
1259
1254
|
}
|
|
1260
1255
|
/**
|
|
1261
1256
|
* Suggests documents in the index that match the given partial query text.
|
|
@@ -1263,11 +1258,7 @@ class Documents {
|
|
|
1263
1258
|
* @param options The options parameters.
|
|
1264
1259
|
*/
|
|
1265
1260
|
suggestPost(suggestRequest, options) {
|
|
1266
|
-
|
|
1267
|
-
suggestRequest,
|
|
1268
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
1269
|
-
};
|
|
1270
|
-
return this.client.sendOperationRequest(operationArguments, suggestPostOperationSpec);
|
|
1261
|
+
return this.client.sendOperationRequest({ suggestRequest, options }, suggestPostOperationSpec);
|
|
1271
1262
|
}
|
|
1272
1263
|
/**
|
|
1273
1264
|
* Sends a batch of document write actions to the index.
|
|
@@ -1275,11 +1266,7 @@ class Documents {
|
|
|
1275
1266
|
* @param options The options parameters.
|
|
1276
1267
|
*/
|
|
1277
1268
|
index(batch, options) {
|
|
1278
|
-
|
|
1279
|
-
batch,
|
|
1280
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
1281
|
-
};
|
|
1282
|
-
return this.client.sendOperationRequest(operationArguments, indexOperationSpec);
|
|
1269
|
+
return this.client.sendOperationRequest({ batch, options }, indexOperationSpec);
|
|
1283
1270
|
}
|
|
1284
1271
|
/**
|
|
1285
1272
|
* Autocompletes incomplete query terms based on input text and matching terms in the index.
|
|
@@ -1289,12 +1276,7 @@ class Documents {
|
|
|
1289
1276
|
* @param options The options parameters.
|
|
1290
1277
|
*/
|
|
1291
1278
|
autocompleteGet(searchText, suggesterName, options) {
|
|
1292
|
-
|
|
1293
|
-
searchText,
|
|
1294
|
-
suggesterName,
|
|
1295
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
1296
|
-
};
|
|
1297
|
-
return this.client.sendOperationRequest(operationArguments, autocompleteGetOperationSpec);
|
|
1279
|
+
return this.client.sendOperationRequest({ searchText, suggesterName, options }, autocompleteGetOperationSpec);
|
|
1298
1280
|
}
|
|
1299
1281
|
/**
|
|
1300
1282
|
* Autocompletes incomplete query terms based on input text and matching terms in the index.
|
|
@@ -1302,15 +1284,11 @@ class Documents {
|
|
|
1302
1284
|
* @param options The options parameters.
|
|
1303
1285
|
*/
|
|
1304
1286
|
autocompletePost(autocompleteRequest, options) {
|
|
1305
|
-
|
|
1306
|
-
autocompleteRequest,
|
|
1307
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
1308
|
-
};
|
|
1309
|
-
return this.client.sendOperationRequest(operationArguments, autocompletePostOperationSpec);
|
|
1287
|
+
return this.client.sendOperationRequest({ autocompleteRequest, options }, autocompletePostOperationSpec);
|
|
1310
1288
|
}
|
|
1311
1289
|
}
|
|
1312
1290
|
// Operation Specifications
|
|
1313
|
-
const serializer =
|
|
1291
|
+
const serializer$6 = coreClient__namespace.createSerializer(Mappers$1, /* isXml */ false);
|
|
1314
1292
|
const countOperationSpec = {
|
|
1315
1293
|
path: "/docs/$count",
|
|
1316
1294
|
httpMethod: "GET",
|
|
@@ -1319,13 +1297,13 @@ const countOperationSpec = {
|
|
|
1319
1297
|
bodyMapper: { type: { name: "Number" } }
|
|
1320
1298
|
},
|
|
1321
1299
|
default: {
|
|
1322
|
-
bodyMapper: SearchError
|
|
1300
|
+
bodyMapper: SearchError$1
|
|
1323
1301
|
}
|
|
1324
1302
|
},
|
|
1325
|
-
queryParameters: [apiVersion],
|
|
1326
|
-
urlParameters: [endpoint, indexName],
|
|
1327
|
-
headerParameters: [accept
|
|
1328
|
-
serializer
|
|
1303
|
+
queryParameters: [apiVersion$1],
|
|
1304
|
+
urlParameters: [endpoint$1, indexName$1],
|
|
1305
|
+
headerParameters: [accept$1],
|
|
1306
|
+
serializer: serializer$6
|
|
1329
1307
|
};
|
|
1330
1308
|
const searchGetOperationSpec = {
|
|
1331
1309
|
path: "/docs",
|
|
@@ -1335,11 +1313,11 @@ const searchGetOperationSpec = {
|
|
|
1335
1313
|
bodyMapper: SearchDocumentsResult
|
|
1336
1314
|
},
|
|
1337
1315
|
default: {
|
|
1338
|
-
bodyMapper: SearchError
|
|
1316
|
+
bodyMapper: SearchError$1
|
|
1339
1317
|
}
|
|
1340
1318
|
},
|
|
1341
1319
|
queryParameters: [
|
|
1342
|
-
apiVersion,
|
|
1320
|
+
apiVersion$1,
|
|
1343
1321
|
searchText,
|
|
1344
1322
|
includeTotalResultCount,
|
|
1345
1323
|
facets,
|
|
@@ -1356,13 +1334,13 @@ const searchGetOperationSpec = {
|
|
|
1356
1334
|
searchMode,
|
|
1357
1335
|
scoringStatistics,
|
|
1358
1336
|
sessionId,
|
|
1359
|
-
select,
|
|
1337
|
+
select$1,
|
|
1360
1338
|
skip,
|
|
1361
1339
|
top
|
|
1362
1340
|
],
|
|
1363
|
-
urlParameters: [endpoint, indexName],
|
|
1364
|
-
headerParameters: [accept
|
|
1365
|
-
serializer
|
|
1341
|
+
urlParameters: [endpoint$1, indexName$1],
|
|
1342
|
+
headerParameters: [accept$1],
|
|
1343
|
+
serializer: serializer$6
|
|
1366
1344
|
};
|
|
1367
1345
|
const searchPostOperationSpec = {
|
|
1368
1346
|
path: "/docs/search.post.search",
|
|
@@ -1372,21 +1350,17 @@ const searchPostOperationSpec = {
|
|
|
1372
1350
|
bodyMapper: SearchDocumentsResult
|
|
1373
1351
|
},
|
|
1374
1352
|
default: {
|
|
1375
|
-
bodyMapper: SearchError
|
|
1353
|
+
bodyMapper: SearchError$1
|
|
1376
1354
|
}
|
|
1377
1355
|
},
|
|
1378
1356
|
requestBody: searchRequest,
|
|
1379
|
-
queryParameters: [apiVersion],
|
|
1380
|
-
urlParameters: [endpoint, indexName],
|
|
1381
|
-
headerParameters: [
|
|
1382
|
-
accept,
|
|
1383
|
-
xMsClientRequestId,
|
|
1384
|
-
contentType
|
|
1385
|
-
],
|
|
1357
|
+
queryParameters: [apiVersion$1],
|
|
1358
|
+
urlParameters: [endpoint$1, indexName$1],
|
|
1359
|
+
headerParameters: [accept$1, contentType$1],
|
|
1386
1360
|
mediaType: "json",
|
|
1387
|
-
serializer
|
|
1361
|
+
serializer: serializer$6
|
|
1388
1362
|
};
|
|
1389
|
-
const getOperationSpec = {
|
|
1363
|
+
const getOperationSpec$5 = {
|
|
1390
1364
|
path: "/docs('{key}')",
|
|
1391
1365
|
httpMethod: "GET",
|
|
1392
1366
|
responses: {
|
|
@@ -1394,13 +1368,13 @@ const getOperationSpec = {
|
|
|
1394
1368
|
bodyMapper: { type: { name: "any" } }
|
|
1395
1369
|
},
|
|
1396
1370
|
default: {
|
|
1397
|
-
bodyMapper: SearchError
|
|
1371
|
+
bodyMapper: SearchError$1
|
|
1398
1372
|
}
|
|
1399
1373
|
},
|
|
1400
|
-
queryParameters: [apiVersion, selectedFields],
|
|
1401
|
-
urlParameters: [endpoint, indexName, key],
|
|
1402
|
-
headerParameters: [accept
|
|
1403
|
-
serializer
|
|
1374
|
+
queryParameters: [apiVersion$1, selectedFields],
|
|
1375
|
+
urlParameters: [endpoint$1, indexName$1, key],
|
|
1376
|
+
headerParameters: [accept$1],
|
|
1377
|
+
serializer: serializer$6
|
|
1404
1378
|
};
|
|
1405
1379
|
const suggestGetOperationSpec = {
|
|
1406
1380
|
path: "/docs/search.suggest",
|
|
@@ -1410,11 +1384,11 @@ const suggestGetOperationSpec = {
|
|
|
1410
1384
|
bodyMapper: SuggestDocumentsResult
|
|
1411
1385
|
},
|
|
1412
1386
|
default: {
|
|
1413
|
-
bodyMapper: SearchError
|
|
1387
|
+
bodyMapper: SearchError$1
|
|
1414
1388
|
}
|
|
1415
1389
|
},
|
|
1416
1390
|
queryParameters: [
|
|
1417
|
-
apiVersion,
|
|
1391
|
+
apiVersion$1,
|
|
1418
1392
|
searchText1,
|
|
1419
1393
|
suggesterName,
|
|
1420
1394
|
filter1,
|
|
@@ -1427,9 +1401,9 @@ const suggestGetOperationSpec = {
|
|
|
1427
1401
|
select1,
|
|
1428
1402
|
top1
|
|
1429
1403
|
],
|
|
1430
|
-
urlParameters: [endpoint, indexName],
|
|
1431
|
-
headerParameters: [accept
|
|
1432
|
-
serializer
|
|
1404
|
+
urlParameters: [endpoint$1, indexName$1],
|
|
1405
|
+
headerParameters: [accept$1],
|
|
1406
|
+
serializer: serializer$6
|
|
1433
1407
|
};
|
|
1434
1408
|
const suggestPostOperationSpec = {
|
|
1435
1409
|
path: "/docs/search.post.suggest",
|
|
@@ -1439,19 +1413,15 @@ const suggestPostOperationSpec = {
|
|
|
1439
1413
|
bodyMapper: SuggestDocumentsResult
|
|
1440
1414
|
},
|
|
1441
1415
|
default: {
|
|
1442
|
-
bodyMapper: SearchError
|
|
1416
|
+
bodyMapper: SearchError$1
|
|
1443
1417
|
}
|
|
1444
1418
|
},
|
|
1445
1419
|
requestBody: suggestRequest,
|
|
1446
|
-
queryParameters: [apiVersion],
|
|
1447
|
-
urlParameters: [endpoint, indexName],
|
|
1448
|
-
headerParameters: [
|
|
1449
|
-
accept,
|
|
1450
|
-
xMsClientRequestId,
|
|
1451
|
-
contentType
|
|
1452
|
-
],
|
|
1420
|
+
queryParameters: [apiVersion$1],
|
|
1421
|
+
urlParameters: [endpoint$1, indexName$1],
|
|
1422
|
+
headerParameters: [accept$1, contentType$1],
|
|
1453
1423
|
mediaType: "json",
|
|
1454
|
-
serializer
|
|
1424
|
+
serializer: serializer$6
|
|
1455
1425
|
};
|
|
1456
1426
|
const indexOperationSpec = {
|
|
1457
1427
|
path: "/docs/search.index",
|
|
@@ -1464,19 +1434,15 @@ const indexOperationSpec = {
|
|
|
1464
1434
|
bodyMapper: IndexDocumentsResult
|
|
1465
1435
|
},
|
|
1466
1436
|
default: {
|
|
1467
|
-
bodyMapper: SearchError
|
|
1437
|
+
bodyMapper: SearchError$1
|
|
1468
1438
|
}
|
|
1469
1439
|
},
|
|
1470
1440
|
requestBody: batch,
|
|
1471
|
-
queryParameters: [apiVersion],
|
|
1472
|
-
urlParameters: [endpoint, indexName],
|
|
1473
|
-
headerParameters: [
|
|
1474
|
-
accept,
|
|
1475
|
-
xMsClientRequestId,
|
|
1476
|
-
contentType
|
|
1477
|
-
],
|
|
1441
|
+
queryParameters: [apiVersion$1],
|
|
1442
|
+
urlParameters: [endpoint$1, indexName$1],
|
|
1443
|
+
headerParameters: [accept$1, contentType$1],
|
|
1478
1444
|
mediaType: "json",
|
|
1479
|
-
serializer
|
|
1445
|
+
serializer: serializer$6
|
|
1480
1446
|
};
|
|
1481
1447
|
const autocompleteGetOperationSpec = {
|
|
1482
1448
|
path: "/docs/search.autocomplete",
|
|
@@ -1486,11 +1452,11 @@ const autocompleteGetOperationSpec = {
|
|
|
1486
1452
|
bodyMapper: AutocompleteResult
|
|
1487
1453
|
},
|
|
1488
1454
|
default: {
|
|
1489
|
-
bodyMapper: SearchError
|
|
1455
|
+
bodyMapper: SearchError$1
|
|
1490
1456
|
}
|
|
1491
1457
|
},
|
|
1492
1458
|
queryParameters: [
|
|
1493
|
-
apiVersion,
|
|
1459
|
+
apiVersion$1,
|
|
1494
1460
|
searchText1,
|
|
1495
1461
|
suggesterName,
|
|
1496
1462
|
autocompleteMode,
|
|
@@ -1502,9 +1468,9 @@ const autocompleteGetOperationSpec = {
|
|
|
1502
1468
|
searchFields2,
|
|
1503
1469
|
top2
|
|
1504
1470
|
],
|
|
1505
|
-
urlParameters: [endpoint, indexName],
|
|
1506
|
-
headerParameters: [accept
|
|
1507
|
-
serializer
|
|
1471
|
+
urlParameters: [endpoint$1, indexName$1],
|
|
1472
|
+
headerParameters: [accept$1],
|
|
1473
|
+
serializer: serializer$6
|
|
1508
1474
|
};
|
|
1509
1475
|
const autocompletePostOperationSpec = {
|
|
1510
1476
|
path: "/docs/search.post.autocomplete",
|
|
@@ -1514,19 +1480,15 @@ const autocompletePostOperationSpec = {
|
|
|
1514
1480
|
bodyMapper: AutocompleteResult
|
|
1515
1481
|
},
|
|
1516
1482
|
default: {
|
|
1517
|
-
bodyMapper: SearchError
|
|
1483
|
+
bodyMapper: SearchError$1
|
|
1518
1484
|
}
|
|
1519
1485
|
},
|
|
1520
1486
|
requestBody: autocompleteRequest,
|
|
1521
|
-
queryParameters: [apiVersion],
|
|
1522
|
-
urlParameters: [endpoint, indexName],
|
|
1523
|
-
headerParameters: [
|
|
1524
|
-
accept,
|
|
1525
|
-
xMsClientRequestId,
|
|
1526
|
-
contentType
|
|
1527
|
-
],
|
|
1487
|
+
queryParameters: [apiVersion$1],
|
|
1488
|
+
urlParameters: [endpoint$1, indexName$1],
|
|
1489
|
+
headerParameters: [accept$1, contentType$1],
|
|
1528
1490
|
mediaType: "json",
|
|
1529
|
-
serializer
|
|
1491
|
+
serializer: serializer$6
|
|
1530
1492
|
};
|
|
1531
1493
|
|
|
1532
1494
|
/*
|
|
@@ -1536,10 +1498,8 @@ const autocompletePostOperationSpec = {
|
|
|
1536
1498
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
1537
1499
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
1538
1500
|
*/
|
|
1539
|
-
const packageName = "@azure/search-documents";
|
|
1540
|
-
const packageVersion = "11.3.1";
|
|
1541
1501
|
/** @internal */
|
|
1542
|
-
class SearchClientContext extends
|
|
1502
|
+
class SearchClientContext extends coreClient__namespace.ServiceClient {
|
|
1543
1503
|
/**
|
|
1544
1504
|
* Initializes a new instance of the SearchClientContext class.
|
|
1545
1505
|
* @param endpoint The endpoint URL of the search service.
|
|
@@ -1561,13 +1521,11 @@ class SearchClientContext extends coreHttp.ServiceClient {
|
|
|
1561
1521
|
if (!options) {
|
|
1562
1522
|
options = {};
|
|
1563
1523
|
}
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
}
|
|
1568
|
-
super(
|
|
1569
|
-
this.requestContentType = "application/json; charset=utf-8";
|
|
1570
|
-
this.baseUri = options.endpoint || "{endpoint}/indexes('{indexName}')";
|
|
1524
|
+
const defaults = {
|
|
1525
|
+
requestContentType: "application/json; charset=utf-8"
|
|
1526
|
+
};
|
|
1527
|
+
const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { baseUri: options.endpoint || "{endpoint}/indexes('{indexName}')" });
|
|
1528
|
+
super(optionsWithDefaults);
|
|
1571
1529
|
// Parameter assignments
|
|
1572
1530
|
this.endpoint = endpoint;
|
|
1573
1531
|
this.indexName = indexName;
|
|
@@ -1583,7 +1541,7 @@ class SearchClientContext extends coreHttp.ServiceClient {
|
|
|
1583
1541
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
1584
1542
|
*/
|
|
1585
1543
|
/** @internal */
|
|
1586
|
-
class SearchClient extends SearchClientContext {
|
|
1544
|
+
class SearchClient$1 extends SearchClientContext {
|
|
1587
1545
|
/**
|
|
1588
1546
|
* Initializes a new instance of the SearchClient class.
|
|
1589
1547
|
* @param endpoint The endpoint URL of the search service.
|
|
@@ -1593,44 +1551,29 @@ class SearchClient extends SearchClientContext {
|
|
|
1593
1551
|
*/
|
|
1594
1552
|
constructor(endpoint, indexName, apiVersion, options) {
|
|
1595
1553
|
super(endpoint, indexName, apiVersion, options);
|
|
1596
|
-
this.documents = new
|
|
1554
|
+
this.documents = new DocumentsImpl(this);
|
|
1597
1555
|
}
|
|
1598
1556
|
}
|
|
1599
1557
|
|
|
1600
1558
|
// Copyright (c) Microsoft Corporation.
|
|
1559
|
+
// Licensed under the MIT license.
|
|
1601
1560
|
const API_KEY_HEADER_NAME = "api-key";
|
|
1561
|
+
const searchApiKeyCredentialPolicy = "SearchApiKeyCredentialPolicy";
|
|
1602
1562
|
/**
|
|
1603
1563
|
* Create an HTTP pipeline policy to authenticate a request
|
|
1604
1564
|
* using an `AzureKeyCredential` for Azure Cognitive Search
|
|
1605
1565
|
*/
|
|
1606
1566
|
function createSearchApiKeyCredentialPolicy(credential) {
|
|
1607
1567
|
return {
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1568
|
+
name: searchApiKeyCredentialPolicy,
|
|
1569
|
+
async sendRequest(request, next) {
|
|
1570
|
+
if (!request.headers.has(API_KEY_HEADER_NAME)) {
|
|
1571
|
+
request.headers.set(API_KEY_HEADER_NAME, credential.key);
|
|
1572
|
+
}
|
|
1573
|
+
return next(request);
|
|
1574
|
+
},
|
|
1611
1575
|
};
|
|
1612
1576
|
}
|
|
1613
|
-
/**
|
|
1614
|
-
* A concrete implementation of an AzureKeyCredential policy
|
|
1615
|
-
* using the appropriate header for Azure Cognitive Search
|
|
1616
|
-
*/
|
|
1617
|
-
class SearchApiKeyCredentialPolicy extends coreHttp.BaseRequestPolicy {
|
|
1618
|
-
constructor(nextPolicy, options, credential) {
|
|
1619
|
-
super(nextPolicy, options);
|
|
1620
|
-
this.credential = credential;
|
|
1621
|
-
}
|
|
1622
|
-
async sendRequest(webResource) {
|
|
1623
|
-
if (!webResource) {
|
|
1624
|
-
throw new Error("webResource cannot be null or undefined");
|
|
1625
|
-
}
|
|
1626
|
-
webResource.headers.set(API_KEY_HEADER_NAME, this.credential.key);
|
|
1627
|
-
return this._nextPolicy.sendRequest(webResource);
|
|
1628
|
-
}
|
|
1629
|
-
}
|
|
1630
|
-
|
|
1631
|
-
// Copyright (c) Microsoft Corporation.
|
|
1632
|
-
// Licensed under the MIT license.
|
|
1633
|
-
const SDK_VERSION = "11.3.1";
|
|
1634
1577
|
|
|
1635
1578
|
// Copyright (c) Microsoft Corporation.
|
|
1636
1579
|
/**
|
|
@@ -1640,17 +1583,18 @@ const logger = logger$1.createClientLogger("search");
|
|
|
1640
1583
|
|
|
1641
1584
|
// Copyright (c) Microsoft Corporation.
|
|
1642
1585
|
/**
|
|
1643
|
-
* Creates a
|
|
1586
|
+
* Creates a tracing client using the global tracer.
|
|
1644
1587
|
* @internal
|
|
1645
1588
|
*/
|
|
1646
|
-
const
|
|
1647
|
-
|
|
1648
|
-
|
|
1589
|
+
const tracingClient = coreTracing.createTracingClient({
|
|
1590
|
+
namespace: "Microsoft.Search",
|
|
1591
|
+
packageName: "Azure.Search",
|
|
1649
1592
|
});
|
|
1593
|
+
const createSpan = tracingClient.startSpan;
|
|
1650
1594
|
|
|
1651
1595
|
// Copyright (c) Microsoft Corporation.
|
|
1652
1596
|
// Licensed under the MIT license.
|
|
1653
|
-
const WorldGeodeticSystem1984 = "EPSG:4326"; // See https://epsg.io/4326
|
|
1597
|
+
const WorldGeodeticSystem1984$1 = "EPSG:4326"; // See https://epsg.io/4326
|
|
1654
1598
|
/**
|
|
1655
1599
|
* Represents a geographic point in global coordinates.
|
|
1656
1600
|
*/
|
|
@@ -1671,15 +1615,15 @@ class GeographyPoint {
|
|
|
1671
1615
|
return {
|
|
1672
1616
|
type: "Point",
|
|
1673
1617
|
coordinates: [this.longitude, this.latitude],
|
|
1674
|
-
crs: { type: "name", properties: { name: WorldGeodeticSystem1984 } }
|
|
1618
|
+
crs: { type: "name", properties: { name: WorldGeodeticSystem1984$1 } },
|
|
1675
1619
|
};
|
|
1676
1620
|
}
|
|
1677
1621
|
}
|
|
1678
1622
|
|
|
1679
1623
|
// Copyright (c) Microsoft Corporation.
|
|
1680
|
-
const ISO8601DateRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z$/i;
|
|
1624
|
+
const ISO8601DateRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,3})?Z$/i;
|
|
1681
1625
|
const GeoJSONPointTypeName = "Point";
|
|
1682
|
-
const WorldGeodeticSystem1984
|
|
1626
|
+
const WorldGeodeticSystem1984 = "EPSG:4326"; // See https://epsg.io/4326
|
|
1683
1627
|
function serialize(obj) {
|
|
1684
1628
|
return walk(obj, (value) => {
|
|
1685
1629
|
const result = serializeSpecialNumbers(value);
|
|
@@ -1699,7 +1643,7 @@ function walk(start, mapper) {
|
|
|
1699
1643
|
const seenMarker = new WeakMap();
|
|
1700
1644
|
const result = { value: undefined };
|
|
1701
1645
|
const queue = [
|
|
1702
|
-
{ value: start, parent: result, key: "value" }
|
|
1646
|
+
{ value: start, parent: result, key: "value" },
|
|
1703
1647
|
];
|
|
1704
1648
|
while (queue.length) {
|
|
1705
1649
|
const current = queue.shift();
|
|
@@ -1720,7 +1664,7 @@ function walk(start, mapper) {
|
|
|
1720
1664
|
queue.push({
|
|
1721
1665
|
value: mapped[key],
|
|
1722
1666
|
parent: mapped,
|
|
1723
|
-
key
|
|
1667
|
+
key,
|
|
1724
1668
|
});
|
|
1725
1669
|
}
|
|
1726
1670
|
}
|
|
@@ -1784,7 +1728,7 @@ function isGeoJSONPoint(obj) {
|
|
|
1784
1728
|
default:
|
|
1785
1729
|
return false;
|
|
1786
1730
|
}
|
|
1787
|
-
}
|
|
1731
|
+
},
|
|
1788
1732
|
});
|
|
1789
1733
|
}
|
|
1790
1734
|
function isCoordinateArray(maybeCoordinates) {
|
|
@@ -1811,7 +1755,7 @@ function isCrs(maybeCrs) {
|
|
|
1811
1755
|
default:
|
|
1812
1756
|
return false;
|
|
1813
1757
|
}
|
|
1814
|
-
}
|
|
1758
|
+
},
|
|
1815
1759
|
});
|
|
1816
1760
|
}
|
|
1817
1761
|
function isCrsProperties(maybeProperties) {
|
|
@@ -1819,12 +1763,12 @@ function isCrsProperties(maybeProperties) {
|
|
|
1819
1763
|
requiredKeys: ["name"],
|
|
1820
1764
|
propertyValidator: (key) => {
|
|
1821
1765
|
if (key === "name") {
|
|
1822
|
-
return maybeProperties.name === WorldGeodeticSystem1984
|
|
1766
|
+
return maybeProperties.name === WorldGeodeticSystem1984;
|
|
1823
1767
|
}
|
|
1824
1768
|
else {
|
|
1825
1769
|
return false;
|
|
1826
1770
|
}
|
|
1827
|
-
}
|
|
1771
|
+
},
|
|
1828
1772
|
});
|
|
1829
1773
|
}
|
|
1830
1774
|
function isValidObject(obj, options = {}) {
|
|
@@ -1850,28 +1794,22 @@ function isValidObject(obj, options = {}) {
|
|
|
1850
1794
|
}
|
|
1851
1795
|
|
|
1852
1796
|
// Copyright (c) Microsoft Corporation.
|
|
1797
|
+
// Licensed under the MIT license.
|
|
1853
1798
|
const AcceptHeaderName = "Accept";
|
|
1799
|
+
const odataMetadataPolicy = "OdataMetadataPolicy";
|
|
1854
1800
|
/**
|
|
1855
1801
|
* A policy factory for setting the Accept header to ignore odata metadata
|
|
1856
1802
|
* @internal
|
|
1857
1803
|
*/
|
|
1858
|
-
function
|
|
1804
|
+
function createOdataMetadataPolicy(metadataLevel) {
|
|
1859
1805
|
return {
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1806
|
+
name: odataMetadataPolicy,
|
|
1807
|
+
async sendRequest(request, next) {
|
|
1808
|
+
request.headers.set(AcceptHeaderName, `application/json;odata.metadata=${metadataLevel}`);
|
|
1809
|
+
return next(request);
|
|
1810
|
+
},
|
|
1863
1811
|
};
|
|
1864
1812
|
}
|
|
1865
|
-
class OdataMetadataPolicy extends coreHttp.BaseRequestPolicy {
|
|
1866
|
-
constructor(nextPolicy, options, policyOptions) {
|
|
1867
|
-
super(nextPolicy, options);
|
|
1868
|
-
this.metadataLevel = policyOptions.metadataLevel;
|
|
1869
|
-
}
|
|
1870
|
-
async sendRequest(webResource) {
|
|
1871
|
-
webResource.headers.set(AcceptHeaderName, `application/json;odata.metadata=${this.metadataLevel}`);
|
|
1872
|
-
return this._nextPolicy.sendRequest(webResource);
|
|
1873
|
-
}
|
|
1874
|
-
}
|
|
1875
1813
|
|
|
1876
1814
|
// Copyright (c) Microsoft Corporation.
|
|
1877
1815
|
// Licensed under the MIT license.
|
|
@@ -1921,7 +1859,7 @@ class IndexDocumentsBatch {
|
|
|
1921
1859
|
const batch = keyValues.map((keyValue) => {
|
|
1922
1860
|
return {
|
|
1923
1861
|
__actionType: "delete",
|
|
1924
|
-
[keyName]: keyValue
|
|
1862
|
+
[keyName]: keyValue,
|
|
1925
1863
|
};
|
|
1926
1864
|
});
|
|
1927
1865
|
this.actions.push(...batch);
|
|
@@ -1958,6 +1896,11 @@ function decode(value) {
|
|
|
1958
1896
|
function isComplexField(field) {
|
|
1959
1897
|
return field.type === "Edm.ComplexType" || field.type === "Collection(Edm.ComplexType)";
|
|
1960
1898
|
}
|
|
1899
|
+
/**
|
|
1900
|
+
* Defines values for TokenizerName.
|
|
1901
|
+
* @readonly
|
|
1902
|
+
*/
|
|
1903
|
+
exports.KnownTokenizerNames = void 0;
|
|
1961
1904
|
(function (KnownTokenizerNames) {
|
|
1962
1905
|
/**
|
|
1963
1906
|
* Grammar-based tokenizer that is suitable for processing most European-language documents. See
|
|
@@ -2026,6 +1969,11 @@ function isComplexField(field) {
|
|
|
2026
1969
|
*/
|
|
2027
1970
|
KnownTokenizerNames["Whitespace"] = "whitespace";
|
|
2028
1971
|
})(exports.KnownTokenizerNames || (exports.KnownTokenizerNames = {}));
|
|
1972
|
+
/**
|
|
1973
|
+
* Defines values for TokenFilterName.
|
|
1974
|
+
* @readonly
|
|
1975
|
+
*/
|
|
1976
|
+
exports.KnownTokenFilterNames = void 0;
|
|
2029
1977
|
(function (KnownTokenFilterNames) {
|
|
2030
1978
|
/**
|
|
2031
1979
|
* A token filter that applies the Arabic normalizer to normalize the orthography. See
|
|
@@ -2204,6 +2152,11 @@ function isComplexField(field) {
|
|
|
2204
2152
|
*/
|
|
2205
2153
|
KnownTokenFilterNames["WordDelimiter"] = "word_delimiter";
|
|
2206
2154
|
})(exports.KnownTokenFilterNames || (exports.KnownTokenFilterNames = {}));
|
|
2155
|
+
/**
|
|
2156
|
+
* Defines values for CharFilterName.
|
|
2157
|
+
* @readonly
|
|
2158
|
+
*/
|
|
2159
|
+
exports.KnownCharFilterNames = void 0;
|
|
2207
2160
|
(function (KnownCharFilterNames) {
|
|
2208
2161
|
/**
|
|
2209
2162
|
* A character filter that attempts to strip out HTML constructs. See
|
|
@@ -2211,6 +2164,12 @@ function isComplexField(field) {
|
|
|
2211
2164
|
*/
|
|
2212
2165
|
KnownCharFilterNames["HtmlStrip"] = "html_strip";
|
|
2213
2166
|
})(exports.KnownCharFilterNames || (exports.KnownCharFilterNames = {}));
|
|
2167
|
+
/**
|
|
2168
|
+
* Defines values for AnalyzerName.
|
|
2169
|
+
* See https://docs.microsoft.com/rest/api/searchservice/Language-support
|
|
2170
|
+
* @readonly
|
|
2171
|
+
*/
|
|
2172
|
+
exports.KnownAnalyzerNames = void 0;
|
|
2214
2173
|
(function (KnownAnalyzerNames) {
|
|
2215
2174
|
/**
|
|
2216
2175
|
* Arabic
|
|
@@ -2718,28 +2677,28 @@ function convertFieldsToPublic(fields) {
|
|
|
2718
2677
|
return fields;
|
|
2719
2678
|
}
|
|
2720
2679
|
return fields.map((field) => {
|
|
2721
|
-
let result;
|
|
2722
2680
|
if (field.type === "Collection(Edm.ComplexType)" || field.type === "Edm.ComplexType") {
|
|
2723
|
-
|
|
2681
|
+
const result = {
|
|
2724
2682
|
name: field.name,
|
|
2725
2683
|
type: field.type,
|
|
2726
|
-
fields: convertFieldsToPublic(field.fields)
|
|
2684
|
+
fields: convertFieldsToPublic(field.fields),
|
|
2727
2685
|
};
|
|
2686
|
+
return result;
|
|
2728
2687
|
}
|
|
2729
2688
|
else {
|
|
2689
|
+
const { synonymMaps, retrievable } = field, restField = tslib.__rest(field, ["synonymMaps", "retrievable"]);
|
|
2690
|
+
const type = field.type;
|
|
2691
|
+
const hidden = typeof retrievable === "boolean" ? !retrievable : retrievable;
|
|
2730
2692
|
const analyzerName = field.analyzer;
|
|
2731
2693
|
const searchAnalyzerName = field.searchAnalyzer;
|
|
2732
2694
|
const indexAnalyzerName = field.indexAnalyzer;
|
|
2733
|
-
const
|
|
2734
|
-
|
|
2735
|
-
const hidden = typeof retrievable === "boolean" ? !retrievable : retrievable;
|
|
2736
|
-
result = Object.assign(Object.assign({}, restField), { hidden,
|
|
2695
|
+
const result = Object.assign(Object.assign({}, restField), { type,
|
|
2696
|
+
hidden,
|
|
2737
2697
|
analyzerName,
|
|
2738
2698
|
searchAnalyzerName,
|
|
2739
|
-
indexAnalyzerName,
|
|
2740
|
-
|
|
2699
|
+
indexAnalyzerName, synonymMapNames: synonymMaps });
|
|
2700
|
+
return result;
|
|
2741
2701
|
}
|
|
2742
|
-
return result;
|
|
2743
2702
|
});
|
|
2744
2703
|
}
|
|
2745
2704
|
function convertFieldsToGenerated(fields) {
|
|
@@ -2749,7 +2708,7 @@ function convertFieldsToGenerated(fields) {
|
|
|
2749
2708
|
return {
|
|
2750
2709
|
name: field.name,
|
|
2751
2710
|
type: field.type,
|
|
2752
|
-
fields: convertFieldsToGenerated(field.fields)
|
|
2711
|
+
fields: convertFieldsToGenerated(field.fields),
|
|
2753
2712
|
};
|
|
2754
2713
|
}
|
|
2755
2714
|
else {
|
|
@@ -2810,17 +2769,6 @@ function convertSimilarityToPublic(similarity) {
|
|
|
2810
2769
|
return similarity;
|
|
2811
2770
|
}
|
|
2812
2771
|
}
|
|
2813
|
-
function extractOperationOptions(obj) {
|
|
2814
|
-
const { abortSignal, requestOptions, tracingOptions } = obj, restOptions = tslib.__rest(obj, ["abortSignal", "requestOptions", "tracingOptions"]);
|
|
2815
|
-
return {
|
|
2816
|
-
operationOptions: {
|
|
2817
|
-
abortSignal,
|
|
2818
|
-
requestOptions,
|
|
2819
|
-
tracingOptions
|
|
2820
|
-
},
|
|
2821
|
-
restOptions
|
|
2822
|
-
};
|
|
2823
|
-
}
|
|
2824
2772
|
function convertEncryptionKeyToPublic(encryptionKey) {
|
|
2825
2773
|
if (!encryptionKey) {
|
|
2826
2774
|
return encryptionKey;
|
|
@@ -2828,7 +2776,7 @@ function convertEncryptionKeyToPublic(encryptionKey) {
|
|
|
2828
2776
|
const result = {
|
|
2829
2777
|
keyName: encryptionKey.keyName,
|
|
2830
2778
|
keyVersion: encryptionKey.keyVersion,
|
|
2831
|
-
vaultUrl: encryptionKey.vaultUri
|
|
2779
|
+
vaultUrl: encryptionKey.vaultUri,
|
|
2832
2780
|
};
|
|
2833
2781
|
if (encryptionKey.accessCredentials) {
|
|
2834
2782
|
result.applicationId = encryptionKey.accessCredentials.applicationId;
|
|
@@ -2843,12 +2791,12 @@ function convertEncryptionKeyToGenerated(encryptionKey) {
|
|
|
2843
2791
|
const result = {
|
|
2844
2792
|
keyName: encryptionKey.keyName,
|
|
2845
2793
|
keyVersion: encryptionKey.keyVersion,
|
|
2846
|
-
vaultUri: encryptionKey.vaultUrl
|
|
2794
|
+
vaultUri: encryptionKey.vaultUrl,
|
|
2847
2795
|
};
|
|
2848
2796
|
if (encryptionKey.applicationId) {
|
|
2849
2797
|
result.accessCredentials = {
|
|
2850
2798
|
applicationId: encryptionKey.applicationId,
|
|
2851
|
-
applicationSecret: encryptionKey.applicationSecret
|
|
2799
|
+
applicationSecret: encryptionKey.applicationSecret,
|
|
2852
2800
|
};
|
|
2853
2801
|
}
|
|
2854
2802
|
return result;
|
|
@@ -2867,7 +2815,7 @@ function generatedIndexToPublicIndex(generatedIndex) {
|
|
|
2867
2815
|
charFilters: generatedIndex.charFilters,
|
|
2868
2816
|
scoringProfiles: generatedIndex.scoringProfiles,
|
|
2869
2817
|
fields: convertFieldsToPublic(generatedIndex.fields),
|
|
2870
|
-
similarity: convertSimilarityToPublic(generatedIndex.similarity)
|
|
2818
|
+
similarity: convertSimilarityToPublic(generatedIndex.similarity),
|
|
2871
2819
|
};
|
|
2872
2820
|
}
|
|
2873
2821
|
function generatedSearchResultToPublicSearchResult(results) {
|
|
@@ -2877,7 +2825,9 @@ function generatedSearchResultToPublicSearchResult(results) {
|
|
|
2877
2825
|
const obj = {
|
|
2878
2826
|
score: _score,
|
|
2879
2827
|
highlights: _highlights,
|
|
2880
|
-
|
|
2828
|
+
rerankerScore,
|
|
2829
|
+
captions,
|
|
2830
|
+
document: doc,
|
|
2881
2831
|
};
|
|
2882
2832
|
return obj;
|
|
2883
2833
|
});
|
|
@@ -2889,43 +2839,23 @@ function generatedSuggestDocumentsResultToPublicSuggestDocumentsResult(searchDoc
|
|
|
2889
2839
|
const doc = Object.assign({}, restProps);
|
|
2890
2840
|
const obj = {
|
|
2891
2841
|
text: _text,
|
|
2892
|
-
document: doc
|
|
2842
|
+
document: doc,
|
|
2893
2843
|
};
|
|
2894
2844
|
return obj;
|
|
2895
2845
|
});
|
|
2896
2846
|
const result = {
|
|
2897
2847
|
results: results,
|
|
2898
|
-
coverage: searchDocumentsResult.coverage
|
|
2848
|
+
coverage: searchDocumentsResult.coverage,
|
|
2899
2849
|
};
|
|
2900
2850
|
return result;
|
|
2901
2851
|
}
|
|
2902
2852
|
function publicIndexToGeneratedIndex(index) {
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
defaultScoringProfile: index.defaultScoringProfile,
|
|
2906
|
-
corsOptions: index.corsOptions,
|
|
2907
|
-
suggesters: index.suggesters,
|
|
2908
|
-
encryptionKey: convertEncryptionKeyToGenerated(index.encryptionKey),
|
|
2909
|
-
etag: index.etag,
|
|
2910
|
-
tokenFilters: convertTokenFiltersToGenerated(index.tokenFilters),
|
|
2911
|
-
charFilters: index.charFilters,
|
|
2912
|
-
scoringProfiles: index.scoringProfiles,
|
|
2913
|
-
analyzers: convertAnalyzersToGenerated(index.analyzers),
|
|
2914
|
-
tokenizers: convertTokenizersToGenerated(index.tokenizers),
|
|
2915
|
-
fields: convertFieldsToGenerated(index.fields),
|
|
2916
|
-
similarity: convertSimilarityToGenerated(index.similarity)
|
|
2917
|
-
};
|
|
2853
|
+
const { encryptionKey, tokenFilters, analyzers, tokenizers, fields, similarity } = index, props = tslib.__rest(index, ["encryptionKey", "tokenFilters", "analyzers", "tokenizers", "fields", "similarity"]);
|
|
2854
|
+
return Object.assign(Object.assign({}, props), { encryptionKey: convertEncryptionKeyToGenerated(encryptionKey), tokenFilters: convertTokenFiltersToGenerated(tokenFilters), analyzers: convertAnalyzersToGenerated(analyzers), tokenizers: convertTokenizersToGenerated(tokenizers), fields: convertFieldsToGenerated(fields), similarity: convertSimilarityToGenerated(similarity) });
|
|
2918
2855
|
}
|
|
2919
2856
|
function generatedSkillsetToPublicSkillset(generatedSkillset) {
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
description: generatedSkillset.description,
|
|
2923
|
-
skills: convertSkillsToPublic(generatedSkillset.skills),
|
|
2924
|
-
cognitiveServicesAccount: convertCognitiveServicesAccountToPublic(generatedSkillset.cognitiveServicesAccount),
|
|
2925
|
-
knowledgeStore: generatedSkillset.knowledgeStore,
|
|
2926
|
-
etag: generatedSkillset.etag,
|
|
2927
|
-
encryptionKey: convertEncryptionKeyToPublic(generatedSkillset.encryptionKey)
|
|
2928
|
-
};
|
|
2857
|
+
const { skills, cognitiveServicesAccount, encryptionKey } = generatedSkillset, props = tslib.__rest(generatedSkillset, ["skills", "cognitiveServicesAccount", "encryptionKey"]);
|
|
2858
|
+
return Object.assign(Object.assign({}, props), { skills: convertSkillsToPublic(skills), cognitiveServicesAccount: convertCognitiveServicesAccountToPublic(cognitiveServicesAccount), encryptionKey: convertEncryptionKeyToPublic(encryptionKey) });
|
|
2929
2859
|
}
|
|
2930
2860
|
function publicSkillsetToGeneratedSkillset(skillset) {
|
|
2931
2861
|
return {
|
|
@@ -2935,7 +2865,7 @@ function publicSkillsetToGeneratedSkillset(skillset) {
|
|
|
2935
2865
|
skills: skillset.skills,
|
|
2936
2866
|
cognitiveServicesAccount: convertCognitiveServicesAccountToGenerated(skillset.cognitiveServicesAccount),
|
|
2937
2867
|
knowledgeStore: skillset.knowledgeStore,
|
|
2938
|
-
encryptionKey: convertEncryptionKeyToGenerated(skillset.encryptionKey)
|
|
2868
|
+
encryptionKey: convertEncryptionKeyToGenerated(skillset.encryptionKey),
|
|
2939
2869
|
};
|
|
2940
2870
|
}
|
|
2941
2871
|
function generatedSynonymMapToPublicSynonymMap(synonymMap) {
|
|
@@ -2943,7 +2873,7 @@ function generatedSynonymMapToPublicSynonymMap(synonymMap) {
|
|
|
2943
2873
|
name: synonymMap.name,
|
|
2944
2874
|
encryptionKey: convertEncryptionKeyToPublic(synonymMap.encryptionKey),
|
|
2945
2875
|
etag: synonymMap.etag,
|
|
2946
|
-
synonyms: []
|
|
2876
|
+
synonyms: [],
|
|
2947
2877
|
};
|
|
2948
2878
|
if (synonymMap.synonyms) {
|
|
2949
2879
|
result.synonyms = synonymMap.synonyms.split("\n");
|
|
@@ -2956,7 +2886,7 @@ function publicSynonymMapToGeneratedSynonymMap(synonymMap) {
|
|
|
2956
2886
|
format: "solr",
|
|
2957
2887
|
encryptionKey: convertEncryptionKeyToGenerated(synonymMap.encryptionKey),
|
|
2958
2888
|
etag: synonymMap.etag,
|
|
2959
|
-
synonyms: synonymMap.synonyms.join("\n")
|
|
2889
|
+
synonyms: synonymMap.synonyms.join("\n"),
|
|
2960
2890
|
};
|
|
2961
2891
|
result.encryptionKey = convertEncryptionKeyToGenerated(synonymMap.encryptionKey);
|
|
2962
2892
|
return result;
|
|
@@ -2965,7 +2895,8 @@ function publicSearchIndexerToGeneratedSearchIndexer(indexer) {
|
|
|
2965
2895
|
return Object.assign(Object.assign({}, indexer), { encryptionKey: convertEncryptionKeyToGenerated(indexer.encryptionKey) });
|
|
2966
2896
|
}
|
|
2967
2897
|
function generatedSearchIndexerToPublicSearchIndexer(indexer) {
|
|
2968
|
-
|
|
2898
|
+
const props = tslib.__rest(indexer, ["encryptionKey"]);
|
|
2899
|
+
return Object.assign(Object.assign({}, props), { encryptionKey: convertEncryptionKeyToPublic(indexer.encryptionKey) });
|
|
2969
2900
|
}
|
|
2970
2901
|
function publicDataSourceToGeneratedDataSource(dataSource) {
|
|
2971
2902
|
return {
|
|
@@ -2973,13 +2904,13 @@ function publicDataSourceToGeneratedDataSource(dataSource) {
|
|
|
2973
2904
|
description: dataSource.description,
|
|
2974
2905
|
type: dataSource.type,
|
|
2975
2906
|
credentials: {
|
|
2976
|
-
connectionString: dataSource.connectionString
|
|
2907
|
+
connectionString: dataSource.connectionString,
|
|
2977
2908
|
},
|
|
2978
2909
|
container: dataSource.container,
|
|
2979
2910
|
etag: dataSource.etag,
|
|
2980
2911
|
dataChangeDetectionPolicy: dataSource.dataChangeDetectionPolicy,
|
|
2981
2912
|
dataDeletionDetectionPolicy: dataSource.dataDeletionDetectionPolicy,
|
|
2982
|
-
encryptionKey: convertEncryptionKeyToGenerated(dataSource.encryptionKey)
|
|
2913
|
+
encryptionKey: convertEncryptionKeyToGenerated(dataSource.encryptionKey),
|
|
2983
2914
|
};
|
|
2984
2915
|
}
|
|
2985
2916
|
function generatedDataSourceToPublicDataSource(dataSource) {
|
|
@@ -2992,7 +2923,7 @@ function generatedDataSourceToPublicDataSource(dataSource) {
|
|
|
2992
2923
|
etag: dataSource.etag,
|
|
2993
2924
|
dataChangeDetectionPolicy: convertDataChangeDetectionPolicyToPublic(dataSource.dataChangeDetectionPolicy),
|
|
2994
2925
|
dataDeletionDetectionPolicy: convertDataDeletionDetectionPolicyToPublic(dataSource.dataDeletionDetectionPolicy),
|
|
2995
|
-
encryptionKey: convertEncryptionKeyToPublic(dataSource.encryptionKey)
|
|
2926
|
+
encryptionKey: convertEncryptionKeyToPublic(dataSource.encryptionKey),
|
|
2996
2927
|
};
|
|
2997
2928
|
}
|
|
2998
2929
|
function convertDataChangeDetectionPolicyToPublic(dataChangeDetectionPolicy) {
|
|
@@ -3023,8 +2954,22 @@ function getRandomIntegerInclusive(min, max) {
|
|
|
3023
2954
|
const offset = Math.floor(Math.random() * (max - min + 1));
|
|
3024
2955
|
return offset + min;
|
|
3025
2956
|
}
|
|
2957
|
+
/**
|
|
2958
|
+
* A wrapper for setTimeout that resolves a promise after timeInMs milliseconds.
|
|
2959
|
+
* @param timeInMs - The number of milliseconds to be delayed.
|
|
2960
|
+
* @returns Promise that is resolved after timeInMs
|
|
2961
|
+
*/
|
|
2962
|
+
function delay(timeInMs) {
|
|
2963
|
+
return new Promise((resolve) => setTimeout(() => resolve(), timeInMs));
|
|
2964
|
+
}
|
|
2965
|
+
const defaultServiceVersion = "2020-06-30";
|
|
3026
2966
|
|
|
3027
2967
|
// Copyright (c) Microsoft Corporation.
|
|
2968
|
+
// Licensed under the MIT license.
|
|
2969
|
+
/**
|
|
2970
|
+
* Known values for Search Audience
|
|
2971
|
+
*/
|
|
2972
|
+
exports.KnownSearchAudience = void 0;
|
|
3028
2973
|
(function (KnownSearchAudience) {
|
|
3029
2974
|
/**
|
|
3030
2975
|
* Audience for Azure China
|
|
@@ -3040,13 +2985,17 @@ function getRandomIntegerInclusive(min, max) {
|
|
|
3040
2985
|
KnownSearchAudience["AzurePublicCloud"] = "https://search.azure.com";
|
|
3041
2986
|
})(exports.KnownSearchAudience || (exports.KnownSearchAudience = {}));
|
|
3042
2987
|
|
|
2988
|
+
// Copyright (c) Microsoft Corporation.
|
|
2989
|
+
// Licensed under the MIT license.
|
|
2990
|
+
const SDK_VERSION = "11.3.3";
|
|
2991
|
+
|
|
3043
2992
|
// Copyright (c) Microsoft Corporation.
|
|
3044
2993
|
/**
|
|
3045
2994
|
* Class used to perform operations against a search index,
|
|
3046
2995
|
* including querying documents in the index as well as
|
|
3047
2996
|
* adding, updating, and removing them.
|
|
3048
2997
|
*/
|
|
3049
|
-
class SearchClient
|
|
2998
|
+
class SearchClient {
|
|
3050
2999
|
/**
|
|
3051
3000
|
* Creates an instance of SearchClient.
|
|
3052
3001
|
*
|
|
@@ -3057,64 +3006,56 @@ class SearchClient$1 {
|
|
|
3057
3006
|
* const client = new SearchClient(
|
|
3058
3007
|
* "<endpoint>",
|
|
3059
3008
|
* "<indexName>",
|
|
3060
|
-
* new AzureKeyCredential("<Admin Key>")
|
|
3009
|
+
* new AzureKeyCredential("<Admin Key>")
|
|
3061
3010
|
* );
|
|
3062
3011
|
* ```
|
|
3063
3012
|
* @param endpoint - The endpoint of the search service
|
|
3064
3013
|
* @param indexName - The name of the index
|
|
3065
3014
|
* @param credential - Used to authenticate requests to the service.
|
|
3066
3015
|
* @param options - Used to configure the Search client.
|
|
3016
|
+
*
|
|
3017
|
+
* @typeParam TModel - An optional type that represents the documents stored in
|
|
3018
|
+
* the search index. For the best typing experience, all non-key fields should
|
|
3019
|
+
* be marked optional and nullable, and the key property should have the
|
|
3020
|
+
* non-nullable type `string`.
|
|
3067
3021
|
*/
|
|
3068
3022
|
constructor(endpoint, indexName, credential, options = {}) {
|
|
3069
|
-
|
|
3070
|
-
/// the ContinuationToken logic will need to be updated below.
|
|
3023
|
+
var _a, _b;
|
|
3071
3024
|
/**
|
|
3072
3025
|
* The API version to use when communicating with the service.
|
|
3073
3026
|
*/
|
|
3074
|
-
this.apiVersion =
|
|
3027
|
+
this.apiVersion = defaultServiceVersion;
|
|
3075
3028
|
this.endpoint = endpoint;
|
|
3076
3029
|
this.indexName = indexName;
|
|
3077
3030
|
const libInfo = `azsdk-js-search-documents/${SDK_VERSION}`;
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3031
|
+
const userAgentOptions = Object.assign(Object.assign({}, options.userAgentOptions), { userAgentPrefix: ((_a = options.userAgentOptions) === null || _a === void 0 ? void 0 : _a.userAgentPrefix)
|
|
3032
|
+
? `${options.userAgentOptions.userAgentPrefix} ${libInfo}`
|
|
3033
|
+
: libInfo });
|
|
3034
|
+
const loggingOptions = {
|
|
3035
|
+
logger: logger.info,
|
|
3036
|
+
additionalAllowedHeaderNames: [
|
|
3037
|
+
"elapsed-time",
|
|
3038
|
+
"Location",
|
|
3039
|
+
"OData-MaxVersion",
|
|
3040
|
+
"OData-Version",
|
|
3041
|
+
"Prefer",
|
|
3042
|
+
"throttle-reason",
|
|
3043
|
+
],
|
|
3044
|
+
};
|
|
3045
|
+
const internalClientPipelineOptions = Object.assign(Object.assign({}, options), { userAgentOptions,
|
|
3046
|
+
loggingOptions });
|
|
3047
|
+
this.apiVersion = (_b = options.apiVersion) !== null && _b !== void 0 ? _b : defaultServiceVersion;
|
|
3048
|
+
this.client = new SearchClient$1(this.endpoint, this.indexName, this.apiVersion, internalClientPipelineOptions);
|
|
3049
|
+
if (coreAuth.isTokenCredential(credential)) {
|
|
3050
|
+
const scope = options.audience
|
|
3051
|
+
? `${options.audience}/.default`
|
|
3052
|
+
: `${exports.KnownSearchAudience.AzurePublicCloud}/.default`;
|
|
3053
|
+
this.client.pipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({ credential, scopes: scope }));
|
|
3083
3054
|
}
|
|
3084
3055
|
else {
|
|
3085
|
-
|
|
3086
|
-
}
|
|
3087
|
-
const internalPipelineOptions = Object.assign(Object.assign({}, options), {
|
|
3088
|
-
loggingOptions: {
|
|
3089
|
-
logger: logger.info,
|
|
3090
|
-
allowedHeaderNames: [
|
|
3091
|
-
"elapsed-time",
|
|
3092
|
-
"Location",
|
|
3093
|
-
"OData-MaxVersion",
|
|
3094
|
-
"OData-Version",
|
|
3095
|
-
"Prefer",
|
|
3096
|
-
"throttle-reason"
|
|
3097
|
-
]
|
|
3098
|
-
}
|
|
3099
|
-
});
|
|
3100
|
-
const scope = options.audience
|
|
3101
|
-
? `${options.audience}/.default`
|
|
3102
|
-
: `${exports.KnownSearchAudience.AzurePublicCloud}/.default`;
|
|
3103
|
-
const requestPolicyFactory = coreAuth.isTokenCredential(credential)
|
|
3104
|
-
? coreHttp.bearerTokenAuthenticationPolicy(credential, scope)
|
|
3105
|
-
: createSearchApiKeyCredentialPolicy(credential);
|
|
3106
|
-
const pipeline = coreHttp.createPipelineFromOptions(internalPipelineOptions, requestPolicyFactory);
|
|
3107
|
-
if (Array.isArray(pipeline.requestPolicyFactories)) {
|
|
3108
|
-
pipeline.requestPolicyFactories.unshift(odataMetadataPolicy("none"));
|
|
3109
|
-
}
|
|
3110
|
-
let apiVersion = this.apiVersion;
|
|
3111
|
-
if (options.apiVersion) {
|
|
3112
|
-
if (!["2020-06-30-Preview", "2020-06-30"].includes(options.apiVersion)) {
|
|
3113
|
-
throw new Error(`Invalid Api Version: ${options.apiVersion}`);
|
|
3114
|
-
}
|
|
3115
|
-
apiVersion = options.apiVersion;
|
|
3056
|
+
this.client.pipeline.addPolicy(createSearchApiKeyCredentialPolicy(credential));
|
|
3116
3057
|
}
|
|
3117
|
-
this.client
|
|
3058
|
+
this.client.pipeline.addPolicy(createOdataMetadataPolicy("none"));
|
|
3118
3059
|
}
|
|
3119
3060
|
/**
|
|
3120
3061
|
* Retrieves the number of documents in the index.
|
|
@@ -3123,13 +3064,19 @@ class SearchClient$1 {
|
|
|
3123
3064
|
async getDocumentsCount(options = {}) {
|
|
3124
3065
|
const { span, updatedOptions } = createSpan("SearchClient-getDocumentsCount", options);
|
|
3125
3066
|
try {
|
|
3126
|
-
|
|
3127
|
-
|
|
3067
|
+
let documentsCount = 0;
|
|
3068
|
+
await this.client.documents.count(Object.assign(Object.assign({}, updatedOptions), { onResponse: (rawResponse, flatResponse) => {
|
|
3069
|
+
documentsCount = Number(rawResponse.bodyAsText);
|
|
3070
|
+
if (updatedOptions.onResponse) {
|
|
3071
|
+
updatedOptions.onResponse(rawResponse, flatResponse);
|
|
3072
|
+
}
|
|
3073
|
+
} }));
|
|
3074
|
+
return documentsCount;
|
|
3128
3075
|
}
|
|
3129
3076
|
catch (e) {
|
|
3130
3077
|
span.setStatus({
|
|
3131
|
-
|
|
3132
|
-
|
|
3078
|
+
status: "error",
|
|
3079
|
+
error: e.message,
|
|
3133
3080
|
});
|
|
3134
3081
|
throw e;
|
|
3135
3082
|
}
|
|
@@ -3145,8 +3092,7 @@ class SearchClient$1 {
|
|
|
3145
3092
|
* @param options - Options to the autocomplete operation.
|
|
3146
3093
|
*/
|
|
3147
3094
|
async autocomplete(searchText, suggesterName, options = {}) {
|
|
3148
|
-
const {
|
|
3149
|
-
const { searchFields } = restOptions, nonFieldOptions = tslib.__rest(restOptions, ["searchFields"]);
|
|
3095
|
+
const { searchFields } = options, nonFieldOptions = tslib.__rest(options, ["searchFields"]);
|
|
3150
3096
|
const fullOptions = Object.assign({ searchText: searchText, suggesterName: suggesterName, searchFields: this.convertSearchFields(searchFields) }, nonFieldOptions);
|
|
3151
3097
|
if (!fullOptions.searchText) {
|
|
3152
3098
|
throw new RangeError("searchText must be provided.");
|
|
@@ -3154,15 +3100,15 @@ class SearchClient$1 {
|
|
|
3154
3100
|
if (!fullOptions.suggesterName) {
|
|
3155
3101
|
throw new RangeError("suggesterName must be provided.");
|
|
3156
3102
|
}
|
|
3157
|
-
const { span, updatedOptions } = createSpan("SearchClient-autocomplete",
|
|
3103
|
+
const { span, updatedOptions } = createSpan("SearchClient-autocomplete", options);
|
|
3158
3104
|
try {
|
|
3159
|
-
const result = await this.client.documents.autocompletePost(fullOptions,
|
|
3105
|
+
const result = await this.client.documents.autocompletePost(fullOptions, updatedOptions);
|
|
3160
3106
|
return result;
|
|
3161
3107
|
}
|
|
3162
3108
|
catch (e) {
|
|
3163
3109
|
span.setStatus({
|
|
3164
|
-
|
|
3165
|
-
|
|
3110
|
+
status: "error",
|
|
3111
|
+
error: e.message,
|
|
3166
3112
|
});
|
|
3167
3113
|
throw e;
|
|
3168
3114
|
}
|
|
@@ -3171,27 +3117,20 @@ class SearchClient$1 {
|
|
|
3171
3117
|
}
|
|
3172
3118
|
}
|
|
3173
3119
|
async searchDocuments(searchText, options = {}, nextPageParameters = {}) {
|
|
3174
|
-
const {
|
|
3175
|
-
const
|
|
3176
|
-
const
|
|
3177
|
-
const { span, updatedOptions } = createSpan("SearchClient-searchDocuments", operationOptions);
|
|
3120
|
+
const { searchFields, select, orderBy, includeTotalCount } = options, restOptions = tslib.__rest(options, ["searchFields", "select", "orderBy", "includeTotalCount"]);
|
|
3121
|
+
const fullOptions = Object.assign(Object.assign(Object.assign({}, restOptions), nextPageParameters), { searchFields: this.convertSearchFields(searchFields), select: this.convertSelect(select) || "*", orderBy: this.convertOrderBy(orderBy), includeTotalResultCount: includeTotalCount });
|
|
3122
|
+
const { span, updatedOptions } = createSpan("SearchClient-searchDocuments", options);
|
|
3178
3123
|
try {
|
|
3179
|
-
const result = await this.client.documents.searchPost(Object.assign(Object.assign({}, fullOptions), {
|
|
3180
|
-
const { results,
|
|
3124
|
+
const result = await this.client.documents.searchPost(Object.assign(Object.assign({}, fullOptions), { searchText: searchText }), updatedOptions);
|
|
3125
|
+
const { results, nextLink, nextPageParameters: resultNextPageParameters } = result, restResult = tslib.__rest(result, ["results", "nextLink", "nextPageParameters"]);
|
|
3181
3126
|
const modifiedResults = generatedSearchResultToPublicSearchResult(results);
|
|
3182
|
-
const converted = {
|
|
3183
|
-
results: modifiedResults,
|
|
3184
|
-
count,
|
|
3185
|
-
coverage,
|
|
3186
|
-
facets,
|
|
3187
|
-
continuationToken: this.encodeContinuationToken(nextLink, result.nextPageParameters)
|
|
3188
|
-
};
|
|
3127
|
+
const converted = Object.assign(Object.assign({}, restResult), { results: modifiedResults, continuationToken: this.encodeContinuationToken(nextLink, resultNextPageParameters) });
|
|
3189
3128
|
return deserialize(converted);
|
|
3190
3129
|
}
|
|
3191
3130
|
catch (e) {
|
|
3192
3131
|
span.setStatus({
|
|
3193
|
-
|
|
3194
|
-
|
|
3132
|
+
status: "error",
|
|
3133
|
+
error: e.message,
|
|
3195
3134
|
});
|
|
3196
3135
|
throw e;
|
|
3197
3136
|
}
|
|
@@ -3215,21 +3154,28 @@ class SearchClient$1 {
|
|
|
3215
3154
|
}
|
|
3216
3155
|
listSearchResultsAll(firstPage, searchText, options = {}) {
|
|
3217
3156
|
return tslib.__asyncGenerator(this, arguments, function* listSearchResultsAll_1() {
|
|
3218
|
-
var e_1,
|
|
3157
|
+
var _a, e_1, _b, _c;
|
|
3219
3158
|
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(firstPage.results)));
|
|
3220
3159
|
if (firstPage.continuationToken) {
|
|
3221
3160
|
try {
|
|
3222
|
-
for (var
|
|
3223
|
-
continuationToken: firstPage.continuationToken
|
|
3224
|
-
})),
|
|
3225
|
-
|
|
3226
|
-
|
|
3161
|
+
for (var _d = true, _e = tslib.__asyncValues(this.listSearchResultsPage(searchText, options, {
|
|
3162
|
+
continuationToken: firstPage.continuationToken,
|
|
3163
|
+
})), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
|
|
3164
|
+
_c = _f.value;
|
|
3165
|
+
_d = false;
|
|
3166
|
+
try {
|
|
3167
|
+
const page = _c;
|
|
3168
|
+
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page.results)));
|
|
3169
|
+
}
|
|
3170
|
+
finally {
|
|
3171
|
+
_d = true;
|
|
3172
|
+
}
|
|
3227
3173
|
}
|
|
3228
3174
|
}
|
|
3229
3175
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
3230
3176
|
finally {
|
|
3231
3177
|
try {
|
|
3232
|
-
if (
|
|
3178
|
+
if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
|
|
3233
3179
|
}
|
|
3234
3180
|
finally { if (e_1) throw e_1.error; }
|
|
3235
3181
|
}
|
|
@@ -3247,7 +3193,7 @@ class SearchClient$1 {
|
|
|
3247
3193
|
},
|
|
3248
3194
|
byPage: (settings = {}) => {
|
|
3249
3195
|
return this.listSearchResultsPage(searchText, options, settings);
|
|
3250
|
-
}
|
|
3196
|
+
},
|
|
3251
3197
|
};
|
|
3252
3198
|
}
|
|
3253
3199
|
/**
|
|
@@ -3260,18 +3206,12 @@ class SearchClient$1 {
|
|
|
3260
3206
|
const { span, updatedOptions } = createSpan("SearchClient-search", options);
|
|
3261
3207
|
try {
|
|
3262
3208
|
const pageResult = await this.searchDocuments(searchText, updatedOptions);
|
|
3263
|
-
|
|
3264
|
-
return {
|
|
3265
|
-
count,
|
|
3266
|
-
coverage,
|
|
3267
|
-
facets,
|
|
3268
|
-
results: this.listSearchResults(pageResult, searchText, updatedOptions)
|
|
3269
|
-
};
|
|
3209
|
+
return Object.assign(Object.assign({}, pageResult), { results: this.listSearchResults(pageResult, searchText, updatedOptions) });
|
|
3270
3210
|
}
|
|
3271
3211
|
catch (e) {
|
|
3272
3212
|
span.setStatus({
|
|
3273
|
-
|
|
3274
|
-
|
|
3213
|
+
status: "error",
|
|
3214
|
+
error: e.message,
|
|
3275
3215
|
});
|
|
3276
3216
|
throw e;
|
|
3277
3217
|
}
|
|
@@ -3287,25 +3227,24 @@ class SearchClient$1 {
|
|
|
3287
3227
|
* @param options - Options for the suggest operation
|
|
3288
3228
|
*/
|
|
3289
3229
|
async suggest(searchText, suggesterName, options = {}) {
|
|
3290
|
-
const {
|
|
3291
|
-
const {
|
|
3292
|
-
const fullOptions = Object.assign({ searchText: searchText, suggesterName: suggesterName, searchFields: this.convertSearchFields(searchFields), select: this.convertSelect(select), orderBy: this.convertOrderBy(orderBy) }, nonFieldOptions);
|
|
3230
|
+
const { select, searchFields, orderBy } = options, nonFieldOptions = tslib.__rest(options, ["select", "searchFields", "orderBy"]);
|
|
3231
|
+
const fullOptions = Object.assign({ searchText: searchText, suggesterName: suggesterName, select: this.convertSelect(select), searchFields: this.convertSearchFields(searchFields), orderBy: this.convertOrderBy(orderBy) }, nonFieldOptions);
|
|
3293
3232
|
if (!fullOptions.searchText) {
|
|
3294
3233
|
throw new RangeError("searchText must be provided.");
|
|
3295
3234
|
}
|
|
3296
3235
|
if (!fullOptions.suggesterName) {
|
|
3297
3236
|
throw new RangeError("suggesterName must be provided.");
|
|
3298
3237
|
}
|
|
3299
|
-
const { span, updatedOptions } = createSpan("SearchClient-suggest",
|
|
3238
|
+
const { span, updatedOptions } = createSpan("SearchClient-suggest", options);
|
|
3300
3239
|
try {
|
|
3301
|
-
const result = await this.client.documents.suggestPost(fullOptions,
|
|
3240
|
+
const result = await this.client.documents.suggestPost(fullOptions, updatedOptions);
|
|
3302
3241
|
const modifiedResult = generatedSuggestDocumentsResultToPublicSuggestDocumentsResult(result);
|
|
3303
3242
|
return deserialize(modifiedResult);
|
|
3304
3243
|
}
|
|
3305
3244
|
catch (e) {
|
|
3306
3245
|
span.setStatus({
|
|
3307
|
-
|
|
3308
|
-
|
|
3246
|
+
status: "error",
|
|
3247
|
+
error: e.message,
|
|
3309
3248
|
});
|
|
3310
3249
|
throw e;
|
|
3311
3250
|
}
|
|
@@ -3321,13 +3260,13 @@ class SearchClient$1 {
|
|
|
3321
3260
|
async getDocument(key, options = {}) {
|
|
3322
3261
|
const { span, updatedOptions } = createSpan("SearchClient-getDocument", options);
|
|
3323
3262
|
try {
|
|
3324
|
-
const result = await this.client.documents.get(key,
|
|
3325
|
-
return deserialize(result
|
|
3263
|
+
const result = await this.client.documents.get(key, updatedOptions);
|
|
3264
|
+
return deserialize(result);
|
|
3326
3265
|
}
|
|
3327
3266
|
catch (e) {
|
|
3328
3267
|
span.setStatus({
|
|
3329
|
-
|
|
3330
|
-
|
|
3268
|
+
status: "error",
|
|
3269
|
+
error: e.message,
|
|
3331
3270
|
});
|
|
3332
3271
|
throw e;
|
|
3333
3272
|
}
|
|
@@ -3350,16 +3289,22 @@ class SearchClient$1 {
|
|
|
3350
3289
|
batch, options = {}) {
|
|
3351
3290
|
const { span, updatedOptions } = createSpan("SearchClient-indexDocuments", options);
|
|
3352
3291
|
try {
|
|
3353
|
-
|
|
3354
|
-
|
|
3292
|
+
let status = 0;
|
|
3293
|
+
const result = await this.client.documents.index({ actions: serialize(batch.actions) }, Object.assign(Object.assign({}, updatedOptions), { onResponse: (rawResponse, flatResponse) => {
|
|
3294
|
+
status = rawResponse.status;
|
|
3295
|
+
if (updatedOptions.onResponse) {
|
|
3296
|
+
updatedOptions.onResponse(rawResponse, flatResponse);
|
|
3297
|
+
}
|
|
3298
|
+
} }));
|
|
3299
|
+
if (options.throwOnAnyFailure && status === 207) {
|
|
3355
3300
|
throw result;
|
|
3356
3301
|
}
|
|
3357
3302
|
return result;
|
|
3358
3303
|
}
|
|
3359
3304
|
catch (e) {
|
|
3360
3305
|
span.setStatus({
|
|
3361
|
-
|
|
3362
|
-
|
|
3306
|
+
status: "error",
|
|
3307
|
+
error: e.message,
|
|
3363
3308
|
});
|
|
3364
3309
|
throw e;
|
|
3365
3310
|
}
|
|
@@ -3381,8 +3326,8 @@ class SearchClient$1 {
|
|
|
3381
3326
|
}
|
|
3382
3327
|
catch (e) {
|
|
3383
3328
|
span.setStatus({
|
|
3384
|
-
|
|
3385
|
-
|
|
3329
|
+
status: "error",
|
|
3330
|
+
error: e.message,
|
|
3386
3331
|
});
|
|
3387
3332
|
throw e;
|
|
3388
3333
|
}
|
|
@@ -3405,8 +3350,8 @@ class SearchClient$1 {
|
|
|
3405
3350
|
}
|
|
3406
3351
|
catch (e) {
|
|
3407
3352
|
span.setStatus({
|
|
3408
|
-
|
|
3409
|
-
|
|
3353
|
+
status: "error",
|
|
3354
|
+
error: e.message,
|
|
3410
3355
|
});
|
|
3411
3356
|
throw e;
|
|
3412
3357
|
}
|
|
@@ -3429,8 +3374,8 @@ class SearchClient$1 {
|
|
|
3429
3374
|
}
|
|
3430
3375
|
catch (e) {
|
|
3431
3376
|
span.setStatus({
|
|
3432
|
-
|
|
3433
|
-
|
|
3377
|
+
status: "error",
|
|
3378
|
+
error: e.message,
|
|
3434
3379
|
});
|
|
3435
3380
|
throw e;
|
|
3436
3381
|
}
|
|
@@ -3452,8 +3397,8 @@ class SearchClient$1 {
|
|
|
3452
3397
|
}
|
|
3453
3398
|
catch (e) {
|
|
3454
3399
|
span.setStatus({
|
|
3455
|
-
|
|
3456
|
-
|
|
3400
|
+
status: "error",
|
|
3401
|
+
error: e.message,
|
|
3457
3402
|
});
|
|
3458
3403
|
throw e;
|
|
3459
3404
|
}
|
|
@@ -3468,7 +3413,7 @@ class SearchClient$1 {
|
|
|
3468
3413
|
const payload = JSON.stringify({
|
|
3469
3414
|
apiVersion: this.apiVersion,
|
|
3470
3415
|
nextLink,
|
|
3471
|
-
nextPageParameters
|
|
3416
|
+
nextPageParameters,
|
|
3472
3417
|
});
|
|
3473
3418
|
return encode(payload);
|
|
3474
3419
|
}
|
|
@@ -3484,25 +3429,13 @@ class SearchClient$1 {
|
|
|
3484
3429
|
}
|
|
3485
3430
|
return {
|
|
3486
3431
|
nextLink: result.nextLink,
|
|
3487
|
-
nextPageParameters: result.nextPageParameters
|
|
3432
|
+
nextPageParameters: result.nextPageParameters,
|
|
3488
3433
|
};
|
|
3489
3434
|
}
|
|
3490
3435
|
catch (e) {
|
|
3491
3436
|
throw new Error(`Corrupted or invalid continuation token: ${decodedToken}`);
|
|
3492
3437
|
}
|
|
3493
3438
|
}
|
|
3494
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
3495
|
-
extractOperationOptions(obj) {
|
|
3496
|
-
const { abortSignal, requestOptions, tracingOptions } = obj, restOptions = tslib.__rest(obj, ["abortSignal", "requestOptions", "tracingOptions"]);
|
|
3497
|
-
return {
|
|
3498
|
-
operationOptions: {
|
|
3499
|
-
abortSignal,
|
|
3500
|
-
requestOptions,
|
|
3501
|
-
tracingOptions
|
|
3502
|
-
},
|
|
3503
|
-
restOptions
|
|
3504
|
-
};
|
|
3505
|
-
}
|
|
3506
3439
|
convertSelect(select) {
|
|
3507
3440
|
if (select) {
|
|
3508
3441
|
return select.join(",");
|
|
@@ -3557,7 +3490,7 @@ class SearchIndexingBufferedSender {
|
|
|
3557
3490
|
/**
|
|
3558
3491
|
* Event emitter/publisher used in the Buffered Sender
|
|
3559
3492
|
*/
|
|
3560
|
-
this.emitter = new
|
|
3493
|
+
this.emitter = new EventEmitter__default["default"]();
|
|
3561
3494
|
this.client = client;
|
|
3562
3495
|
this.documentKeyRetriever = documentKeyRetriever;
|
|
3563
3496
|
// General Configuration properties
|
|
@@ -3589,14 +3522,14 @@ class SearchIndexingBufferedSender {
|
|
|
3589
3522
|
this.batchObject.upload(documents);
|
|
3590
3523
|
this.emitter.emit("batchAdded", {
|
|
3591
3524
|
action: "upload",
|
|
3592
|
-
documents
|
|
3525
|
+
documents,
|
|
3593
3526
|
});
|
|
3594
3527
|
return this.internalFlush(false, updatedOptions);
|
|
3595
3528
|
}
|
|
3596
3529
|
catch (e) {
|
|
3597
3530
|
span.setStatus({
|
|
3598
|
-
|
|
3599
|
-
|
|
3531
|
+
status: "error",
|
|
3532
|
+
error: e.message,
|
|
3600
3533
|
});
|
|
3601
3534
|
throw e;
|
|
3602
3535
|
}
|
|
@@ -3616,14 +3549,14 @@ class SearchIndexingBufferedSender {
|
|
|
3616
3549
|
this.batchObject.merge(documents);
|
|
3617
3550
|
this.emitter.emit("batchAdded", {
|
|
3618
3551
|
action: "merge",
|
|
3619
|
-
documents
|
|
3552
|
+
documents,
|
|
3620
3553
|
});
|
|
3621
3554
|
return this.internalFlush(false, updatedOptions);
|
|
3622
3555
|
}
|
|
3623
3556
|
catch (e) {
|
|
3624
3557
|
span.setStatus({
|
|
3625
|
-
|
|
3626
|
-
|
|
3558
|
+
status: "error",
|
|
3559
|
+
error: e.message,
|
|
3627
3560
|
});
|
|
3628
3561
|
throw e;
|
|
3629
3562
|
}
|
|
@@ -3643,14 +3576,14 @@ class SearchIndexingBufferedSender {
|
|
|
3643
3576
|
this.batchObject.mergeOrUpload(documents);
|
|
3644
3577
|
this.emitter.emit("batchAdded", {
|
|
3645
3578
|
action: "mergeOrUpload",
|
|
3646
|
-
documents
|
|
3579
|
+
documents,
|
|
3647
3580
|
});
|
|
3648
3581
|
return this.internalFlush(false, updatedOptions);
|
|
3649
3582
|
}
|
|
3650
3583
|
catch (e) {
|
|
3651
3584
|
span.setStatus({
|
|
3652
|
-
|
|
3653
|
-
|
|
3585
|
+
status: "error",
|
|
3586
|
+
error: e.message,
|
|
3654
3587
|
});
|
|
3655
3588
|
throw e;
|
|
3656
3589
|
}
|
|
@@ -3670,14 +3603,14 @@ class SearchIndexingBufferedSender {
|
|
|
3670
3603
|
this.batchObject.delete(documents);
|
|
3671
3604
|
this.emitter.emit("batchAdded", {
|
|
3672
3605
|
action: "delete",
|
|
3673
|
-
documents
|
|
3606
|
+
documents,
|
|
3674
3607
|
});
|
|
3675
3608
|
return this.internalFlush(false, updatedOptions);
|
|
3676
3609
|
}
|
|
3677
3610
|
catch (e) {
|
|
3678
3611
|
span.setStatus({
|
|
3679
|
-
|
|
3680
|
-
|
|
3612
|
+
status: "error",
|
|
3613
|
+
error: e.message,
|
|
3681
3614
|
});
|
|
3682
3615
|
throw e;
|
|
3683
3616
|
}
|
|
@@ -3699,8 +3632,8 @@ class SearchIndexingBufferedSender {
|
|
|
3699
3632
|
}
|
|
3700
3633
|
catch (e) {
|
|
3701
3634
|
span.setStatus({
|
|
3702
|
-
|
|
3703
|
-
|
|
3635
|
+
status: "error",
|
|
3636
|
+
error: e.message,
|
|
3704
3637
|
});
|
|
3705
3638
|
throw e;
|
|
3706
3639
|
}
|
|
@@ -3771,7 +3704,7 @@ class SearchIndexingBufferedSender {
|
|
|
3771
3704
|
// Cut the payload size to half
|
|
3772
3705
|
const splitActionsArray = [
|
|
3773
3706
|
actionsToSend.slice(0, actionsToSend.length / 2),
|
|
3774
|
-
actionsToSend.slice(actionsToSend.length / 2, actionsToSend.length)
|
|
3707
|
+
actionsToSend.slice(actionsToSend.length / 2, actionsToSend.length),
|
|
3775
3708
|
];
|
|
3776
3709
|
this.initialBatchActionCount = splitActionsArray[0].length; // So, we do not want 413 happening again and again
|
|
3777
3710
|
for (const actions of splitActionsArray) {
|
|
@@ -3786,7 +3719,7 @@ class SearchIndexingBufferedSender {
|
|
|
3786
3719
|
// Allow the final value to have some "jitter" (within 50% of the delay size) so
|
|
3787
3720
|
// that retries across multiple clients don't occur simultaneously.
|
|
3788
3721
|
const delayWithJitter = clampedExponentialDelay / 2 + getRandomIntegerInclusive(0, clampedExponentialDelay / 2);
|
|
3789
|
-
await
|
|
3722
|
+
await delay(delayWithJitter);
|
|
3790
3723
|
await this.submitDocuments(actionsToSend, options, retryAttempt + 1);
|
|
3791
3724
|
}
|
|
3792
3725
|
else {
|
|
@@ -4008,7 +3941,7 @@ const AzureActiveDirectoryApplicationCredentials = {
|
|
|
4008
3941
|
}
|
|
4009
3942
|
}
|
|
4010
3943
|
};
|
|
4011
|
-
const SearchError
|
|
3944
|
+
const SearchError = {
|
|
4012
3945
|
type: {
|
|
4013
3946
|
name: "Composite",
|
|
4014
3947
|
className: "SearchError",
|
|
@@ -8197,7 +8130,7 @@ let discriminators = {
|
|
|
8197
8130
|
"Similarity.#Microsoft.Azure.Search.BM25Similarity": BM25Similarity
|
|
8198
8131
|
};
|
|
8199
8132
|
|
|
8200
|
-
var Mappers
|
|
8133
|
+
var Mappers = /*#__PURE__*/Object.freeze({
|
|
8201
8134
|
__proto__: null,
|
|
8202
8135
|
SearchIndexerDataSource: SearchIndexerDataSource,
|
|
8203
8136
|
DataSourceCredentials: DataSourceCredentials,
|
|
@@ -8206,7 +8139,7 @@ var Mappers$1 = /*#__PURE__*/Object.freeze({
|
|
|
8206
8139
|
DataDeletionDetectionPolicy: DataDeletionDetectionPolicy,
|
|
8207
8140
|
SearchResourceEncryptionKey: SearchResourceEncryptionKey,
|
|
8208
8141
|
AzureActiveDirectoryApplicationCredentials: AzureActiveDirectoryApplicationCredentials,
|
|
8209
|
-
SearchError: SearchError
|
|
8142
|
+
SearchError: SearchError,
|
|
8210
8143
|
ListDataSourcesResult: ListDataSourcesResult,
|
|
8211
8144
|
SearchIndexer: SearchIndexer,
|
|
8212
8145
|
IndexingSchedule: IndexingSchedule,
|
|
@@ -8340,7 +8273,7 @@ var Mappers$1 = /*#__PURE__*/Object.freeze({
|
|
|
8340
8273
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
8341
8274
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
8342
8275
|
*/
|
|
8343
|
-
const contentType
|
|
8276
|
+
const contentType = {
|
|
8344
8277
|
parameterPath: ["options", "contentType"],
|
|
8345
8278
|
mapper: {
|
|
8346
8279
|
defaultValue: "application/json",
|
|
@@ -8355,7 +8288,7 @@ const dataSource = {
|
|
|
8355
8288
|
parameterPath: "dataSource",
|
|
8356
8289
|
mapper: SearchIndexerDataSource
|
|
8357
8290
|
};
|
|
8358
|
-
const accept
|
|
8291
|
+
const accept = {
|
|
8359
8292
|
parameterPath: "accept",
|
|
8360
8293
|
mapper: {
|
|
8361
8294
|
defaultValue: "application/json",
|
|
@@ -8366,7 +8299,7 @@ const accept$1 = {
|
|
|
8366
8299
|
}
|
|
8367
8300
|
}
|
|
8368
8301
|
};
|
|
8369
|
-
const endpoint
|
|
8302
|
+
const endpoint = {
|
|
8370
8303
|
parameterPath: "endpoint",
|
|
8371
8304
|
mapper: {
|
|
8372
8305
|
serializedName: "endpoint",
|
|
@@ -8387,15 +8320,6 @@ const dataSourceName = {
|
|
|
8387
8320
|
}
|
|
8388
8321
|
}
|
|
8389
8322
|
};
|
|
8390
|
-
const xMsClientRequestId$1 = {
|
|
8391
|
-
parameterPath: ["options", "requestOptionsParam", "xMsClientRequestId"],
|
|
8392
|
-
mapper: {
|
|
8393
|
-
serializedName: "x-ms-client-request-id",
|
|
8394
|
-
type: {
|
|
8395
|
-
name: "Uuid"
|
|
8396
|
-
}
|
|
8397
|
-
}
|
|
8398
|
-
};
|
|
8399
8323
|
const ifMatch = {
|
|
8400
8324
|
parameterPath: ["options", "ifMatch"],
|
|
8401
8325
|
mapper: {
|
|
@@ -8425,7 +8349,7 @@ const prefer = {
|
|
|
8425
8349
|
}
|
|
8426
8350
|
}
|
|
8427
8351
|
};
|
|
8428
|
-
const apiVersion
|
|
8352
|
+
const apiVersion = {
|
|
8429
8353
|
parameterPath: "apiVersion",
|
|
8430
8354
|
mapper: {
|
|
8431
8355
|
serializedName: "api-version",
|
|
@@ -8435,7 +8359,7 @@ const apiVersion$1 = {
|
|
|
8435
8359
|
}
|
|
8436
8360
|
}
|
|
8437
8361
|
};
|
|
8438
|
-
const select
|
|
8362
|
+
const select = {
|
|
8439
8363
|
parameterPath: ["options", "select"],
|
|
8440
8364
|
mapper: {
|
|
8441
8365
|
serializedName: "$select",
|
|
@@ -8490,7 +8414,7 @@ const index = {
|
|
|
8490
8414
|
parameterPath: "index",
|
|
8491
8415
|
mapper: SearchIndex
|
|
8492
8416
|
};
|
|
8493
|
-
const indexName
|
|
8417
|
+
const indexName = {
|
|
8494
8418
|
parameterPath: "indexName",
|
|
8495
8419
|
mapper: {
|
|
8496
8420
|
serializedName: "indexName",
|
|
@@ -8522,7 +8446,7 @@ const request = {
|
|
|
8522
8446
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
8523
8447
|
*/
|
|
8524
8448
|
/** Class representing a DataSources. */
|
|
8525
|
-
class
|
|
8449
|
+
class DataSourcesImpl {
|
|
8526
8450
|
/**
|
|
8527
8451
|
* Initialize a new instance of the class DataSources class.
|
|
8528
8452
|
* @param client Reference to the service client
|
|
@@ -8537,12 +8461,7 @@ class DataSources {
|
|
|
8537
8461
|
* @param options The options parameters.
|
|
8538
8462
|
*/
|
|
8539
8463
|
createOrUpdate(dataSourceName, dataSource, options) {
|
|
8540
|
-
|
|
8541
|
-
dataSourceName,
|
|
8542
|
-
dataSource,
|
|
8543
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
8544
|
-
};
|
|
8545
|
-
return this.client.sendOperationRequest(operationArguments, createOrUpdateOperationSpec);
|
|
8464
|
+
return this.client.sendOperationRequest({ dataSourceName, dataSource, options }, createOrUpdateOperationSpec$4);
|
|
8546
8465
|
}
|
|
8547
8466
|
/**
|
|
8548
8467
|
* Deletes a datasource.
|
|
@@ -8550,11 +8469,7 @@ class DataSources {
|
|
|
8550
8469
|
* @param options The options parameters.
|
|
8551
8470
|
*/
|
|
8552
8471
|
delete(dataSourceName, options) {
|
|
8553
|
-
|
|
8554
|
-
dataSourceName,
|
|
8555
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
8556
|
-
};
|
|
8557
|
-
return this.client.sendOperationRequest(operationArguments, deleteOperationSpec);
|
|
8472
|
+
return this.client.sendOperationRequest({ dataSourceName, options }, deleteOperationSpec$4);
|
|
8558
8473
|
}
|
|
8559
8474
|
/**
|
|
8560
8475
|
* Retrieves a datasource definition.
|
|
@@ -8562,21 +8477,14 @@ class DataSources {
|
|
|
8562
8477
|
* @param options The options parameters.
|
|
8563
8478
|
*/
|
|
8564
8479
|
get(dataSourceName, options) {
|
|
8565
|
-
|
|
8566
|
-
dataSourceName,
|
|
8567
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
8568
|
-
};
|
|
8569
|
-
return this.client.sendOperationRequest(operationArguments, getOperationSpec$1);
|
|
8480
|
+
return this.client.sendOperationRequest({ dataSourceName, options }, getOperationSpec$4);
|
|
8570
8481
|
}
|
|
8571
8482
|
/**
|
|
8572
8483
|
* Lists all datasources available for a search service.
|
|
8573
8484
|
* @param options The options parameters.
|
|
8574
8485
|
*/
|
|
8575
8486
|
list(options) {
|
|
8576
|
-
|
|
8577
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
8578
|
-
};
|
|
8579
|
-
return this.client.sendOperationRequest(operationArguments, listOperationSpec);
|
|
8487
|
+
return this.client.sendOperationRequest({ options }, listOperationSpec$4);
|
|
8580
8488
|
}
|
|
8581
8489
|
/**
|
|
8582
8490
|
* Creates a new datasource.
|
|
@@ -8584,16 +8492,12 @@ class DataSources {
|
|
|
8584
8492
|
* @param options The options parameters.
|
|
8585
8493
|
*/
|
|
8586
8494
|
create(dataSource, options) {
|
|
8587
|
-
|
|
8588
|
-
dataSource,
|
|
8589
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
8590
|
-
};
|
|
8591
|
-
return this.client.sendOperationRequest(operationArguments, createOperationSpec);
|
|
8495
|
+
return this.client.sendOperationRequest({ dataSource, options }, createOperationSpec$4);
|
|
8592
8496
|
}
|
|
8593
8497
|
}
|
|
8594
8498
|
// Operation Specifications
|
|
8595
|
-
const serializer$
|
|
8596
|
-
const createOrUpdateOperationSpec = {
|
|
8499
|
+
const serializer$5 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
|
|
8500
|
+
const createOrUpdateOperationSpec$4 = {
|
|
8597
8501
|
path: "/datasources('{dataSourceName}')",
|
|
8598
8502
|
httpMethod: "PUT",
|
|
8599
8503
|
responses: {
|
|
@@ -8604,44 +8508,42 @@ const createOrUpdateOperationSpec = {
|
|
|
8604
8508
|
bodyMapper: SearchIndexerDataSource
|
|
8605
8509
|
},
|
|
8606
8510
|
default: {
|
|
8607
|
-
bodyMapper: SearchError
|
|
8511
|
+
bodyMapper: SearchError
|
|
8608
8512
|
}
|
|
8609
8513
|
},
|
|
8610
8514
|
requestBody: dataSource,
|
|
8611
|
-
queryParameters: [apiVersion
|
|
8612
|
-
urlParameters: [endpoint
|
|
8515
|
+
queryParameters: [apiVersion],
|
|
8516
|
+
urlParameters: [endpoint, dataSourceName],
|
|
8613
8517
|
headerParameters: [
|
|
8614
|
-
contentType
|
|
8615
|
-
accept
|
|
8616
|
-
xMsClientRequestId$1,
|
|
8518
|
+
contentType,
|
|
8519
|
+
accept,
|
|
8617
8520
|
ifMatch,
|
|
8618
8521
|
ifNoneMatch,
|
|
8619
8522
|
prefer
|
|
8620
8523
|
],
|
|
8621
8524
|
mediaType: "json",
|
|
8622
|
-
serializer: serializer$
|
|
8525
|
+
serializer: serializer$5
|
|
8623
8526
|
};
|
|
8624
|
-
const deleteOperationSpec = {
|
|
8527
|
+
const deleteOperationSpec$4 = {
|
|
8625
8528
|
path: "/datasources('{dataSourceName}')",
|
|
8626
8529
|
httpMethod: "DELETE",
|
|
8627
8530
|
responses: {
|
|
8628
8531
|
204: {},
|
|
8629
8532
|
404: {},
|
|
8630
8533
|
default: {
|
|
8631
|
-
bodyMapper: SearchError
|
|
8534
|
+
bodyMapper: SearchError
|
|
8632
8535
|
}
|
|
8633
8536
|
},
|
|
8634
|
-
queryParameters: [apiVersion
|
|
8635
|
-
urlParameters: [endpoint
|
|
8537
|
+
queryParameters: [apiVersion],
|
|
8538
|
+
urlParameters: [endpoint, dataSourceName],
|
|
8636
8539
|
headerParameters: [
|
|
8637
|
-
accept
|
|
8638
|
-
xMsClientRequestId$1,
|
|
8540
|
+
accept,
|
|
8639
8541
|
ifMatch,
|
|
8640
8542
|
ifNoneMatch
|
|
8641
8543
|
],
|
|
8642
|
-
serializer: serializer$
|
|
8544
|
+
serializer: serializer$5
|
|
8643
8545
|
};
|
|
8644
|
-
const getOperationSpec$
|
|
8546
|
+
const getOperationSpec$4 = {
|
|
8645
8547
|
path: "/datasources('{dataSourceName}')",
|
|
8646
8548
|
httpMethod: "GET",
|
|
8647
8549
|
responses: {
|
|
@@ -8649,15 +8551,15 @@ const getOperationSpec$1 = {
|
|
|
8649
8551
|
bodyMapper: SearchIndexerDataSource
|
|
8650
8552
|
},
|
|
8651
8553
|
default: {
|
|
8652
|
-
bodyMapper: SearchError
|
|
8554
|
+
bodyMapper: SearchError
|
|
8653
8555
|
}
|
|
8654
8556
|
},
|
|
8655
|
-
queryParameters: [apiVersion
|
|
8656
|
-
urlParameters: [endpoint
|
|
8657
|
-
headerParameters: [accept
|
|
8658
|
-
serializer: serializer$
|
|
8659
|
-
};
|
|
8660
|
-
const listOperationSpec = {
|
|
8557
|
+
queryParameters: [apiVersion],
|
|
8558
|
+
urlParameters: [endpoint, dataSourceName],
|
|
8559
|
+
headerParameters: [accept],
|
|
8560
|
+
serializer: serializer$5
|
|
8561
|
+
};
|
|
8562
|
+
const listOperationSpec$4 = {
|
|
8661
8563
|
path: "/datasources",
|
|
8662
8564
|
httpMethod: "GET",
|
|
8663
8565
|
responses: {
|
|
@@ -8665,15 +8567,15 @@ const listOperationSpec = {
|
|
|
8665
8567
|
bodyMapper: ListDataSourcesResult
|
|
8666
8568
|
},
|
|
8667
8569
|
default: {
|
|
8668
|
-
bodyMapper: SearchError
|
|
8570
|
+
bodyMapper: SearchError
|
|
8669
8571
|
}
|
|
8670
8572
|
},
|
|
8671
|
-
queryParameters: [apiVersion
|
|
8672
|
-
urlParameters: [endpoint
|
|
8673
|
-
headerParameters: [accept
|
|
8674
|
-
serializer: serializer$
|
|
8573
|
+
queryParameters: [apiVersion, select],
|
|
8574
|
+
urlParameters: [endpoint],
|
|
8575
|
+
headerParameters: [accept],
|
|
8576
|
+
serializer: serializer$5
|
|
8675
8577
|
};
|
|
8676
|
-
const createOperationSpec = {
|
|
8578
|
+
const createOperationSpec$4 = {
|
|
8677
8579
|
path: "/datasources",
|
|
8678
8580
|
httpMethod: "POST",
|
|
8679
8581
|
responses: {
|
|
@@ -8681,19 +8583,15 @@ const createOperationSpec = {
|
|
|
8681
8583
|
bodyMapper: SearchIndexerDataSource
|
|
8682
8584
|
},
|
|
8683
8585
|
default: {
|
|
8684
|
-
bodyMapper: SearchError
|
|
8586
|
+
bodyMapper: SearchError
|
|
8685
8587
|
}
|
|
8686
8588
|
},
|
|
8687
8589
|
requestBody: dataSource,
|
|
8688
|
-
queryParameters: [apiVersion
|
|
8689
|
-
urlParameters: [endpoint
|
|
8690
|
-
headerParameters: [
|
|
8691
|
-
contentType$1,
|
|
8692
|
-
accept$1,
|
|
8693
|
-
xMsClientRequestId$1
|
|
8694
|
-
],
|
|
8590
|
+
queryParameters: [apiVersion],
|
|
8591
|
+
urlParameters: [endpoint],
|
|
8592
|
+
headerParameters: [contentType, accept],
|
|
8695
8593
|
mediaType: "json",
|
|
8696
|
-
serializer: serializer$
|
|
8594
|
+
serializer: serializer$5
|
|
8697
8595
|
};
|
|
8698
8596
|
|
|
8699
8597
|
/*
|
|
@@ -8704,7 +8602,7 @@ const createOperationSpec = {
|
|
|
8704
8602
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
8705
8603
|
*/
|
|
8706
8604
|
/** Class representing a Indexers. */
|
|
8707
|
-
class
|
|
8605
|
+
class IndexersImpl {
|
|
8708
8606
|
/**
|
|
8709
8607
|
* Initialize a new instance of the class Indexers class.
|
|
8710
8608
|
* @param client Reference to the service client
|
|
@@ -8718,11 +8616,7 @@ class Indexers {
|
|
|
8718
8616
|
* @param options The options parameters.
|
|
8719
8617
|
*/
|
|
8720
8618
|
reset(indexerName, options) {
|
|
8721
|
-
|
|
8722
|
-
indexerName,
|
|
8723
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
8724
|
-
};
|
|
8725
|
-
return this.client.sendOperationRequest(operationArguments, resetOperationSpec);
|
|
8619
|
+
return this.client.sendOperationRequest({ indexerName, options }, resetOperationSpec);
|
|
8726
8620
|
}
|
|
8727
8621
|
/**
|
|
8728
8622
|
* Runs an indexer on-demand.
|
|
@@ -8730,11 +8624,7 @@ class Indexers {
|
|
|
8730
8624
|
* @param options The options parameters.
|
|
8731
8625
|
*/
|
|
8732
8626
|
run(indexerName, options) {
|
|
8733
|
-
|
|
8734
|
-
indexerName,
|
|
8735
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
8736
|
-
};
|
|
8737
|
-
return this.client.sendOperationRequest(operationArguments, runOperationSpec);
|
|
8627
|
+
return this.client.sendOperationRequest({ indexerName, options }, runOperationSpec);
|
|
8738
8628
|
}
|
|
8739
8629
|
/**
|
|
8740
8630
|
* Creates a new indexer or updates an indexer if it already exists.
|
|
@@ -8743,12 +8633,7 @@ class Indexers {
|
|
|
8743
8633
|
* @param options The options parameters.
|
|
8744
8634
|
*/
|
|
8745
8635
|
createOrUpdate(indexerName, indexer, options) {
|
|
8746
|
-
|
|
8747
|
-
indexerName,
|
|
8748
|
-
indexer,
|
|
8749
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
8750
|
-
};
|
|
8751
|
-
return this.client.sendOperationRequest(operationArguments, createOrUpdateOperationSpec$1);
|
|
8636
|
+
return this.client.sendOperationRequest({ indexerName, indexer, options }, createOrUpdateOperationSpec$3);
|
|
8752
8637
|
}
|
|
8753
8638
|
/**
|
|
8754
8639
|
* Deletes an indexer.
|
|
@@ -8756,11 +8641,7 @@ class Indexers {
|
|
|
8756
8641
|
* @param options The options parameters.
|
|
8757
8642
|
*/
|
|
8758
8643
|
delete(indexerName, options) {
|
|
8759
|
-
|
|
8760
|
-
indexerName,
|
|
8761
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
8762
|
-
};
|
|
8763
|
-
return this.client.sendOperationRequest(operationArguments, deleteOperationSpec$1);
|
|
8644
|
+
return this.client.sendOperationRequest({ indexerName, options }, deleteOperationSpec$3);
|
|
8764
8645
|
}
|
|
8765
8646
|
/**
|
|
8766
8647
|
* Retrieves an indexer definition.
|
|
@@ -8768,21 +8649,14 @@ class Indexers {
|
|
|
8768
8649
|
* @param options The options parameters.
|
|
8769
8650
|
*/
|
|
8770
8651
|
get(indexerName, options) {
|
|
8771
|
-
|
|
8772
|
-
indexerName,
|
|
8773
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
8774
|
-
};
|
|
8775
|
-
return this.client.sendOperationRequest(operationArguments, getOperationSpec$2);
|
|
8652
|
+
return this.client.sendOperationRequest({ indexerName, options }, getOperationSpec$3);
|
|
8776
8653
|
}
|
|
8777
8654
|
/**
|
|
8778
8655
|
* Lists all indexers available for a search service.
|
|
8779
8656
|
* @param options The options parameters.
|
|
8780
8657
|
*/
|
|
8781
8658
|
list(options) {
|
|
8782
|
-
|
|
8783
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
8784
|
-
};
|
|
8785
|
-
return this.client.sendOperationRequest(operationArguments, listOperationSpec$1);
|
|
8659
|
+
return this.client.sendOperationRequest({ options }, listOperationSpec$3);
|
|
8786
8660
|
}
|
|
8787
8661
|
/**
|
|
8788
8662
|
* Creates a new indexer.
|
|
@@ -8790,11 +8664,7 @@ class Indexers {
|
|
|
8790
8664
|
* @param options The options parameters.
|
|
8791
8665
|
*/
|
|
8792
8666
|
create(indexer, options) {
|
|
8793
|
-
|
|
8794
|
-
indexer,
|
|
8795
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
8796
|
-
};
|
|
8797
|
-
return this.client.sendOperationRequest(operationArguments, createOperationSpec$1);
|
|
8667
|
+
return this.client.sendOperationRequest({ indexer, options }, createOperationSpec$3);
|
|
8798
8668
|
}
|
|
8799
8669
|
/**
|
|
8800
8670
|
* Returns the current status and execution history of an indexer.
|
|
@@ -8802,28 +8672,24 @@ class Indexers {
|
|
|
8802
8672
|
* @param options The options parameters.
|
|
8803
8673
|
*/
|
|
8804
8674
|
getStatus(indexerName, options) {
|
|
8805
|
-
|
|
8806
|
-
indexerName,
|
|
8807
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
8808
|
-
};
|
|
8809
|
-
return this.client.sendOperationRequest(operationArguments, getStatusOperationSpec);
|
|
8675
|
+
return this.client.sendOperationRequest({ indexerName, options }, getStatusOperationSpec);
|
|
8810
8676
|
}
|
|
8811
8677
|
}
|
|
8812
8678
|
// Operation Specifications
|
|
8813
|
-
const serializer$
|
|
8679
|
+
const serializer$4 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
|
|
8814
8680
|
const resetOperationSpec = {
|
|
8815
8681
|
path: "/indexers('{indexerName}')/search.reset",
|
|
8816
8682
|
httpMethod: "POST",
|
|
8817
8683
|
responses: {
|
|
8818
8684
|
204: {},
|
|
8819
8685
|
default: {
|
|
8820
|
-
bodyMapper: SearchError
|
|
8686
|
+
bodyMapper: SearchError
|
|
8821
8687
|
}
|
|
8822
8688
|
},
|
|
8823
|
-
queryParameters: [apiVersion
|
|
8824
|
-
urlParameters: [endpoint
|
|
8825
|
-
headerParameters: [accept
|
|
8826
|
-
serializer: serializer$
|
|
8689
|
+
queryParameters: [apiVersion],
|
|
8690
|
+
urlParameters: [endpoint, indexerName],
|
|
8691
|
+
headerParameters: [accept],
|
|
8692
|
+
serializer: serializer$4
|
|
8827
8693
|
};
|
|
8828
8694
|
const runOperationSpec = {
|
|
8829
8695
|
path: "/indexers('{indexerName}')/search.run",
|
|
@@ -8831,15 +8697,15 @@ const runOperationSpec = {
|
|
|
8831
8697
|
responses: {
|
|
8832
8698
|
202: {},
|
|
8833
8699
|
default: {
|
|
8834
|
-
bodyMapper: SearchError
|
|
8700
|
+
bodyMapper: SearchError
|
|
8835
8701
|
}
|
|
8836
8702
|
},
|
|
8837
|
-
queryParameters: [apiVersion
|
|
8838
|
-
urlParameters: [endpoint
|
|
8839
|
-
headerParameters: [accept
|
|
8840
|
-
serializer: serializer$
|
|
8703
|
+
queryParameters: [apiVersion],
|
|
8704
|
+
urlParameters: [endpoint, indexerName],
|
|
8705
|
+
headerParameters: [accept],
|
|
8706
|
+
serializer: serializer$4
|
|
8841
8707
|
};
|
|
8842
|
-
const createOrUpdateOperationSpec$
|
|
8708
|
+
const createOrUpdateOperationSpec$3 = {
|
|
8843
8709
|
path: "/indexers('{indexerName}')",
|
|
8844
8710
|
httpMethod: "PUT",
|
|
8845
8711
|
responses: {
|
|
@@ -8850,44 +8716,42 @@ const createOrUpdateOperationSpec$1 = {
|
|
|
8850
8716
|
bodyMapper: SearchIndexer
|
|
8851
8717
|
},
|
|
8852
8718
|
default: {
|
|
8853
|
-
bodyMapper: SearchError
|
|
8719
|
+
bodyMapper: SearchError
|
|
8854
8720
|
}
|
|
8855
8721
|
},
|
|
8856
8722
|
requestBody: indexer,
|
|
8857
|
-
queryParameters: [apiVersion
|
|
8858
|
-
urlParameters: [endpoint
|
|
8723
|
+
queryParameters: [apiVersion],
|
|
8724
|
+
urlParameters: [endpoint, indexerName],
|
|
8859
8725
|
headerParameters: [
|
|
8860
|
-
contentType
|
|
8861
|
-
accept
|
|
8862
|
-
xMsClientRequestId$1,
|
|
8726
|
+
contentType,
|
|
8727
|
+
accept,
|
|
8863
8728
|
ifMatch,
|
|
8864
8729
|
ifNoneMatch,
|
|
8865
8730
|
prefer
|
|
8866
8731
|
],
|
|
8867
8732
|
mediaType: "json",
|
|
8868
|
-
serializer: serializer$
|
|
8733
|
+
serializer: serializer$4
|
|
8869
8734
|
};
|
|
8870
|
-
const deleteOperationSpec$
|
|
8735
|
+
const deleteOperationSpec$3 = {
|
|
8871
8736
|
path: "/indexers('{indexerName}')",
|
|
8872
8737
|
httpMethod: "DELETE",
|
|
8873
8738
|
responses: {
|
|
8874
8739
|
204: {},
|
|
8875
8740
|
404: {},
|
|
8876
8741
|
default: {
|
|
8877
|
-
bodyMapper: SearchError
|
|
8742
|
+
bodyMapper: SearchError
|
|
8878
8743
|
}
|
|
8879
8744
|
},
|
|
8880
|
-
queryParameters: [apiVersion
|
|
8881
|
-
urlParameters: [endpoint
|
|
8745
|
+
queryParameters: [apiVersion],
|
|
8746
|
+
urlParameters: [endpoint, indexerName],
|
|
8882
8747
|
headerParameters: [
|
|
8883
|
-
accept
|
|
8884
|
-
xMsClientRequestId$1,
|
|
8748
|
+
accept,
|
|
8885
8749
|
ifMatch,
|
|
8886
8750
|
ifNoneMatch
|
|
8887
8751
|
],
|
|
8888
|
-
serializer: serializer$
|
|
8752
|
+
serializer: serializer$4
|
|
8889
8753
|
};
|
|
8890
|
-
const getOperationSpec$
|
|
8754
|
+
const getOperationSpec$3 = {
|
|
8891
8755
|
path: "/indexers('{indexerName}')",
|
|
8892
8756
|
httpMethod: "GET",
|
|
8893
8757
|
responses: {
|
|
@@ -8895,15 +8759,15 @@ const getOperationSpec$2 = {
|
|
|
8895
8759
|
bodyMapper: SearchIndexer
|
|
8896
8760
|
},
|
|
8897
8761
|
default: {
|
|
8898
|
-
bodyMapper: SearchError
|
|
8762
|
+
bodyMapper: SearchError
|
|
8899
8763
|
}
|
|
8900
8764
|
},
|
|
8901
|
-
queryParameters: [apiVersion
|
|
8902
|
-
urlParameters: [endpoint
|
|
8903
|
-
headerParameters: [accept
|
|
8904
|
-
serializer: serializer$
|
|
8765
|
+
queryParameters: [apiVersion],
|
|
8766
|
+
urlParameters: [endpoint, indexerName],
|
|
8767
|
+
headerParameters: [accept],
|
|
8768
|
+
serializer: serializer$4
|
|
8905
8769
|
};
|
|
8906
|
-
const listOperationSpec$
|
|
8770
|
+
const listOperationSpec$3 = {
|
|
8907
8771
|
path: "/indexers",
|
|
8908
8772
|
httpMethod: "GET",
|
|
8909
8773
|
responses: {
|
|
@@ -8911,15 +8775,15 @@ const listOperationSpec$1 = {
|
|
|
8911
8775
|
bodyMapper: ListIndexersResult
|
|
8912
8776
|
},
|
|
8913
8777
|
default: {
|
|
8914
|
-
bodyMapper: SearchError
|
|
8778
|
+
bodyMapper: SearchError
|
|
8915
8779
|
}
|
|
8916
8780
|
},
|
|
8917
|
-
queryParameters: [apiVersion
|
|
8918
|
-
urlParameters: [endpoint
|
|
8919
|
-
headerParameters: [accept
|
|
8920
|
-
serializer: serializer$
|
|
8781
|
+
queryParameters: [apiVersion, select],
|
|
8782
|
+
urlParameters: [endpoint],
|
|
8783
|
+
headerParameters: [accept],
|
|
8784
|
+
serializer: serializer$4
|
|
8921
8785
|
};
|
|
8922
|
-
const createOperationSpec$
|
|
8786
|
+
const createOperationSpec$3 = {
|
|
8923
8787
|
path: "/indexers",
|
|
8924
8788
|
httpMethod: "POST",
|
|
8925
8789
|
responses: {
|
|
@@ -8927,19 +8791,15 @@ const createOperationSpec$1 = {
|
|
|
8927
8791
|
bodyMapper: SearchIndexer
|
|
8928
8792
|
},
|
|
8929
8793
|
default: {
|
|
8930
|
-
bodyMapper: SearchError
|
|
8794
|
+
bodyMapper: SearchError
|
|
8931
8795
|
}
|
|
8932
8796
|
},
|
|
8933
8797
|
requestBody: indexer,
|
|
8934
|
-
queryParameters: [apiVersion
|
|
8935
|
-
urlParameters: [endpoint
|
|
8936
|
-
headerParameters: [
|
|
8937
|
-
contentType$1,
|
|
8938
|
-
accept$1,
|
|
8939
|
-
xMsClientRequestId$1
|
|
8940
|
-
],
|
|
8798
|
+
queryParameters: [apiVersion],
|
|
8799
|
+
urlParameters: [endpoint],
|
|
8800
|
+
headerParameters: [contentType, accept],
|
|
8941
8801
|
mediaType: "json",
|
|
8942
|
-
serializer: serializer$
|
|
8802
|
+
serializer: serializer$4
|
|
8943
8803
|
};
|
|
8944
8804
|
const getStatusOperationSpec = {
|
|
8945
8805
|
path: "/indexers('{indexerName}')/search.status",
|
|
@@ -8949,13 +8809,13 @@ const getStatusOperationSpec = {
|
|
|
8949
8809
|
bodyMapper: SearchIndexerStatus
|
|
8950
8810
|
},
|
|
8951
8811
|
default: {
|
|
8952
|
-
bodyMapper: SearchError
|
|
8812
|
+
bodyMapper: SearchError
|
|
8953
8813
|
}
|
|
8954
8814
|
},
|
|
8955
|
-
queryParameters: [apiVersion
|
|
8956
|
-
urlParameters: [endpoint
|
|
8957
|
-
headerParameters: [accept
|
|
8958
|
-
serializer: serializer$
|
|
8815
|
+
queryParameters: [apiVersion],
|
|
8816
|
+
urlParameters: [endpoint, indexerName],
|
|
8817
|
+
headerParameters: [accept],
|
|
8818
|
+
serializer: serializer$4
|
|
8959
8819
|
};
|
|
8960
8820
|
|
|
8961
8821
|
/*
|
|
@@ -8966,7 +8826,7 @@ const getStatusOperationSpec = {
|
|
|
8966
8826
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
8967
8827
|
*/
|
|
8968
8828
|
/** Class representing a Skillsets. */
|
|
8969
|
-
class
|
|
8829
|
+
class SkillsetsImpl {
|
|
8970
8830
|
/**
|
|
8971
8831
|
* Initialize a new instance of the class Skillsets class.
|
|
8972
8832
|
* @param client Reference to the service client
|
|
@@ -8981,12 +8841,7 @@ class Skillsets {
|
|
|
8981
8841
|
* @param options The options parameters.
|
|
8982
8842
|
*/
|
|
8983
8843
|
createOrUpdate(skillsetName, skillset, options) {
|
|
8984
|
-
|
|
8985
|
-
skillsetName,
|
|
8986
|
-
skillset,
|
|
8987
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
8988
|
-
};
|
|
8989
|
-
return this.client.sendOperationRequest(operationArguments, createOrUpdateOperationSpec$2);
|
|
8844
|
+
return this.client.sendOperationRequest({ skillsetName, skillset, options }, createOrUpdateOperationSpec$2);
|
|
8990
8845
|
}
|
|
8991
8846
|
/**
|
|
8992
8847
|
* Deletes a skillset in a search service.
|
|
@@ -8994,11 +8849,7 @@ class Skillsets {
|
|
|
8994
8849
|
* @param options The options parameters.
|
|
8995
8850
|
*/
|
|
8996
8851
|
delete(skillsetName, options) {
|
|
8997
|
-
|
|
8998
|
-
skillsetName,
|
|
8999
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
9000
|
-
};
|
|
9001
|
-
return this.client.sendOperationRequest(operationArguments, deleteOperationSpec$2);
|
|
8852
|
+
return this.client.sendOperationRequest({ skillsetName, options }, deleteOperationSpec$2);
|
|
9002
8853
|
}
|
|
9003
8854
|
/**
|
|
9004
8855
|
* Retrieves a skillset in a search service.
|
|
@@ -9006,21 +8857,14 @@ class Skillsets {
|
|
|
9006
8857
|
* @param options The options parameters.
|
|
9007
8858
|
*/
|
|
9008
8859
|
get(skillsetName, options) {
|
|
9009
|
-
|
|
9010
|
-
skillsetName,
|
|
9011
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
9012
|
-
};
|
|
9013
|
-
return this.client.sendOperationRequest(operationArguments, getOperationSpec$3);
|
|
8860
|
+
return this.client.sendOperationRequest({ skillsetName, options }, getOperationSpec$2);
|
|
9014
8861
|
}
|
|
9015
8862
|
/**
|
|
9016
8863
|
* List all skillsets in a search service.
|
|
9017
8864
|
* @param options The options parameters.
|
|
9018
8865
|
*/
|
|
9019
8866
|
list(options) {
|
|
9020
|
-
|
|
9021
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
9022
|
-
};
|
|
9023
|
-
return this.client.sendOperationRequest(operationArguments, listOperationSpec$2);
|
|
8867
|
+
return this.client.sendOperationRequest({ options }, listOperationSpec$2);
|
|
9024
8868
|
}
|
|
9025
8869
|
/**
|
|
9026
8870
|
* Creates a new skillset in a search service.
|
|
@@ -9028,15 +8872,11 @@ class Skillsets {
|
|
|
9028
8872
|
* @param options The options parameters.
|
|
9029
8873
|
*/
|
|
9030
8874
|
create(skillset, options) {
|
|
9031
|
-
|
|
9032
|
-
skillset,
|
|
9033
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
9034
|
-
};
|
|
9035
|
-
return this.client.sendOperationRequest(operationArguments, createOperationSpec$2);
|
|
8875
|
+
return this.client.sendOperationRequest({ skillset, options }, createOperationSpec$2);
|
|
9036
8876
|
}
|
|
9037
8877
|
}
|
|
9038
8878
|
// Operation Specifications
|
|
9039
|
-
const serializer$3 =
|
|
8879
|
+
const serializer$3 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
|
|
9040
8880
|
const createOrUpdateOperationSpec$2 = {
|
|
9041
8881
|
path: "/skillsets('{skillsetName}')",
|
|
9042
8882
|
httpMethod: "PUT",
|
|
@@ -9048,16 +8888,15 @@ const createOrUpdateOperationSpec$2 = {
|
|
|
9048
8888
|
bodyMapper: SearchIndexerSkillset
|
|
9049
8889
|
},
|
|
9050
8890
|
default: {
|
|
9051
|
-
bodyMapper: SearchError
|
|
8891
|
+
bodyMapper: SearchError
|
|
9052
8892
|
}
|
|
9053
8893
|
},
|
|
9054
8894
|
requestBody: skillset,
|
|
9055
|
-
queryParameters: [apiVersion
|
|
9056
|
-
urlParameters: [endpoint
|
|
8895
|
+
queryParameters: [apiVersion],
|
|
8896
|
+
urlParameters: [endpoint, skillsetName],
|
|
9057
8897
|
headerParameters: [
|
|
9058
|
-
contentType
|
|
9059
|
-
accept
|
|
9060
|
-
xMsClientRequestId$1,
|
|
8898
|
+
contentType,
|
|
8899
|
+
accept,
|
|
9061
8900
|
ifMatch,
|
|
9062
8901
|
ifNoneMatch,
|
|
9063
8902
|
prefer
|
|
@@ -9072,20 +8911,19 @@ const deleteOperationSpec$2 = {
|
|
|
9072
8911
|
204: {},
|
|
9073
8912
|
404: {},
|
|
9074
8913
|
default: {
|
|
9075
|
-
bodyMapper: SearchError
|
|
8914
|
+
bodyMapper: SearchError
|
|
9076
8915
|
}
|
|
9077
8916
|
},
|
|
9078
|
-
queryParameters: [apiVersion
|
|
9079
|
-
urlParameters: [endpoint
|
|
8917
|
+
queryParameters: [apiVersion],
|
|
8918
|
+
urlParameters: [endpoint, skillsetName],
|
|
9080
8919
|
headerParameters: [
|
|
9081
|
-
accept
|
|
9082
|
-
xMsClientRequestId$1,
|
|
8920
|
+
accept,
|
|
9083
8921
|
ifMatch,
|
|
9084
8922
|
ifNoneMatch
|
|
9085
8923
|
],
|
|
9086
8924
|
serializer: serializer$3
|
|
9087
8925
|
};
|
|
9088
|
-
const getOperationSpec$
|
|
8926
|
+
const getOperationSpec$2 = {
|
|
9089
8927
|
path: "/skillsets('{skillsetName}')",
|
|
9090
8928
|
httpMethod: "GET",
|
|
9091
8929
|
responses: {
|
|
@@ -9093,12 +8931,12 @@ const getOperationSpec$3 = {
|
|
|
9093
8931
|
bodyMapper: SearchIndexerSkillset
|
|
9094
8932
|
},
|
|
9095
8933
|
default: {
|
|
9096
|
-
bodyMapper: SearchError
|
|
8934
|
+
bodyMapper: SearchError
|
|
9097
8935
|
}
|
|
9098
8936
|
},
|
|
9099
|
-
queryParameters: [apiVersion
|
|
9100
|
-
urlParameters: [endpoint
|
|
9101
|
-
headerParameters: [accept
|
|
8937
|
+
queryParameters: [apiVersion],
|
|
8938
|
+
urlParameters: [endpoint, skillsetName],
|
|
8939
|
+
headerParameters: [accept],
|
|
9102
8940
|
serializer: serializer$3
|
|
9103
8941
|
};
|
|
9104
8942
|
const listOperationSpec$2 = {
|
|
@@ -9109,12 +8947,12 @@ const listOperationSpec$2 = {
|
|
|
9109
8947
|
bodyMapper: ListSkillsetsResult
|
|
9110
8948
|
},
|
|
9111
8949
|
default: {
|
|
9112
|
-
bodyMapper: SearchError
|
|
8950
|
+
bodyMapper: SearchError
|
|
9113
8951
|
}
|
|
9114
8952
|
},
|
|
9115
|
-
queryParameters: [apiVersion
|
|
9116
|
-
urlParameters: [endpoint
|
|
9117
|
-
headerParameters: [accept
|
|
8953
|
+
queryParameters: [apiVersion, select],
|
|
8954
|
+
urlParameters: [endpoint],
|
|
8955
|
+
headerParameters: [accept],
|
|
9118
8956
|
serializer: serializer$3
|
|
9119
8957
|
};
|
|
9120
8958
|
const createOperationSpec$2 = {
|
|
@@ -9125,17 +8963,13 @@ const createOperationSpec$2 = {
|
|
|
9125
8963
|
bodyMapper: SearchIndexerSkillset
|
|
9126
8964
|
},
|
|
9127
8965
|
default: {
|
|
9128
|
-
bodyMapper: SearchError
|
|
8966
|
+
bodyMapper: SearchError
|
|
9129
8967
|
}
|
|
9130
8968
|
},
|
|
9131
8969
|
requestBody: skillset,
|
|
9132
|
-
queryParameters: [apiVersion
|
|
9133
|
-
urlParameters: [endpoint
|
|
9134
|
-
headerParameters: [
|
|
9135
|
-
contentType$1,
|
|
9136
|
-
accept$1,
|
|
9137
|
-
xMsClientRequestId$1
|
|
9138
|
-
],
|
|
8970
|
+
queryParameters: [apiVersion],
|
|
8971
|
+
urlParameters: [endpoint],
|
|
8972
|
+
headerParameters: [contentType, accept],
|
|
9139
8973
|
mediaType: "json",
|
|
9140
8974
|
serializer: serializer$3
|
|
9141
8975
|
};
|
|
@@ -9148,7 +8982,7 @@ const createOperationSpec$2 = {
|
|
|
9148
8982
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
9149
8983
|
*/
|
|
9150
8984
|
/** Class representing a SynonymMaps. */
|
|
9151
|
-
class
|
|
8985
|
+
class SynonymMapsImpl {
|
|
9152
8986
|
/**
|
|
9153
8987
|
* Initialize a new instance of the class SynonymMaps class.
|
|
9154
8988
|
* @param client Reference to the service client
|
|
@@ -9163,12 +8997,7 @@ class SynonymMaps {
|
|
|
9163
8997
|
* @param options The options parameters.
|
|
9164
8998
|
*/
|
|
9165
8999
|
createOrUpdate(synonymMapName, synonymMap, options) {
|
|
9166
|
-
|
|
9167
|
-
synonymMapName,
|
|
9168
|
-
synonymMap,
|
|
9169
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
9170
|
-
};
|
|
9171
|
-
return this.client.sendOperationRequest(operationArguments, createOrUpdateOperationSpec$3);
|
|
9000
|
+
return this.client.sendOperationRequest({ synonymMapName, synonymMap, options }, createOrUpdateOperationSpec$1);
|
|
9172
9001
|
}
|
|
9173
9002
|
/**
|
|
9174
9003
|
* Deletes a synonym map.
|
|
@@ -9176,11 +9005,7 @@ class SynonymMaps {
|
|
|
9176
9005
|
* @param options The options parameters.
|
|
9177
9006
|
*/
|
|
9178
9007
|
delete(synonymMapName, options) {
|
|
9179
|
-
|
|
9180
|
-
synonymMapName,
|
|
9181
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
9182
|
-
};
|
|
9183
|
-
return this.client.sendOperationRequest(operationArguments, deleteOperationSpec$3);
|
|
9008
|
+
return this.client.sendOperationRequest({ synonymMapName, options }, deleteOperationSpec$1);
|
|
9184
9009
|
}
|
|
9185
9010
|
/**
|
|
9186
9011
|
* Retrieves a synonym map definition.
|
|
@@ -9188,21 +9013,14 @@ class SynonymMaps {
|
|
|
9188
9013
|
* @param options The options parameters.
|
|
9189
9014
|
*/
|
|
9190
9015
|
get(synonymMapName, options) {
|
|
9191
|
-
|
|
9192
|
-
synonymMapName,
|
|
9193
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
9194
|
-
};
|
|
9195
|
-
return this.client.sendOperationRequest(operationArguments, getOperationSpec$4);
|
|
9016
|
+
return this.client.sendOperationRequest({ synonymMapName, options }, getOperationSpec$1);
|
|
9196
9017
|
}
|
|
9197
9018
|
/**
|
|
9198
9019
|
* Lists all synonym maps available for a search service.
|
|
9199
9020
|
* @param options The options parameters.
|
|
9200
9021
|
*/
|
|
9201
9022
|
list(options) {
|
|
9202
|
-
|
|
9203
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
9204
|
-
};
|
|
9205
|
-
return this.client.sendOperationRequest(operationArguments, listOperationSpec$3);
|
|
9023
|
+
return this.client.sendOperationRequest({ options }, listOperationSpec$1);
|
|
9206
9024
|
}
|
|
9207
9025
|
/**
|
|
9208
9026
|
* Creates a new synonym map.
|
|
@@ -9210,16 +9028,12 @@ class SynonymMaps {
|
|
|
9210
9028
|
* @param options The options parameters.
|
|
9211
9029
|
*/
|
|
9212
9030
|
create(synonymMap, options) {
|
|
9213
|
-
|
|
9214
|
-
synonymMap,
|
|
9215
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
9216
|
-
};
|
|
9217
|
-
return this.client.sendOperationRequest(operationArguments, createOperationSpec$3);
|
|
9031
|
+
return this.client.sendOperationRequest({ synonymMap, options }, createOperationSpec$1);
|
|
9218
9032
|
}
|
|
9219
9033
|
}
|
|
9220
9034
|
// Operation Specifications
|
|
9221
|
-
const serializer$
|
|
9222
|
-
const createOrUpdateOperationSpec$
|
|
9035
|
+
const serializer$2 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
|
|
9036
|
+
const createOrUpdateOperationSpec$1 = {
|
|
9223
9037
|
path: "/synonymmaps('{synonymMapName}')",
|
|
9224
9038
|
httpMethod: "PUT",
|
|
9225
9039
|
responses: {
|
|
@@ -9230,44 +9044,42 @@ const createOrUpdateOperationSpec$3 = {
|
|
|
9230
9044
|
bodyMapper: SynonymMap
|
|
9231
9045
|
},
|
|
9232
9046
|
default: {
|
|
9233
|
-
bodyMapper: SearchError
|
|
9047
|
+
bodyMapper: SearchError
|
|
9234
9048
|
}
|
|
9235
9049
|
},
|
|
9236
9050
|
requestBody: synonymMap,
|
|
9237
|
-
queryParameters: [apiVersion
|
|
9238
|
-
urlParameters: [endpoint
|
|
9051
|
+
queryParameters: [apiVersion],
|
|
9052
|
+
urlParameters: [endpoint, synonymMapName],
|
|
9239
9053
|
headerParameters: [
|
|
9240
|
-
contentType
|
|
9241
|
-
accept
|
|
9242
|
-
xMsClientRequestId$1,
|
|
9054
|
+
contentType,
|
|
9055
|
+
accept,
|
|
9243
9056
|
ifMatch,
|
|
9244
9057
|
ifNoneMatch,
|
|
9245
9058
|
prefer
|
|
9246
9059
|
],
|
|
9247
9060
|
mediaType: "json",
|
|
9248
|
-
serializer: serializer$
|
|
9061
|
+
serializer: serializer$2
|
|
9249
9062
|
};
|
|
9250
|
-
const deleteOperationSpec$
|
|
9063
|
+
const deleteOperationSpec$1 = {
|
|
9251
9064
|
path: "/synonymmaps('{synonymMapName}')",
|
|
9252
9065
|
httpMethod: "DELETE",
|
|
9253
9066
|
responses: {
|
|
9254
9067
|
204: {},
|
|
9255
9068
|
404: {},
|
|
9256
9069
|
default: {
|
|
9257
|
-
bodyMapper: SearchError
|
|
9070
|
+
bodyMapper: SearchError
|
|
9258
9071
|
}
|
|
9259
9072
|
},
|
|
9260
|
-
queryParameters: [apiVersion
|
|
9261
|
-
urlParameters: [endpoint
|
|
9073
|
+
queryParameters: [apiVersion],
|
|
9074
|
+
urlParameters: [endpoint, synonymMapName],
|
|
9262
9075
|
headerParameters: [
|
|
9263
|
-
accept
|
|
9264
|
-
xMsClientRequestId$1,
|
|
9076
|
+
accept,
|
|
9265
9077
|
ifMatch,
|
|
9266
9078
|
ifNoneMatch
|
|
9267
9079
|
],
|
|
9268
|
-
serializer: serializer$
|
|
9080
|
+
serializer: serializer$2
|
|
9269
9081
|
};
|
|
9270
|
-
const getOperationSpec$
|
|
9082
|
+
const getOperationSpec$1 = {
|
|
9271
9083
|
path: "/synonymmaps('{synonymMapName}')",
|
|
9272
9084
|
httpMethod: "GET",
|
|
9273
9085
|
responses: {
|
|
@@ -9275,15 +9087,15 @@ const getOperationSpec$4 = {
|
|
|
9275
9087
|
bodyMapper: SynonymMap
|
|
9276
9088
|
},
|
|
9277
9089
|
default: {
|
|
9278
|
-
bodyMapper: SearchError
|
|
9090
|
+
bodyMapper: SearchError
|
|
9279
9091
|
}
|
|
9280
9092
|
},
|
|
9281
|
-
queryParameters: [apiVersion
|
|
9282
|
-
urlParameters: [endpoint
|
|
9283
|
-
headerParameters: [accept
|
|
9284
|
-
serializer: serializer$
|
|
9093
|
+
queryParameters: [apiVersion],
|
|
9094
|
+
urlParameters: [endpoint, synonymMapName],
|
|
9095
|
+
headerParameters: [accept],
|
|
9096
|
+
serializer: serializer$2
|
|
9285
9097
|
};
|
|
9286
|
-
const listOperationSpec$
|
|
9098
|
+
const listOperationSpec$1 = {
|
|
9287
9099
|
path: "/synonymmaps",
|
|
9288
9100
|
httpMethod: "GET",
|
|
9289
9101
|
responses: {
|
|
@@ -9291,15 +9103,15 @@ const listOperationSpec$3 = {
|
|
|
9291
9103
|
bodyMapper: ListSynonymMapsResult
|
|
9292
9104
|
},
|
|
9293
9105
|
default: {
|
|
9294
|
-
bodyMapper: SearchError
|
|
9106
|
+
bodyMapper: SearchError
|
|
9295
9107
|
}
|
|
9296
9108
|
},
|
|
9297
|
-
queryParameters: [apiVersion
|
|
9298
|
-
urlParameters: [endpoint
|
|
9299
|
-
headerParameters: [accept
|
|
9300
|
-
serializer: serializer$
|
|
9109
|
+
queryParameters: [apiVersion, select],
|
|
9110
|
+
urlParameters: [endpoint],
|
|
9111
|
+
headerParameters: [accept],
|
|
9112
|
+
serializer: serializer$2
|
|
9301
9113
|
};
|
|
9302
|
-
const createOperationSpec$
|
|
9114
|
+
const createOperationSpec$1 = {
|
|
9303
9115
|
path: "/synonymmaps",
|
|
9304
9116
|
httpMethod: "POST",
|
|
9305
9117
|
responses: {
|
|
@@ -9307,19 +9119,15 @@ const createOperationSpec$3 = {
|
|
|
9307
9119
|
bodyMapper: SynonymMap
|
|
9308
9120
|
},
|
|
9309
9121
|
default: {
|
|
9310
|
-
bodyMapper: SearchError
|
|
9122
|
+
bodyMapper: SearchError
|
|
9311
9123
|
}
|
|
9312
9124
|
},
|
|
9313
9125
|
requestBody: synonymMap,
|
|
9314
|
-
queryParameters: [apiVersion
|
|
9315
|
-
urlParameters: [endpoint
|
|
9316
|
-
headerParameters: [
|
|
9317
|
-
contentType$1,
|
|
9318
|
-
accept$1,
|
|
9319
|
-
xMsClientRequestId$1
|
|
9320
|
-
],
|
|
9126
|
+
queryParameters: [apiVersion],
|
|
9127
|
+
urlParameters: [endpoint],
|
|
9128
|
+
headerParameters: [contentType, accept],
|
|
9321
9129
|
mediaType: "json",
|
|
9322
|
-
serializer: serializer$
|
|
9130
|
+
serializer: serializer$2
|
|
9323
9131
|
};
|
|
9324
9132
|
|
|
9325
9133
|
/*
|
|
@@ -9330,7 +9138,7 @@ const createOperationSpec$3 = {
|
|
|
9330
9138
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
9331
9139
|
*/
|
|
9332
9140
|
/** Class representing a Indexes. */
|
|
9333
|
-
class
|
|
9141
|
+
class IndexesImpl {
|
|
9334
9142
|
/**
|
|
9335
9143
|
* Initialize a new instance of the class Indexes class.
|
|
9336
9144
|
* @param client Reference to the service client
|
|
@@ -9344,21 +9152,14 @@ class Indexes {
|
|
|
9344
9152
|
* @param options The options parameters.
|
|
9345
9153
|
*/
|
|
9346
9154
|
create(index, options) {
|
|
9347
|
-
|
|
9348
|
-
index,
|
|
9349
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
9350
|
-
};
|
|
9351
|
-
return this.client.sendOperationRequest(operationArguments, createOperationSpec$4);
|
|
9155
|
+
return this.client.sendOperationRequest({ index, options }, createOperationSpec);
|
|
9352
9156
|
}
|
|
9353
9157
|
/**
|
|
9354
9158
|
* Lists all indexes available for a search service.
|
|
9355
9159
|
* @param options The options parameters.
|
|
9356
9160
|
*/
|
|
9357
9161
|
list(options) {
|
|
9358
|
-
|
|
9359
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
9360
|
-
};
|
|
9361
|
-
return this.client.sendOperationRequest(operationArguments, listOperationSpec$4);
|
|
9162
|
+
return this.client.sendOperationRequest({ options }, listOperationSpec);
|
|
9362
9163
|
}
|
|
9363
9164
|
/**
|
|
9364
9165
|
* Creates a new search index or updates an index if it already exists.
|
|
@@ -9367,12 +9168,7 @@ class Indexes {
|
|
|
9367
9168
|
* @param options The options parameters.
|
|
9368
9169
|
*/
|
|
9369
9170
|
createOrUpdate(indexName, index, options) {
|
|
9370
|
-
|
|
9371
|
-
indexName,
|
|
9372
|
-
index,
|
|
9373
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
9374
|
-
};
|
|
9375
|
-
return this.client.sendOperationRequest(operationArguments, createOrUpdateOperationSpec$4);
|
|
9171
|
+
return this.client.sendOperationRequest({ indexName, index, options }, createOrUpdateOperationSpec);
|
|
9376
9172
|
}
|
|
9377
9173
|
/**
|
|
9378
9174
|
* Deletes a search index and all the documents it contains. This operation is permanent, with no
|
|
@@ -9382,11 +9178,7 @@ class Indexes {
|
|
|
9382
9178
|
* @param options The options parameters.
|
|
9383
9179
|
*/
|
|
9384
9180
|
delete(indexName, options) {
|
|
9385
|
-
|
|
9386
|
-
indexName,
|
|
9387
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
9388
|
-
};
|
|
9389
|
-
return this.client.sendOperationRequest(operationArguments, deleteOperationSpec$4);
|
|
9181
|
+
return this.client.sendOperationRequest({ indexName, options }, deleteOperationSpec);
|
|
9390
9182
|
}
|
|
9391
9183
|
/**
|
|
9392
9184
|
* Retrieves an index definition.
|
|
@@ -9394,11 +9186,7 @@ class Indexes {
|
|
|
9394
9186
|
* @param options The options parameters.
|
|
9395
9187
|
*/
|
|
9396
9188
|
get(indexName, options) {
|
|
9397
|
-
|
|
9398
|
-
indexName,
|
|
9399
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
9400
|
-
};
|
|
9401
|
-
return this.client.sendOperationRequest(operationArguments, getOperationSpec$5);
|
|
9189
|
+
return this.client.sendOperationRequest({ indexName, options }, getOperationSpec);
|
|
9402
9190
|
}
|
|
9403
9191
|
/**
|
|
9404
9192
|
* Returns statistics for the given index, including a document count and storage usage.
|
|
@@ -9406,11 +9194,7 @@ class Indexes {
|
|
|
9406
9194
|
* @param options The options parameters.
|
|
9407
9195
|
*/
|
|
9408
9196
|
getStatistics(indexName, options) {
|
|
9409
|
-
|
|
9410
|
-
indexName,
|
|
9411
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
9412
|
-
};
|
|
9413
|
-
return this.client.sendOperationRequest(operationArguments, getStatisticsOperationSpec);
|
|
9197
|
+
return this.client.sendOperationRequest({ indexName, options }, getStatisticsOperationSpec);
|
|
9414
9198
|
}
|
|
9415
9199
|
/**
|
|
9416
9200
|
* Shows how an analyzer breaks text into tokens.
|
|
@@ -9419,17 +9203,12 @@ class Indexes {
|
|
|
9419
9203
|
* @param options The options parameters.
|
|
9420
9204
|
*/
|
|
9421
9205
|
analyze(indexName, request, options) {
|
|
9422
|
-
|
|
9423
|
-
indexName,
|
|
9424
|
-
request,
|
|
9425
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
9426
|
-
};
|
|
9427
|
-
return this.client.sendOperationRequest(operationArguments, analyzeOperationSpec);
|
|
9206
|
+
return this.client.sendOperationRequest({ indexName, request, options }, analyzeOperationSpec);
|
|
9428
9207
|
}
|
|
9429
9208
|
}
|
|
9430
9209
|
// Operation Specifications
|
|
9431
|
-
const serializer$
|
|
9432
|
-
const createOperationSpec
|
|
9210
|
+
const serializer$1 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
|
|
9211
|
+
const createOperationSpec = {
|
|
9433
9212
|
path: "/indexes",
|
|
9434
9213
|
httpMethod: "POST",
|
|
9435
9214
|
responses: {
|
|
@@ -9437,21 +9216,17 @@ const createOperationSpec$4 = {
|
|
|
9437
9216
|
bodyMapper: SearchIndex
|
|
9438
9217
|
},
|
|
9439
9218
|
default: {
|
|
9440
|
-
bodyMapper: SearchError
|
|
9219
|
+
bodyMapper: SearchError
|
|
9441
9220
|
}
|
|
9442
9221
|
},
|
|
9443
9222
|
requestBody: index,
|
|
9444
|
-
queryParameters: [apiVersion
|
|
9445
|
-
urlParameters: [endpoint
|
|
9446
|
-
headerParameters: [
|
|
9447
|
-
contentType$1,
|
|
9448
|
-
accept$1,
|
|
9449
|
-
xMsClientRequestId$1
|
|
9450
|
-
],
|
|
9223
|
+
queryParameters: [apiVersion],
|
|
9224
|
+
urlParameters: [endpoint],
|
|
9225
|
+
headerParameters: [contentType, accept],
|
|
9451
9226
|
mediaType: "json",
|
|
9452
|
-
serializer: serializer$
|
|
9227
|
+
serializer: serializer$1
|
|
9453
9228
|
};
|
|
9454
|
-
const listOperationSpec
|
|
9229
|
+
const listOperationSpec = {
|
|
9455
9230
|
path: "/indexes",
|
|
9456
9231
|
httpMethod: "GET",
|
|
9457
9232
|
responses: {
|
|
@@ -9459,15 +9234,15 @@ const listOperationSpec$4 = {
|
|
|
9459
9234
|
bodyMapper: ListIndexesResult
|
|
9460
9235
|
},
|
|
9461
9236
|
default: {
|
|
9462
|
-
bodyMapper: SearchError
|
|
9237
|
+
bodyMapper: SearchError
|
|
9463
9238
|
}
|
|
9464
9239
|
},
|
|
9465
|
-
queryParameters: [apiVersion
|
|
9466
|
-
urlParameters: [endpoint
|
|
9467
|
-
headerParameters: [accept
|
|
9468
|
-
serializer: serializer$
|
|
9240
|
+
queryParameters: [apiVersion, select],
|
|
9241
|
+
urlParameters: [endpoint],
|
|
9242
|
+
headerParameters: [accept],
|
|
9243
|
+
serializer: serializer$1
|
|
9469
9244
|
};
|
|
9470
|
-
const createOrUpdateOperationSpec
|
|
9245
|
+
const createOrUpdateOperationSpec = {
|
|
9471
9246
|
path: "/indexes('{indexName}')",
|
|
9472
9247
|
httpMethod: "PUT",
|
|
9473
9248
|
responses: {
|
|
@@ -9478,44 +9253,42 @@ const createOrUpdateOperationSpec$4 = {
|
|
|
9478
9253
|
bodyMapper: SearchIndex
|
|
9479
9254
|
},
|
|
9480
9255
|
default: {
|
|
9481
|
-
bodyMapper: SearchError
|
|
9256
|
+
bodyMapper: SearchError
|
|
9482
9257
|
}
|
|
9483
9258
|
},
|
|
9484
9259
|
requestBody: index,
|
|
9485
|
-
queryParameters: [apiVersion
|
|
9486
|
-
urlParameters: [endpoint
|
|
9260
|
+
queryParameters: [apiVersion, allowIndexDowntime],
|
|
9261
|
+
urlParameters: [endpoint, indexName],
|
|
9487
9262
|
headerParameters: [
|
|
9488
|
-
contentType
|
|
9489
|
-
accept
|
|
9490
|
-
xMsClientRequestId$1,
|
|
9263
|
+
contentType,
|
|
9264
|
+
accept,
|
|
9491
9265
|
ifMatch,
|
|
9492
9266
|
ifNoneMatch,
|
|
9493
9267
|
prefer
|
|
9494
9268
|
],
|
|
9495
9269
|
mediaType: "json",
|
|
9496
|
-
serializer: serializer$
|
|
9270
|
+
serializer: serializer$1
|
|
9497
9271
|
};
|
|
9498
|
-
const deleteOperationSpec
|
|
9272
|
+
const deleteOperationSpec = {
|
|
9499
9273
|
path: "/indexes('{indexName}')",
|
|
9500
9274
|
httpMethod: "DELETE",
|
|
9501
9275
|
responses: {
|
|
9502
9276
|
204: {},
|
|
9503
9277
|
404: {},
|
|
9504
9278
|
default: {
|
|
9505
|
-
bodyMapper: SearchError
|
|
9279
|
+
bodyMapper: SearchError
|
|
9506
9280
|
}
|
|
9507
9281
|
},
|
|
9508
|
-
queryParameters: [apiVersion
|
|
9509
|
-
urlParameters: [endpoint
|
|
9282
|
+
queryParameters: [apiVersion],
|
|
9283
|
+
urlParameters: [endpoint, indexName],
|
|
9510
9284
|
headerParameters: [
|
|
9511
|
-
accept
|
|
9512
|
-
xMsClientRequestId$1,
|
|
9285
|
+
accept,
|
|
9513
9286
|
ifMatch,
|
|
9514
9287
|
ifNoneMatch
|
|
9515
9288
|
],
|
|
9516
|
-
serializer: serializer$
|
|
9289
|
+
serializer: serializer$1
|
|
9517
9290
|
};
|
|
9518
|
-
const getOperationSpec
|
|
9291
|
+
const getOperationSpec = {
|
|
9519
9292
|
path: "/indexes('{indexName}')",
|
|
9520
9293
|
httpMethod: "GET",
|
|
9521
9294
|
responses: {
|
|
@@ -9523,13 +9296,13 @@ const getOperationSpec$5 = {
|
|
|
9523
9296
|
bodyMapper: SearchIndex
|
|
9524
9297
|
},
|
|
9525
9298
|
default: {
|
|
9526
|
-
bodyMapper: SearchError
|
|
9299
|
+
bodyMapper: SearchError
|
|
9527
9300
|
}
|
|
9528
9301
|
},
|
|
9529
|
-
queryParameters: [apiVersion
|
|
9530
|
-
urlParameters: [endpoint
|
|
9531
|
-
headerParameters: [accept
|
|
9532
|
-
serializer: serializer$
|
|
9302
|
+
queryParameters: [apiVersion],
|
|
9303
|
+
urlParameters: [endpoint, indexName],
|
|
9304
|
+
headerParameters: [accept],
|
|
9305
|
+
serializer: serializer$1
|
|
9533
9306
|
};
|
|
9534
9307
|
const getStatisticsOperationSpec = {
|
|
9535
9308
|
path: "/indexes('{indexName}')/search.stats",
|
|
@@ -9539,13 +9312,13 @@ const getStatisticsOperationSpec = {
|
|
|
9539
9312
|
bodyMapper: GetIndexStatisticsResult
|
|
9540
9313
|
},
|
|
9541
9314
|
default: {
|
|
9542
|
-
bodyMapper: SearchError
|
|
9315
|
+
bodyMapper: SearchError
|
|
9543
9316
|
}
|
|
9544
9317
|
},
|
|
9545
|
-
queryParameters: [apiVersion
|
|
9546
|
-
urlParameters: [endpoint
|
|
9547
|
-
headerParameters: [accept
|
|
9548
|
-
serializer: serializer$
|
|
9318
|
+
queryParameters: [apiVersion],
|
|
9319
|
+
urlParameters: [endpoint, indexName],
|
|
9320
|
+
headerParameters: [accept],
|
|
9321
|
+
serializer: serializer$1
|
|
9549
9322
|
};
|
|
9550
9323
|
const analyzeOperationSpec = {
|
|
9551
9324
|
path: "/indexes('{indexName}')/search.analyze",
|
|
@@ -9555,19 +9328,15 @@ const analyzeOperationSpec = {
|
|
|
9555
9328
|
bodyMapper: AnalyzeResult
|
|
9556
9329
|
},
|
|
9557
9330
|
default: {
|
|
9558
|
-
bodyMapper: SearchError
|
|
9331
|
+
bodyMapper: SearchError
|
|
9559
9332
|
}
|
|
9560
9333
|
},
|
|
9561
9334
|
requestBody: request,
|
|
9562
|
-
queryParameters: [apiVersion
|
|
9563
|
-
urlParameters: [endpoint
|
|
9564
|
-
headerParameters: [
|
|
9565
|
-
contentType$1,
|
|
9566
|
-
accept$1,
|
|
9567
|
-
xMsClientRequestId$1
|
|
9568
|
-
],
|
|
9335
|
+
queryParameters: [apiVersion],
|
|
9336
|
+
urlParameters: [endpoint, indexName],
|
|
9337
|
+
headerParameters: [contentType, accept],
|
|
9569
9338
|
mediaType: "json",
|
|
9570
|
-
serializer: serializer$
|
|
9339
|
+
serializer: serializer$1
|
|
9571
9340
|
};
|
|
9572
9341
|
|
|
9573
9342
|
/*
|
|
@@ -9577,10 +9346,8 @@ const analyzeOperationSpec = {
|
|
|
9577
9346
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
9578
9347
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
9579
9348
|
*/
|
|
9580
|
-
const packageName$1 = "@azure/search-documents";
|
|
9581
|
-
const packageVersion$1 = "11.3.1";
|
|
9582
9349
|
/** @internal */
|
|
9583
|
-
class SearchServiceClientContext extends
|
|
9350
|
+
class SearchServiceClientContext extends coreClient__namespace.ServiceClient {
|
|
9584
9351
|
/**
|
|
9585
9352
|
* Initializes a new instance of the SearchServiceClientContext class.
|
|
9586
9353
|
* @param endpoint The endpoint URL of the search service.
|
|
@@ -9598,13 +9365,11 @@ class SearchServiceClientContext extends coreHttp.ServiceClient {
|
|
|
9598
9365
|
if (!options) {
|
|
9599
9366
|
options = {};
|
|
9600
9367
|
}
|
|
9601
|
-
|
|
9602
|
-
|
|
9603
|
-
|
|
9604
|
-
}
|
|
9605
|
-
super(
|
|
9606
|
-
this.requestContentType = "application/json; charset=utf-8";
|
|
9607
|
-
this.baseUri = options.endpoint || "{endpoint}";
|
|
9368
|
+
const defaults = {
|
|
9369
|
+
requestContentType: "application/json; charset=utf-8"
|
|
9370
|
+
};
|
|
9371
|
+
const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { baseUri: options.endpoint || "{endpoint}" });
|
|
9372
|
+
super(optionsWithDefaults);
|
|
9608
9373
|
// Parameter assignments
|
|
9609
9374
|
this.endpoint = endpoint;
|
|
9610
9375
|
this.apiVersion = apiVersion;
|
|
@@ -9628,25 +9393,22 @@ class SearchServiceClient extends SearchServiceClientContext {
|
|
|
9628
9393
|
*/
|
|
9629
9394
|
constructor(endpoint, apiVersion, options) {
|
|
9630
9395
|
super(endpoint, apiVersion, options);
|
|
9631
|
-
this.dataSources = new
|
|
9632
|
-
this.indexers = new
|
|
9633
|
-
this.skillsets = new
|
|
9634
|
-
this.synonymMaps = new
|
|
9635
|
-
this.indexes = new
|
|
9396
|
+
this.dataSources = new DataSourcesImpl(this);
|
|
9397
|
+
this.indexers = new IndexersImpl(this);
|
|
9398
|
+
this.skillsets = new SkillsetsImpl(this);
|
|
9399
|
+
this.synonymMaps = new SynonymMapsImpl(this);
|
|
9400
|
+
this.indexes = new IndexesImpl(this);
|
|
9636
9401
|
}
|
|
9637
9402
|
/**
|
|
9638
9403
|
* Gets service level statistics for a search service.
|
|
9639
9404
|
* @param options The options parameters.
|
|
9640
9405
|
*/
|
|
9641
9406
|
getServiceStatistics(options) {
|
|
9642
|
-
|
|
9643
|
-
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
|
|
9644
|
-
};
|
|
9645
|
-
return this.sendOperationRequest(operationArguments, getServiceStatisticsOperationSpec);
|
|
9407
|
+
return this.sendOperationRequest({ options }, getServiceStatisticsOperationSpec);
|
|
9646
9408
|
}
|
|
9647
9409
|
}
|
|
9648
9410
|
// Operation Specifications
|
|
9649
|
-
const serializer
|
|
9411
|
+
const serializer = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
|
|
9650
9412
|
const getServiceStatisticsOperationSpec = {
|
|
9651
9413
|
path: "/servicestats",
|
|
9652
9414
|
httpMethod: "GET",
|
|
@@ -9655,13 +9417,13 @@ const getServiceStatisticsOperationSpec = {
|
|
|
9655
9417
|
bodyMapper: ServiceStatistics
|
|
9656
9418
|
},
|
|
9657
9419
|
default: {
|
|
9658
|
-
bodyMapper: SearchError
|
|
9420
|
+
bodyMapper: SearchError
|
|
9659
9421
|
}
|
|
9660
9422
|
},
|
|
9661
|
-
queryParameters: [apiVersion
|
|
9662
|
-
urlParameters: [endpoint
|
|
9663
|
-
headerParameters: [accept
|
|
9664
|
-
serializer
|
|
9423
|
+
queryParameters: [apiVersion],
|
|
9424
|
+
urlParameters: [endpoint],
|
|
9425
|
+
headerParameters: [accept],
|
|
9426
|
+
serializer
|
|
9665
9427
|
};
|
|
9666
9428
|
|
|
9667
9429
|
// Copyright (c) Microsoft Corporation.
|
|
@@ -9688,67 +9450,56 @@ class SearchIndexClient {
|
|
|
9688
9450
|
* @param options - Used to configure the Search Index client.
|
|
9689
9451
|
*/
|
|
9690
9452
|
constructor(endpoint, credential, options = {}) {
|
|
9453
|
+
var _a, _b;
|
|
9691
9454
|
/**
|
|
9692
9455
|
* The API version to use when communicating with the service.
|
|
9693
9456
|
*/
|
|
9694
|
-
this.apiVersion =
|
|
9457
|
+
this.apiVersion = defaultServiceVersion;
|
|
9695
9458
|
this.endpoint = endpoint;
|
|
9696
9459
|
this.credential = credential;
|
|
9697
9460
|
this.options = options;
|
|
9698
9461
|
const libInfo = `azsdk-js-search-documents/${SDK_VERSION}`;
|
|
9699
|
-
|
|
9700
|
-
|
|
9701
|
-
|
|
9702
|
-
|
|
9703
|
-
|
|
9462
|
+
const userAgentOptions = Object.assign(Object.assign({}, this.options.userAgentOptions), { userAgentPrefix: ((_a = this.options.userAgentOptions) === null || _a === void 0 ? void 0 : _a.userAgentPrefix)
|
|
9463
|
+
? `${this.options.userAgentOptions.userAgentPrefix} ${libInfo}`
|
|
9464
|
+
: libInfo });
|
|
9465
|
+
const loggingOptions = {
|
|
9466
|
+
logger: logger.info,
|
|
9467
|
+
additionalAllowedHeaderNames: [
|
|
9468
|
+
"elapsed-time",
|
|
9469
|
+
"Location",
|
|
9470
|
+
"OData-MaxVersion",
|
|
9471
|
+
"OData-Version",
|
|
9472
|
+
"Prefer",
|
|
9473
|
+
"throttle-reason",
|
|
9474
|
+
],
|
|
9475
|
+
};
|
|
9476
|
+
const internalClientPipelineOptions = Object.assign(Object.assign({}, this.options), { userAgentOptions,
|
|
9477
|
+
loggingOptions });
|
|
9478
|
+
this.apiVersion = (_b = options.apiVersion) !== null && _b !== void 0 ? _b : defaultServiceVersion;
|
|
9479
|
+
this.client = new SearchServiceClient(this.endpoint, this.apiVersion, internalClientPipelineOptions);
|
|
9480
|
+
if (coreAuth.isTokenCredential(credential)) {
|
|
9481
|
+
const scope = this.options.audience
|
|
9482
|
+
? `${this.options.audience}/.default`
|
|
9483
|
+
: `${exports.KnownSearchAudience.AzurePublicCloud}/.default`;
|
|
9484
|
+
this.client.pipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({ credential, scopes: scope }));
|
|
9704
9485
|
}
|
|
9705
9486
|
else {
|
|
9706
|
-
|
|
9707
|
-
}
|
|
9708
|
-
const internalPipelineOptions = Object.assign(Object.assign({}, options), {
|
|
9709
|
-
loggingOptions: {
|
|
9710
|
-
logger: logger.info,
|
|
9711
|
-
allowedHeaderNames: [
|
|
9712
|
-
"elapsed-time",
|
|
9713
|
-
"Location",
|
|
9714
|
-
"OData-MaxVersion",
|
|
9715
|
-
"OData-Version",
|
|
9716
|
-
"Prefer",
|
|
9717
|
-
"throttle-reason"
|
|
9718
|
-
]
|
|
9719
|
-
}
|
|
9720
|
-
});
|
|
9721
|
-
const scope = options.audience
|
|
9722
|
-
? `${options.audience}/.default`
|
|
9723
|
-
: `${exports.KnownSearchAudience.AzurePublicCloud}/.default`;
|
|
9724
|
-
const requestPolicyFactory = coreAuth.isTokenCredential(credential)
|
|
9725
|
-
? coreHttp.bearerTokenAuthenticationPolicy(credential, scope)
|
|
9726
|
-
: createSearchApiKeyCredentialPolicy(credential);
|
|
9727
|
-
const pipeline = coreHttp.createPipelineFromOptions(internalPipelineOptions, requestPolicyFactory);
|
|
9728
|
-
if (Array.isArray(pipeline.requestPolicyFactories)) {
|
|
9729
|
-
pipeline.requestPolicyFactories.unshift(odataMetadataPolicy("minimal"));
|
|
9730
|
-
}
|
|
9731
|
-
let apiVersion = this.apiVersion;
|
|
9732
|
-
if (options.apiVersion) {
|
|
9733
|
-
if (!["2020-06-30-Preview", "2020-06-30"].includes(options.apiVersion)) {
|
|
9734
|
-
throw new Error(`Invalid Api Version: ${options.apiVersion}`);
|
|
9735
|
-
}
|
|
9736
|
-
apiVersion = options.apiVersion;
|
|
9487
|
+
this.client.pipeline.addPolicy(createSearchApiKeyCredentialPolicy(credential));
|
|
9737
9488
|
}
|
|
9738
|
-
this.client
|
|
9489
|
+
this.client.pipeline.addPolicy(createOdataMetadataPolicy("minimal"));
|
|
9739
9490
|
}
|
|
9740
9491
|
listIndexesPage(options = {}) {
|
|
9741
9492
|
return tslib.__asyncGenerator(this, arguments, function* listIndexesPage_1() {
|
|
9742
9493
|
const { span, updatedOptions } = createSpan("SearchIndexClient-listIndexesPage", options);
|
|
9743
9494
|
try {
|
|
9744
|
-
const result = yield tslib.__await(this.client.indexes.list(
|
|
9495
|
+
const result = yield tslib.__await(this.client.indexes.list(updatedOptions));
|
|
9745
9496
|
const mapped = result.indexes.map(generatedIndexToPublicIndex);
|
|
9746
9497
|
yield yield tslib.__await(mapped);
|
|
9747
9498
|
}
|
|
9748
9499
|
catch (e) {
|
|
9749
9500
|
span.setStatus({
|
|
9750
|
-
|
|
9751
|
-
|
|
9501
|
+
status: "error",
|
|
9502
|
+
error: e.message,
|
|
9752
9503
|
});
|
|
9753
9504
|
throw e;
|
|
9754
9505
|
}
|
|
@@ -9759,17 +9510,24 @@ class SearchIndexClient {
|
|
|
9759
9510
|
}
|
|
9760
9511
|
listIndexesAll(options = {}) {
|
|
9761
9512
|
return tslib.__asyncGenerator(this, arguments, function* listIndexesAll_1() {
|
|
9762
|
-
var e_1,
|
|
9513
|
+
var _a, e_1, _b, _c;
|
|
9763
9514
|
try {
|
|
9764
|
-
for (var
|
|
9765
|
-
|
|
9766
|
-
|
|
9515
|
+
for (var _d = true, _e = tslib.__asyncValues(this.listIndexesPage(options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
|
|
9516
|
+
_c = _f.value;
|
|
9517
|
+
_d = false;
|
|
9518
|
+
try {
|
|
9519
|
+
const page = _c;
|
|
9520
|
+
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
|
|
9521
|
+
}
|
|
9522
|
+
finally {
|
|
9523
|
+
_d = true;
|
|
9524
|
+
}
|
|
9767
9525
|
}
|
|
9768
9526
|
}
|
|
9769
9527
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
9770
9528
|
finally {
|
|
9771
9529
|
try {
|
|
9772
|
-
if (
|
|
9530
|
+
if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
|
|
9773
9531
|
}
|
|
9774
9532
|
finally { if (e_1) throw e_1.error; }
|
|
9775
9533
|
}
|
|
@@ -9790,21 +9548,21 @@ class SearchIndexClient {
|
|
|
9790
9548
|
},
|
|
9791
9549
|
byPage: () => {
|
|
9792
9550
|
return this.listIndexesPage(options);
|
|
9793
|
-
}
|
|
9551
|
+
},
|
|
9794
9552
|
};
|
|
9795
9553
|
}
|
|
9796
9554
|
listIndexesNamesPage(options = {}) {
|
|
9797
9555
|
return tslib.__asyncGenerator(this, arguments, function* listIndexesNamesPage_1() {
|
|
9798
9556
|
const { span, updatedOptions } = createSpan("SearchIndexClient-listIndexesNamesPage", options);
|
|
9799
9557
|
try {
|
|
9800
|
-
const result = yield tslib.__await(this.client.indexes.list(Object.assign(Object.assign({},
|
|
9558
|
+
const result = yield tslib.__await(this.client.indexes.list(Object.assign(Object.assign({}, updatedOptions), { select: "name" })));
|
|
9801
9559
|
const mapped = result.indexes.map((idx) => idx.name);
|
|
9802
9560
|
yield yield tslib.__await(mapped);
|
|
9803
9561
|
}
|
|
9804
9562
|
catch (e) {
|
|
9805
9563
|
span.setStatus({
|
|
9806
|
-
|
|
9807
|
-
|
|
9564
|
+
status: "error",
|
|
9565
|
+
error: e.message,
|
|
9808
9566
|
});
|
|
9809
9567
|
throw e;
|
|
9810
9568
|
}
|
|
@@ -9815,17 +9573,24 @@ class SearchIndexClient {
|
|
|
9815
9573
|
}
|
|
9816
9574
|
listIndexesNamesAll(options = {}) {
|
|
9817
9575
|
return tslib.__asyncGenerator(this, arguments, function* listIndexesNamesAll_1() {
|
|
9818
|
-
var e_2,
|
|
9576
|
+
var _a, e_2, _b, _c;
|
|
9819
9577
|
try {
|
|
9820
|
-
for (var
|
|
9821
|
-
|
|
9822
|
-
|
|
9578
|
+
for (var _d = true, _e = tslib.__asyncValues(this.listIndexesNamesPage(options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
|
|
9579
|
+
_c = _f.value;
|
|
9580
|
+
_d = false;
|
|
9581
|
+
try {
|
|
9582
|
+
const page = _c;
|
|
9583
|
+
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
|
|
9584
|
+
}
|
|
9585
|
+
finally {
|
|
9586
|
+
_d = true;
|
|
9587
|
+
}
|
|
9823
9588
|
}
|
|
9824
9589
|
}
|
|
9825
9590
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
9826
9591
|
finally {
|
|
9827
9592
|
try {
|
|
9828
|
-
if (
|
|
9593
|
+
if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
|
|
9829
9594
|
}
|
|
9830
9595
|
finally { if (e_2) throw e_2.error; }
|
|
9831
9596
|
}
|
|
@@ -9846,7 +9611,7 @@ class SearchIndexClient {
|
|
|
9846
9611
|
},
|
|
9847
9612
|
byPage: () => {
|
|
9848
9613
|
return this.listIndexesNamesPage(options);
|
|
9849
|
-
}
|
|
9614
|
+
},
|
|
9850
9615
|
};
|
|
9851
9616
|
}
|
|
9852
9617
|
/**
|
|
@@ -9856,13 +9621,13 @@ class SearchIndexClient {
|
|
|
9856
9621
|
async listSynonymMaps(options = {}) {
|
|
9857
9622
|
const { span, updatedOptions } = createSpan("SearchIndexClient-listSynonymMaps", options);
|
|
9858
9623
|
try {
|
|
9859
|
-
const result = await this.client.synonymMaps.list(
|
|
9624
|
+
const result = await this.client.synonymMaps.list(updatedOptions);
|
|
9860
9625
|
return result.synonymMaps.map(generatedSynonymMapToPublicSynonymMap);
|
|
9861
9626
|
}
|
|
9862
9627
|
catch (e) {
|
|
9863
9628
|
span.setStatus({
|
|
9864
|
-
|
|
9865
|
-
|
|
9629
|
+
status: "error",
|
|
9630
|
+
error: e.message,
|
|
9866
9631
|
});
|
|
9867
9632
|
throw e;
|
|
9868
9633
|
}
|
|
@@ -9877,13 +9642,13 @@ class SearchIndexClient {
|
|
|
9877
9642
|
async listSynonymMapsNames(options = {}) {
|
|
9878
9643
|
const { span, updatedOptions } = createSpan("SearchIndexClient-listSynonymMapsNames", options);
|
|
9879
9644
|
try {
|
|
9880
|
-
const result = await this.client.synonymMaps.list(Object.assign(Object.assign({},
|
|
9645
|
+
const result = await this.client.synonymMaps.list(Object.assign(Object.assign({}, updatedOptions), { select: "name" }));
|
|
9881
9646
|
return result.synonymMaps.map((sm) => sm.name);
|
|
9882
9647
|
}
|
|
9883
9648
|
catch (e) {
|
|
9884
9649
|
span.setStatus({
|
|
9885
|
-
|
|
9886
|
-
|
|
9650
|
+
status: "error",
|
|
9651
|
+
error: e.message,
|
|
9887
9652
|
});
|
|
9888
9653
|
throw e;
|
|
9889
9654
|
}
|
|
@@ -9899,13 +9664,13 @@ class SearchIndexClient {
|
|
|
9899
9664
|
async getIndex(indexName, options = {}) {
|
|
9900
9665
|
const { span, updatedOptions } = createSpan("SearchIndexClient-getIndex", options);
|
|
9901
9666
|
try {
|
|
9902
|
-
const result = await this.client.indexes.get(indexName,
|
|
9667
|
+
const result = await this.client.indexes.get(indexName, updatedOptions);
|
|
9903
9668
|
return generatedIndexToPublicIndex(result);
|
|
9904
9669
|
}
|
|
9905
9670
|
catch (e) {
|
|
9906
9671
|
span.setStatus({
|
|
9907
|
-
|
|
9908
|
-
|
|
9672
|
+
status: "error",
|
|
9673
|
+
error: e.message,
|
|
9909
9674
|
});
|
|
9910
9675
|
throw e;
|
|
9911
9676
|
}
|
|
@@ -9921,13 +9686,13 @@ class SearchIndexClient {
|
|
|
9921
9686
|
async getSynonymMap(synonymMapName, options = {}) {
|
|
9922
9687
|
const { span, updatedOptions } = createSpan("SearchIndexClient-getSynonymMaps", options);
|
|
9923
9688
|
try {
|
|
9924
|
-
const result = await this.client.synonymMaps.get(synonymMapName,
|
|
9689
|
+
const result = await this.client.synonymMaps.get(synonymMapName, updatedOptions);
|
|
9925
9690
|
return generatedSynonymMapToPublicSynonymMap(result);
|
|
9926
9691
|
}
|
|
9927
9692
|
catch (e) {
|
|
9928
9693
|
span.setStatus({
|
|
9929
|
-
|
|
9930
|
-
|
|
9694
|
+
status: "error",
|
|
9695
|
+
error: e.message,
|
|
9931
9696
|
});
|
|
9932
9697
|
throw e;
|
|
9933
9698
|
}
|
|
@@ -9943,13 +9708,13 @@ class SearchIndexClient {
|
|
|
9943
9708
|
async createIndex(index, options = {}) {
|
|
9944
9709
|
const { span, updatedOptions } = createSpan("SearchIndexClient-createIndex", options);
|
|
9945
9710
|
try {
|
|
9946
|
-
const result = await this.client.indexes.create(publicIndexToGeneratedIndex(index),
|
|
9711
|
+
const result = await this.client.indexes.create(publicIndexToGeneratedIndex(index), updatedOptions);
|
|
9947
9712
|
return generatedIndexToPublicIndex(result);
|
|
9948
9713
|
}
|
|
9949
9714
|
catch (e) {
|
|
9950
9715
|
span.setStatus({
|
|
9951
|
-
|
|
9952
|
-
|
|
9716
|
+
status: "error",
|
|
9717
|
+
error: e.message,
|
|
9953
9718
|
});
|
|
9954
9719
|
throw e;
|
|
9955
9720
|
}
|
|
@@ -9965,13 +9730,13 @@ class SearchIndexClient {
|
|
|
9965
9730
|
async createSynonymMap(synonymMap, options = {}) {
|
|
9966
9731
|
const { span, updatedOptions } = createSpan("SearchIndexClient-createSynonymMaps", options);
|
|
9967
9732
|
try {
|
|
9968
|
-
const result = await this.client.synonymMaps.create(publicSynonymMapToGeneratedSynonymMap(synonymMap),
|
|
9733
|
+
const result = await this.client.synonymMaps.create(publicSynonymMapToGeneratedSynonymMap(synonymMap), updatedOptions);
|
|
9969
9734
|
return generatedSynonymMapToPublicSynonymMap(result);
|
|
9970
9735
|
}
|
|
9971
9736
|
catch (e) {
|
|
9972
9737
|
span.setStatus({
|
|
9973
|
-
|
|
9974
|
-
|
|
9738
|
+
status: "error",
|
|
9739
|
+
error: e.message,
|
|
9975
9740
|
});
|
|
9976
9741
|
throw e;
|
|
9977
9742
|
}
|
|
@@ -9988,13 +9753,13 @@ class SearchIndexClient {
|
|
|
9988
9753
|
const { span, updatedOptions } = createSpan("SearchIndexClient-createOrUpdateIndex", options);
|
|
9989
9754
|
try {
|
|
9990
9755
|
const etag = options.onlyIfUnchanged ? index.etag : undefined;
|
|
9991
|
-
const result = await this.client.indexes.createOrUpdate(index.name, publicIndexToGeneratedIndex(index), Object.assign(Object.assign({},
|
|
9756
|
+
const result = await this.client.indexes.createOrUpdate(index.name, publicIndexToGeneratedIndex(index), Object.assign(Object.assign({}, updatedOptions), { ifMatch: etag }));
|
|
9992
9757
|
return generatedIndexToPublicIndex(result);
|
|
9993
9758
|
}
|
|
9994
9759
|
catch (e) {
|
|
9995
9760
|
span.setStatus({
|
|
9996
|
-
|
|
9997
|
-
|
|
9761
|
+
status: "error",
|
|
9762
|
+
error: e.message,
|
|
9998
9763
|
});
|
|
9999
9764
|
throw e;
|
|
10000
9765
|
}
|
|
@@ -10011,13 +9776,13 @@ class SearchIndexClient {
|
|
|
10011
9776
|
const { span, updatedOptions } = createSpan("SearchIndexClient-createOrUpdateSynonymMap", options);
|
|
10012
9777
|
try {
|
|
10013
9778
|
const etag = options.onlyIfUnchanged ? synonymMap.etag : undefined;
|
|
10014
|
-
const result = await this.client.synonymMaps.createOrUpdate(synonymMap.name, publicSynonymMapToGeneratedSynonymMap(synonymMap), Object.assign(Object.assign({},
|
|
9779
|
+
const result = await this.client.synonymMaps.createOrUpdate(synonymMap.name, publicSynonymMapToGeneratedSynonymMap(synonymMap), Object.assign(Object.assign({}, updatedOptions), { ifMatch: etag }));
|
|
10015
9780
|
return generatedSynonymMapToPublicSynonymMap(result);
|
|
10016
9781
|
}
|
|
10017
9782
|
catch (e) {
|
|
10018
9783
|
span.setStatus({
|
|
10019
|
-
|
|
10020
|
-
|
|
9784
|
+
status: "error",
|
|
9785
|
+
error: e.message,
|
|
10021
9786
|
});
|
|
10022
9787
|
throw e;
|
|
10023
9788
|
}
|
|
@@ -10035,12 +9800,12 @@ class SearchIndexClient {
|
|
|
10035
9800
|
try {
|
|
10036
9801
|
const indexName = typeof index === "string" ? index : index.name;
|
|
10037
9802
|
const etag = typeof index === "string" ? undefined : options.onlyIfUnchanged ? index.etag : undefined;
|
|
10038
|
-
await this.client.indexes.delete(indexName, Object.assign(Object.assign({},
|
|
9803
|
+
await this.client.indexes.delete(indexName, Object.assign(Object.assign({}, updatedOptions), { ifMatch: etag }));
|
|
10039
9804
|
}
|
|
10040
9805
|
catch (e) {
|
|
10041
9806
|
span.setStatus({
|
|
10042
|
-
|
|
10043
|
-
|
|
9807
|
+
status: "error",
|
|
9808
|
+
error: e.message,
|
|
10044
9809
|
});
|
|
10045
9810
|
throw e;
|
|
10046
9811
|
}
|
|
@@ -10062,12 +9827,12 @@ class SearchIndexClient {
|
|
|
10062
9827
|
: options.onlyIfUnchanged
|
|
10063
9828
|
? synonymMap.etag
|
|
10064
9829
|
: undefined;
|
|
10065
|
-
await this.client.synonymMaps.delete(synonymMapName, Object.assign(Object.assign({},
|
|
9830
|
+
await this.client.synonymMaps.delete(synonymMapName, Object.assign(Object.assign({}, updatedOptions), { ifMatch: etag }));
|
|
10066
9831
|
}
|
|
10067
9832
|
catch (e) {
|
|
10068
9833
|
span.setStatus({
|
|
10069
|
-
|
|
10070
|
-
|
|
9834
|
+
status: "error",
|
|
9835
|
+
error: e.message,
|
|
10071
9836
|
});
|
|
10072
9837
|
throw e;
|
|
10073
9838
|
}
|
|
@@ -10084,13 +9849,13 @@ class SearchIndexClient {
|
|
|
10084
9849
|
async getIndexStatistics(indexName, options = {}) {
|
|
10085
9850
|
const { span, updatedOptions } = createSpan("SearchIndexClient-getIndexStatistics", options);
|
|
10086
9851
|
try {
|
|
10087
|
-
const result = await this.client.indexes.getStatistics(indexName,
|
|
9852
|
+
const result = await this.client.indexes.getStatistics(indexName, updatedOptions);
|
|
10088
9853
|
return result;
|
|
10089
9854
|
}
|
|
10090
9855
|
catch (e) {
|
|
10091
9856
|
span.setStatus({
|
|
10092
|
-
|
|
10093
|
-
|
|
9857
|
+
status: "error",
|
|
9858
|
+
error: e.message,
|
|
10094
9859
|
});
|
|
10095
9860
|
throw e;
|
|
10096
9861
|
}
|
|
@@ -10105,16 +9870,21 @@ class SearchIndexClient {
|
|
|
10105
9870
|
* @param options - Additional arguments
|
|
10106
9871
|
*/
|
|
10107
9872
|
async analyzeText(indexName, options) {
|
|
10108
|
-
const {
|
|
9873
|
+
const { abortSignal, requestOptions, tracingOptions } = options, restOptions = tslib.__rest(options, ["abortSignal", "requestOptions", "tracingOptions"]);
|
|
9874
|
+
const operationOptions = {
|
|
9875
|
+
abortSignal,
|
|
9876
|
+
requestOptions,
|
|
9877
|
+
tracingOptions,
|
|
9878
|
+
};
|
|
10109
9879
|
const { span, updatedOptions } = createSpan("SearchIndexClient-analyzeText", operationOptions);
|
|
10110
9880
|
try {
|
|
10111
|
-
const result = await this.client.indexes.analyze(indexName, Object.assign(Object.assign({}, restOptions), { analyzer: restOptions.analyzerName, tokenizer: restOptions.tokenizerName }),
|
|
9881
|
+
const result = await this.client.indexes.analyze(indexName, Object.assign(Object.assign({}, restOptions), { analyzer: restOptions.analyzerName, tokenizer: restOptions.tokenizerName }), updatedOptions);
|
|
10112
9882
|
return result;
|
|
10113
9883
|
}
|
|
10114
9884
|
catch (e) {
|
|
10115
9885
|
span.setStatus({
|
|
10116
|
-
|
|
10117
|
-
|
|
9886
|
+
status: "error",
|
|
9887
|
+
error: e.message,
|
|
10118
9888
|
});
|
|
10119
9889
|
throw e;
|
|
10120
9890
|
}
|
|
@@ -10129,13 +9899,13 @@ class SearchIndexClient {
|
|
|
10129
9899
|
async getServiceStatistics(options = {}) {
|
|
10130
9900
|
const { span, updatedOptions } = createSpan("SearchIndexClient-getServiceStatistics", options);
|
|
10131
9901
|
try {
|
|
10132
|
-
const result = await this.client.getServiceStatistics(
|
|
9902
|
+
const result = await this.client.getServiceStatistics(updatedOptions);
|
|
10133
9903
|
return result;
|
|
10134
9904
|
}
|
|
10135
9905
|
catch (e) {
|
|
10136
9906
|
span.setStatus({
|
|
10137
|
-
|
|
10138
|
-
|
|
9907
|
+
status: "error",
|
|
9908
|
+
error: e.message,
|
|
10139
9909
|
});
|
|
10140
9910
|
throw e;
|
|
10141
9911
|
}
|
|
@@ -10147,9 +9917,13 @@ class SearchIndexClient {
|
|
|
10147
9917
|
* Retrieves the SearchClient corresponding to this SearchIndexClient
|
|
10148
9918
|
* @param indexName - Name of the index
|
|
10149
9919
|
* @param options - SearchClient Options
|
|
9920
|
+
* @typeParam TModel - An optional type that represents the documents stored in
|
|
9921
|
+
* the search index. For the best typing experience, all non-key fields should
|
|
9922
|
+
* be marked optional and nullable, and the key property should have the
|
|
9923
|
+
* non-nullable type `string`.
|
|
10150
9924
|
*/
|
|
10151
9925
|
getSearchClient(indexName, options) {
|
|
10152
|
-
return new SearchClient
|
|
9926
|
+
return new SearchClient(this.endpoint, indexName, this.credential, options || this.options);
|
|
10153
9927
|
}
|
|
10154
9928
|
}
|
|
10155
9929
|
|
|
@@ -10177,52 +9951,41 @@ class SearchIndexerClient {
|
|
|
10177
9951
|
* @param options - Used to configure the Search client.
|
|
10178
9952
|
*/
|
|
10179
9953
|
constructor(endpoint, credential, options = {}) {
|
|
9954
|
+
var _a, _b;
|
|
10180
9955
|
/**
|
|
10181
9956
|
* The API version to use when communicating with the service.
|
|
10182
9957
|
*/
|
|
10183
|
-
this.apiVersion =
|
|
9958
|
+
this.apiVersion = defaultServiceVersion;
|
|
10184
9959
|
this.endpoint = endpoint;
|
|
10185
9960
|
const libInfo = `azsdk-js-search-documents/${SDK_VERSION}`;
|
|
10186
|
-
|
|
10187
|
-
|
|
10188
|
-
|
|
10189
|
-
|
|
10190
|
-
|
|
9961
|
+
const userAgentOptions = Object.assign(Object.assign({}, options.userAgentOptions), { userAgentPrefix: ((_a = options.userAgentOptions) === null || _a === void 0 ? void 0 : _a.userAgentPrefix)
|
|
9962
|
+
? `${options.userAgentOptions.userAgentPrefix} ${libInfo}`
|
|
9963
|
+
: libInfo });
|
|
9964
|
+
const loggingOptions = {
|
|
9965
|
+
logger: logger.info,
|
|
9966
|
+
additionalAllowedHeaderNames: [
|
|
9967
|
+
"elapsed-time",
|
|
9968
|
+
"Location",
|
|
9969
|
+
"OData-MaxVersion",
|
|
9970
|
+
"OData-Version",
|
|
9971
|
+
"Prefer",
|
|
9972
|
+
"throttle-reason",
|
|
9973
|
+
],
|
|
9974
|
+
};
|
|
9975
|
+
const internalClientPipelineOptions = Object.assign(Object.assign({}, options), { userAgentOptions,
|
|
9976
|
+
loggingOptions });
|
|
9977
|
+
this.apiVersion = (_b = options.apiVersion) !== null && _b !== void 0 ? _b : defaultServiceVersion;
|
|
9978
|
+
this.client = new SearchServiceClient(this.endpoint, this.apiVersion, internalClientPipelineOptions);
|
|
9979
|
+
if (coreAuth.isTokenCredential(credential)) {
|
|
9980
|
+
const scope = options.audience
|
|
9981
|
+
? `${options.audience}/.default`
|
|
9982
|
+
: `${exports.KnownSearchAudience.AzurePublicCloud}/.default`;
|
|
9983
|
+
this.client.pipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({ credential, scopes: scope }));
|
|
10191
9984
|
}
|
|
10192
9985
|
else {
|
|
10193
|
-
|
|
10194
|
-
}
|
|
10195
|
-
const internalPipelineOptions = Object.assign(Object.assign({}, options), {
|
|
10196
|
-
loggingOptions: {
|
|
10197
|
-
logger: logger.info,
|
|
10198
|
-
allowedHeaderNames: [
|
|
10199
|
-
"elapsed-time",
|
|
10200
|
-
"Location",
|
|
10201
|
-
"OData-MaxVersion",
|
|
10202
|
-
"OData-Version",
|
|
10203
|
-
"Prefer",
|
|
10204
|
-
"throttle-reason"
|
|
10205
|
-
]
|
|
10206
|
-
}
|
|
10207
|
-
});
|
|
10208
|
-
const scope = options.audience
|
|
10209
|
-
? `${options.audience}/.default`
|
|
10210
|
-
: `${exports.KnownSearchAudience.AzurePublicCloud}/.default`;
|
|
10211
|
-
const requestPolicyFactory = coreAuth.isTokenCredential(credential)
|
|
10212
|
-
? coreHttp.bearerTokenAuthenticationPolicy(credential, scope)
|
|
10213
|
-
: createSearchApiKeyCredentialPolicy(credential);
|
|
10214
|
-
const pipeline = coreHttp.createPipelineFromOptions(internalPipelineOptions, requestPolicyFactory);
|
|
10215
|
-
if (Array.isArray(pipeline.requestPolicyFactories)) {
|
|
10216
|
-
pipeline.requestPolicyFactories.unshift(odataMetadataPolicy("minimal"));
|
|
10217
|
-
}
|
|
10218
|
-
let apiVersion = this.apiVersion;
|
|
10219
|
-
if (options.apiVersion) {
|
|
10220
|
-
if (!["2020-06-30-Preview", "2020-06-30"].includes(options.apiVersion)) {
|
|
10221
|
-
throw new Error(`Invalid Api Version: ${options.apiVersion}`);
|
|
10222
|
-
}
|
|
10223
|
-
apiVersion = options.apiVersion;
|
|
9986
|
+
this.client.pipeline.addPolicy(createSearchApiKeyCredentialPolicy(credential));
|
|
10224
9987
|
}
|
|
10225
|
-
this.client
|
|
9988
|
+
this.client.pipeline.addPolicy(createOdataMetadataPolicy("minimal"));
|
|
10226
9989
|
}
|
|
10227
9990
|
/**
|
|
10228
9991
|
* Retrieves a list of existing indexers in the service.
|
|
@@ -10231,13 +9994,13 @@ class SearchIndexerClient {
|
|
|
10231
9994
|
async listIndexers(options = {}) {
|
|
10232
9995
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-listIndexers", options);
|
|
10233
9996
|
try {
|
|
10234
|
-
const result = await this.client.indexers.list(
|
|
9997
|
+
const result = await this.client.indexers.list(updatedOptions);
|
|
10235
9998
|
return result.indexers.map(generatedSearchIndexerToPublicSearchIndexer);
|
|
10236
9999
|
}
|
|
10237
10000
|
catch (e) {
|
|
10238
10001
|
span.setStatus({
|
|
10239
|
-
|
|
10240
|
-
|
|
10002
|
+
status: "error",
|
|
10003
|
+
error: e.message,
|
|
10241
10004
|
});
|
|
10242
10005
|
throw e;
|
|
10243
10006
|
}
|
|
@@ -10252,13 +10015,13 @@ class SearchIndexerClient {
|
|
|
10252
10015
|
async listIndexersNames(options = {}) {
|
|
10253
10016
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-listIndexersNames", options);
|
|
10254
10017
|
try {
|
|
10255
|
-
const result = await this.client.indexers.list(Object.assign(Object.assign({},
|
|
10018
|
+
const result = await this.client.indexers.list(Object.assign(Object.assign({}, updatedOptions), { select: "name" }));
|
|
10256
10019
|
return result.indexers.map((idx) => idx.name);
|
|
10257
10020
|
}
|
|
10258
10021
|
catch (e) {
|
|
10259
10022
|
span.setStatus({
|
|
10260
|
-
|
|
10261
|
-
|
|
10023
|
+
status: "error",
|
|
10024
|
+
error: e.message,
|
|
10262
10025
|
});
|
|
10263
10026
|
throw e;
|
|
10264
10027
|
}
|
|
@@ -10273,13 +10036,13 @@ class SearchIndexerClient {
|
|
|
10273
10036
|
async listDataSourceConnections(options = {}) {
|
|
10274
10037
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-listDataSourceConnections", options);
|
|
10275
10038
|
try {
|
|
10276
|
-
const result = await this.client.dataSources.list(
|
|
10039
|
+
const result = await this.client.dataSources.list(updatedOptions);
|
|
10277
10040
|
return result.dataSources.map(generatedDataSourceToPublicDataSource);
|
|
10278
10041
|
}
|
|
10279
10042
|
catch (e) {
|
|
10280
10043
|
span.setStatus({
|
|
10281
|
-
|
|
10282
|
-
|
|
10044
|
+
status: "error",
|
|
10045
|
+
error: e.message,
|
|
10283
10046
|
});
|
|
10284
10047
|
throw e;
|
|
10285
10048
|
}
|
|
@@ -10294,13 +10057,13 @@ class SearchIndexerClient {
|
|
|
10294
10057
|
async listDataSourceConnectionsNames(options = {}) {
|
|
10295
10058
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-listDataSourceConnectionsNames", options);
|
|
10296
10059
|
try {
|
|
10297
|
-
const result = await this.client.dataSources.list(Object.assign(Object.assign({},
|
|
10060
|
+
const result = await this.client.dataSources.list(Object.assign(Object.assign({}, updatedOptions), { select: "name" }));
|
|
10298
10061
|
return result.dataSources.map((ds) => ds.name);
|
|
10299
10062
|
}
|
|
10300
10063
|
catch (e) {
|
|
10301
10064
|
span.setStatus({
|
|
10302
|
-
|
|
10303
|
-
|
|
10065
|
+
status: "error",
|
|
10066
|
+
error: e.message,
|
|
10304
10067
|
});
|
|
10305
10068
|
throw e;
|
|
10306
10069
|
}
|
|
@@ -10315,13 +10078,13 @@ class SearchIndexerClient {
|
|
|
10315
10078
|
async listSkillsets(options = {}) {
|
|
10316
10079
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-listSkillsets", options);
|
|
10317
10080
|
try {
|
|
10318
|
-
const result = await this.client.skillsets.list(
|
|
10081
|
+
const result = await this.client.skillsets.list(updatedOptions);
|
|
10319
10082
|
return result.skillsets.map(generatedSkillsetToPublicSkillset);
|
|
10320
10083
|
}
|
|
10321
10084
|
catch (e) {
|
|
10322
10085
|
span.setStatus({
|
|
10323
|
-
|
|
10324
|
-
|
|
10086
|
+
status: "error",
|
|
10087
|
+
error: e.message,
|
|
10325
10088
|
});
|
|
10326
10089
|
throw e;
|
|
10327
10090
|
}
|
|
@@ -10336,13 +10099,13 @@ class SearchIndexerClient {
|
|
|
10336
10099
|
async listSkillsetsNames(options = {}) {
|
|
10337
10100
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-listSkillsetsNames", options);
|
|
10338
10101
|
try {
|
|
10339
|
-
const result = await this.client.skillsets.list(Object.assign(Object.assign({},
|
|
10102
|
+
const result = await this.client.skillsets.list(Object.assign(Object.assign({}, updatedOptions), { select: "name" }));
|
|
10340
10103
|
return result.skillsets.map((sks) => sks.name);
|
|
10341
10104
|
}
|
|
10342
10105
|
catch (e) {
|
|
10343
10106
|
span.setStatus({
|
|
10344
|
-
|
|
10345
|
-
|
|
10107
|
+
status: "error",
|
|
10108
|
+
error: e.message,
|
|
10346
10109
|
});
|
|
10347
10110
|
throw e;
|
|
10348
10111
|
}
|
|
@@ -10358,13 +10121,13 @@ class SearchIndexerClient {
|
|
|
10358
10121
|
async getIndexer(indexerName, options = {}) {
|
|
10359
10122
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-getIndexer", options);
|
|
10360
10123
|
try {
|
|
10361
|
-
const result = await this.client.indexers.get(indexerName,
|
|
10124
|
+
const result = await this.client.indexers.get(indexerName, updatedOptions);
|
|
10362
10125
|
return generatedSearchIndexerToPublicSearchIndexer(result);
|
|
10363
10126
|
}
|
|
10364
10127
|
catch (e) {
|
|
10365
10128
|
span.setStatus({
|
|
10366
|
-
|
|
10367
|
-
|
|
10129
|
+
status: "error",
|
|
10130
|
+
error: e.message,
|
|
10368
10131
|
});
|
|
10369
10132
|
throw e;
|
|
10370
10133
|
}
|
|
@@ -10380,13 +10143,13 @@ class SearchIndexerClient {
|
|
|
10380
10143
|
async getDataSourceConnection(dataSourceConnectionName, options = {}) {
|
|
10381
10144
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-getDataSourceConnection", options);
|
|
10382
10145
|
try {
|
|
10383
|
-
const result = await this.client.dataSources.get(dataSourceConnectionName,
|
|
10146
|
+
const result = await this.client.dataSources.get(dataSourceConnectionName, updatedOptions);
|
|
10384
10147
|
return generatedDataSourceToPublicDataSource(result);
|
|
10385
10148
|
}
|
|
10386
10149
|
catch (e) {
|
|
10387
10150
|
span.setStatus({
|
|
10388
|
-
|
|
10389
|
-
|
|
10151
|
+
status: "error",
|
|
10152
|
+
error: e.message,
|
|
10390
10153
|
});
|
|
10391
10154
|
throw e;
|
|
10392
10155
|
}
|
|
@@ -10402,13 +10165,13 @@ class SearchIndexerClient {
|
|
|
10402
10165
|
async getSkillset(skillsetName, options = {}) {
|
|
10403
10166
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-getSkillset", options);
|
|
10404
10167
|
try {
|
|
10405
|
-
const result = await this.client.skillsets.get(skillsetName,
|
|
10168
|
+
const result = await this.client.skillsets.get(skillsetName, updatedOptions);
|
|
10406
10169
|
return generatedSkillsetToPublicSkillset(result);
|
|
10407
10170
|
}
|
|
10408
10171
|
catch (e) {
|
|
10409
10172
|
span.setStatus({
|
|
10410
|
-
|
|
10411
|
-
|
|
10173
|
+
status: "error",
|
|
10174
|
+
error: e.message,
|
|
10412
10175
|
});
|
|
10413
10176
|
throw e;
|
|
10414
10177
|
}
|
|
@@ -10424,13 +10187,13 @@ class SearchIndexerClient {
|
|
|
10424
10187
|
async createIndexer(indexer, options = {}) {
|
|
10425
10188
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-createIndexer", options);
|
|
10426
10189
|
try {
|
|
10427
|
-
const result = await this.client.indexers.create(publicSearchIndexerToGeneratedSearchIndexer(indexer),
|
|
10190
|
+
const result = await this.client.indexers.create(publicSearchIndexerToGeneratedSearchIndexer(indexer), updatedOptions);
|
|
10428
10191
|
return generatedSearchIndexerToPublicSearchIndexer(result);
|
|
10429
10192
|
}
|
|
10430
10193
|
catch (e) {
|
|
10431
10194
|
span.setStatus({
|
|
10432
|
-
|
|
10433
|
-
|
|
10195
|
+
status: "error",
|
|
10196
|
+
error: e.message,
|
|
10434
10197
|
});
|
|
10435
10198
|
throw e;
|
|
10436
10199
|
}
|
|
@@ -10446,13 +10209,13 @@ class SearchIndexerClient {
|
|
|
10446
10209
|
async createDataSourceConnection(dataSourceConnection, options = {}) {
|
|
10447
10210
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-createDataSourceConnection", options);
|
|
10448
10211
|
try {
|
|
10449
|
-
const result = await this.client.dataSources.create(publicDataSourceToGeneratedDataSource(dataSourceConnection),
|
|
10212
|
+
const result = await this.client.dataSources.create(publicDataSourceToGeneratedDataSource(dataSourceConnection), updatedOptions);
|
|
10450
10213
|
return generatedDataSourceToPublicDataSource(result);
|
|
10451
10214
|
}
|
|
10452
10215
|
catch (e) {
|
|
10453
10216
|
span.setStatus({
|
|
10454
|
-
|
|
10455
|
-
|
|
10217
|
+
status: "error",
|
|
10218
|
+
error: e.message,
|
|
10456
10219
|
});
|
|
10457
10220
|
throw e;
|
|
10458
10221
|
}
|
|
@@ -10468,13 +10231,13 @@ class SearchIndexerClient {
|
|
|
10468
10231
|
async createSkillset(skillset, options = {}) {
|
|
10469
10232
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-createSkillset", options);
|
|
10470
10233
|
try {
|
|
10471
|
-
const result = await this.client.skillsets.create(publicSkillsetToGeneratedSkillset(skillset),
|
|
10234
|
+
const result = await this.client.skillsets.create(publicSkillsetToGeneratedSkillset(skillset), updatedOptions);
|
|
10472
10235
|
return generatedSkillsetToPublicSkillset(result);
|
|
10473
10236
|
}
|
|
10474
10237
|
catch (e) {
|
|
10475
10238
|
span.setStatus({
|
|
10476
|
-
|
|
10477
|
-
|
|
10239
|
+
status: "error",
|
|
10240
|
+
error: e.message,
|
|
10478
10241
|
});
|
|
10479
10242
|
throw e;
|
|
10480
10243
|
}
|
|
@@ -10491,13 +10254,13 @@ class SearchIndexerClient {
|
|
|
10491
10254
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-createOrUpdateIndexer", options);
|
|
10492
10255
|
try {
|
|
10493
10256
|
const etag = options.onlyIfUnchanged ? indexer.etag : undefined;
|
|
10494
|
-
const result = await this.client.indexers.createOrUpdate(indexer.name, publicSearchIndexerToGeneratedSearchIndexer(indexer), Object.assign(Object.assign({},
|
|
10257
|
+
const result = await this.client.indexers.createOrUpdate(indexer.name, publicSearchIndexerToGeneratedSearchIndexer(indexer), Object.assign(Object.assign({}, updatedOptions), { ifMatch: etag }));
|
|
10495
10258
|
return generatedSearchIndexerToPublicSearchIndexer(result);
|
|
10496
10259
|
}
|
|
10497
10260
|
catch (e) {
|
|
10498
10261
|
span.setStatus({
|
|
10499
|
-
|
|
10500
|
-
|
|
10262
|
+
status: "error",
|
|
10263
|
+
error: e.message,
|
|
10501
10264
|
});
|
|
10502
10265
|
throw e;
|
|
10503
10266
|
}
|
|
@@ -10514,13 +10277,13 @@ class SearchIndexerClient {
|
|
|
10514
10277
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-createOrUpdateDataSourceConnection", options);
|
|
10515
10278
|
try {
|
|
10516
10279
|
const etag = options.onlyIfUnchanged ? dataSourceConnection.etag : undefined;
|
|
10517
|
-
const result = await this.client.dataSources.createOrUpdate(dataSourceConnection.name, publicDataSourceToGeneratedDataSource(dataSourceConnection), Object.assign(Object.assign({},
|
|
10280
|
+
const result = await this.client.dataSources.createOrUpdate(dataSourceConnection.name, publicDataSourceToGeneratedDataSource(dataSourceConnection), Object.assign(Object.assign({}, updatedOptions), { ifMatch: etag }));
|
|
10518
10281
|
return generatedDataSourceToPublicDataSource(result);
|
|
10519
10282
|
}
|
|
10520
10283
|
catch (e) {
|
|
10521
10284
|
span.setStatus({
|
|
10522
|
-
|
|
10523
|
-
|
|
10285
|
+
status: "error",
|
|
10286
|
+
error: e.message,
|
|
10524
10287
|
});
|
|
10525
10288
|
throw e;
|
|
10526
10289
|
}
|
|
@@ -10537,13 +10300,13 @@ class SearchIndexerClient {
|
|
|
10537
10300
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-createOrUpdateSkillset", options);
|
|
10538
10301
|
try {
|
|
10539
10302
|
const etag = options.onlyIfUnchanged ? skillset.etag : undefined;
|
|
10540
|
-
const result = await this.client.skillsets.createOrUpdate(skillset.name, publicSkillsetToGeneratedSkillset(skillset), Object.assign(Object.assign({},
|
|
10303
|
+
const result = await this.client.skillsets.createOrUpdate(skillset.name, publicSkillsetToGeneratedSkillset(skillset), Object.assign(Object.assign({}, updatedOptions), { ifMatch: etag }));
|
|
10541
10304
|
return generatedSkillsetToPublicSkillset(result);
|
|
10542
10305
|
}
|
|
10543
10306
|
catch (e) {
|
|
10544
10307
|
span.setStatus({
|
|
10545
|
-
|
|
10546
|
-
|
|
10308
|
+
status: "error",
|
|
10309
|
+
error: e.message,
|
|
10547
10310
|
});
|
|
10548
10311
|
throw e;
|
|
10549
10312
|
}
|
|
@@ -10565,12 +10328,12 @@ class SearchIndexerClient {
|
|
|
10565
10328
|
: options.onlyIfUnchanged
|
|
10566
10329
|
? indexer.etag
|
|
10567
10330
|
: undefined;
|
|
10568
|
-
await this.client.indexers.delete(indexerName, Object.assign(Object.assign({},
|
|
10331
|
+
await this.client.indexers.delete(indexerName, Object.assign(Object.assign({}, updatedOptions), { ifMatch: etag }));
|
|
10569
10332
|
}
|
|
10570
10333
|
catch (e) {
|
|
10571
10334
|
span.setStatus({
|
|
10572
|
-
|
|
10573
|
-
|
|
10335
|
+
status: "error",
|
|
10336
|
+
error: e.message,
|
|
10574
10337
|
});
|
|
10575
10338
|
throw e;
|
|
10576
10339
|
}
|
|
@@ -10592,12 +10355,12 @@ class SearchIndexerClient {
|
|
|
10592
10355
|
: options.onlyIfUnchanged
|
|
10593
10356
|
? dataSourceConnection.etag
|
|
10594
10357
|
: undefined;
|
|
10595
|
-
await this.client.dataSources.delete(dataSourceConnectionName, Object.assign(Object.assign({},
|
|
10358
|
+
await this.client.dataSources.delete(dataSourceConnectionName, Object.assign(Object.assign({}, updatedOptions), { ifMatch: etag }));
|
|
10596
10359
|
}
|
|
10597
10360
|
catch (e) {
|
|
10598
10361
|
span.setStatus({
|
|
10599
|
-
|
|
10600
|
-
|
|
10362
|
+
status: "error",
|
|
10363
|
+
error: e.message,
|
|
10601
10364
|
});
|
|
10602
10365
|
throw e;
|
|
10603
10366
|
}
|
|
@@ -10619,12 +10382,12 @@ class SearchIndexerClient {
|
|
|
10619
10382
|
: options.onlyIfUnchanged
|
|
10620
10383
|
? skillset.etag
|
|
10621
10384
|
: undefined;
|
|
10622
|
-
await this.client.skillsets.delete(skillsetName, Object.assign(Object.assign({},
|
|
10385
|
+
await this.client.skillsets.delete(skillsetName, Object.assign(Object.assign({}, updatedOptions), { ifMatch: etag }));
|
|
10623
10386
|
}
|
|
10624
10387
|
catch (e) {
|
|
10625
10388
|
span.setStatus({
|
|
10626
|
-
|
|
10627
|
-
|
|
10389
|
+
status: "error",
|
|
10390
|
+
error: e.message,
|
|
10628
10391
|
});
|
|
10629
10392
|
throw e;
|
|
10630
10393
|
}
|
|
@@ -10640,13 +10403,13 @@ class SearchIndexerClient {
|
|
|
10640
10403
|
async getIndexerStatus(indexerName, options = {}) {
|
|
10641
10404
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-getIndexerStatus", options);
|
|
10642
10405
|
try {
|
|
10643
|
-
const result = await this.client.indexers.getStatus(indexerName,
|
|
10406
|
+
const result = await this.client.indexers.getStatus(indexerName, updatedOptions);
|
|
10644
10407
|
return result;
|
|
10645
10408
|
}
|
|
10646
10409
|
catch (e) {
|
|
10647
10410
|
span.setStatus({
|
|
10648
|
-
|
|
10649
|
-
|
|
10411
|
+
status: "error",
|
|
10412
|
+
error: e.message,
|
|
10650
10413
|
});
|
|
10651
10414
|
throw e;
|
|
10652
10415
|
}
|
|
@@ -10662,12 +10425,12 @@ class SearchIndexerClient {
|
|
|
10662
10425
|
async resetIndexer(indexerName, options = {}) {
|
|
10663
10426
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-resetIndexer", options);
|
|
10664
10427
|
try {
|
|
10665
|
-
await this.client.indexers.reset(indexerName,
|
|
10428
|
+
await this.client.indexers.reset(indexerName, updatedOptions);
|
|
10666
10429
|
}
|
|
10667
10430
|
catch (e) {
|
|
10668
10431
|
span.setStatus({
|
|
10669
|
-
|
|
10670
|
-
|
|
10432
|
+
status: "error",
|
|
10433
|
+
error: e.message,
|
|
10671
10434
|
});
|
|
10672
10435
|
throw e;
|
|
10673
10436
|
}
|
|
@@ -10683,12 +10446,12 @@ class SearchIndexerClient {
|
|
|
10683
10446
|
async runIndexer(indexerName, options = {}) {
|
|
10684
10447
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-runIndexer", options);
|
|
10685
10448
|
try {
|
|
10686
|
-
await this.client.indexers.run(indexerName,
|
|
10449
|
+
await this.client.indexers.run(indexerName, updatedOptions);
|
|
10687
10450
|
}
|
|
10688
10451
|
catch (e) {
|
|
10689
10452
|
span.setStatus({
|
|
10690
|
-
|
|
10691
|
-
|
|
10453
|
+
status: "error",
|
|
10454
|
+
error: e.message,
|
|
10692
10455
|
});
|
|
10693
10456
|
throw e;
|
|
10694
10457
|
}
|
|
@@ -10746,7 +10509,7 @@ function odata(strings, ...values) {
|
|
|
10746
10509
|
}
|
|
10747
10510
|
|
|
10748
10511
|
// Copyright (c) Microsoft Corporation.
|
|
10749
|
-
const readFileAsync = util.promisify(
|
|
10512
|
+
const readFileAsync = util.promisify(fs__namespace.readFile);
|
|
10750
10513
|
/**
|
|
10751
10514
|
* Helper method to create a SynonymMap object. This is a NodeJS only method.
|
|
10752
10515
|
*
|
|
@@ -10755,25 +10518,27 @@ const readFileAsync = util.promisify(fs.readFile);
|
|
|
10755
10518
|
* @returns SynonymMap object
|
|
10756
10519
|
*/
|
|
10757
10520
|
async function createSynonymMapFromFile(name, filePath) {
|
|
10758
|
-
const synonyms = (await readFileAsync(filePath, "utf-8"))
|
|
10521
|
+
const synonyms = (await readFileAsync(filePath, "utf-8"))
|
|
10522
|
+
.replace(/\r/g, "")
|
|
10523
|
+
.split("\n")
|
|
10524
|
+
.map((line) => line.trim())
|
|
10525
|
+
.filter(Boolean);
|
|
10759
10526
|
return {
|
|
10760
10527
|
name,
|
|
10761
|
-
synonyms
|
|
10528
|
+
synonyms,
|
|
10762
10529
|
};
|
|
10763
10530
|
}
|
|
10764
10531
|
|
|
10765
10532
|
Object.defineProperty(exports, 'AzureKeyCredential', {
|
|
10766
10533
|
enumerable: true,
|
|
10767
|
-
get: function () {
|
|
10768
|
-
return coreAuth.AzureKeyCredential;
|
|
10769
|
-
}
|
|
10534
|
+
get: function () { return coreAuth.AzureKeyCredential; }
|
|
10770
10535
|
});
|
|
10771
10536
|
exports.DEFAULT_BATCH_SIZE = DEFAULT_BATCH_SIZE;
|
|
10772
10537
|
exports.DEFAULT_FLUSH_WINDOW = DEFAULT_FLUSH_WINDOW;
|
|
10773
10538
|
exports.DEFAULT_RETRY_COUNT = DEFAULT_RETRY_COUNT;
|
|
10774
10539
|
exports.GeographyPoint = GeographyPoint;
|
|
10775
10540
|
exports.IndexDocumentsBatch = IndexDocumentsBatch;
|
|
10776
|
-
exports.SearchClient = SearchClient
|
|
10541
|
+
exports.SearchClient = SearchClient;
|
|
10777
10542
|
exports.SearchIndexClient = SearchIndexClient;
|
|
10778
10543
|
exports.SearchIndexerClient = SearchIndexerClient;
|
|
10779
10544
|
exports.SearchIndexingBufferedSender = SearchIndexingBufferedSender;
|