@algolia/client-search 5.2.5 → 5.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.d.ts +2485 -1687
- package/dist/builds/browser.js +118 -86
- package/dist/builds/browser.js.map +1 -1
- package/dist/builds/browser.min.js +1 -1
- package/dist/builds/browser.min.js.map +1 -1
- package/dist/builds/browser.umd.js +2 -2
- package/dist/builds/node.cjs +112 -87
- package/dist/builds/node.cjs.map +1 -1
- package/dist/builds/node.js +120 -88
- package/dist/builds/node.js.map +1 -1
- package/dist/node.d.cts +883 -102
- package/dist/node.d.ts +883 -102
- package/dist/src/searchClient.cjs +110 -85
- package/dist/src/searchClient.cjs.map +1 -1
- package/dist/src/searchClient.js +118 -86
- package/dist/src/searchClient.js.map +1 -1
- package/model/clientMethodProps.ts +5 -0
- package/package.json +4 -4
|
@@ -25,7 +25,7 @@ __export(searchClient_exports, {
|
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(searchClient_exports);
|
|
27
27
|
var import_client_common = require("@algolia/client-common");
|
|
28
|
-
var apiClientVersion = "5.
|
|
28
|
+
var apiClientVersion = "5.3.1";
|
|
29
29
|
function getDefaultHosts(appId) {
|
|
30
30
|
return [
|
|
31
31
|
{
|
|
@@ -66,26 +66,25 @@ function createSearchClient({
|
|
|
66
66
|
...options
|
|
67
67
|
}) {
|
|
68
68
|
const auth = (0, import_client_common.createAuth)(appIdOption, apiKeyOption, authMode);
|
|
69
|
-
const transporter = (0, import_client_common.createTransporter)({
|
|
70
|
-
hosts: getDefaultHosts(appIdOption),
|
|
71
|
-
...options,
|
|
72
|
-
algoliaAgent: (0, import_client_common.getAlgoliaAgent)({
|
|
73
|
-
algoliaAgents,
|
|
74
|
-
client: "Search",
|
|
75
|
-
version: apiClientVersion
|
|
76
|
-
}),
|
|
77
|
-
baseHeaders: {
|
|
78
|
-
"content-type": "text/plain",
|
|
79
|
-
...auth.headers(),
|
|
80
|
-
...options.baseHeaders
|
|
81
|
-
},
|
|
82
|
-
baseQueryParameters: {
|
|
83
|
-
...auth.queryParameters(),
|
|
84
|
-
...options.baseQueryParameters
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
69
|
return {
|
|
88
|
-
transporter,
|
|
70
|
+
transporter: (0, import_client_common.createTransporter)({
|
|
71
|
+
hosts: getDefaultHosts(appIdOption),
|
|
72
|
+
...options,
|
|
73
|
+
algoliaAgent: (0, import_client_common.getAlgoliaAgent)({
|
|
74
|
+
algoliaAgents,
|
|
75
|
+
client: "Search",
|
|
76
|
+
version: apiClientVersion
|
|
77
|
+
}),
|
|
78
|
+
baseHeaders: {
|
|
79
|
+
"content-type": "text/plain",
|
|
80
|
+
...auth.headers(),
|
|
81
|
+
...options.baseHeaders
|
|
82
|
+
},
|
|
83
|
+
baseQueryParameters: {
|
|
84
|
+
...auth.queryParameters(),
|
|
85
|
+
...options.baseQueryParameters
|
|
86
|
+
}
|
|
87
|
+
}),
|
|
89
88
|
/**
|
|
90
89
|
* The `appId` currently in use.
|
|
91
90
|
*/
|
|
@@ -94,13 +93,15 @@ function createSearchClient({
|
|
|
94
93
|
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
95
94
|
*/
|
|
96
95
|
clearCache() {
|
|
97
|
-
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(
|
|
96
|
+
return Promise.all([this.transporter.requestsCache.clear(), this.transporter.responsesCache.clear()]).then(
|
|
97
|
+
() => void 0
|
|
98
|
+
);
|
|
98
99
|
},
|
|
99
100
|
/**
|
|
100
101
|
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
101
102
|
*/
|
|
102
103
|
get _ua() {
|
|
103
|
-
return transporter.algoliaAgent.value;
|
|
104
|
+
return this.transporter.algoliaAgent.value;
|
|
104
105
|
},
|
|
105
106
|
/**
|
|
106
107
|
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
|
@@ -109,7 +110,20 @@ function createSearchClient({
|
|
|
109
110
|
* @param version - The version of the agent.
|
|
110
111
|
*/
|
|
111
112
|
addAlgoliaAgent(segment, version) {
|
|
112
|
-
transporter.algoliaAgent.add({ segment, version });
|
|
113
|
+
this.transporter.algoliaAgent.add({ segment, version });
|
|
114
|
+
},
|
|
115
|
+
/**
|
|
116
|
+
* Helper method to switch the API key used to authenticate the requests.
|
|
117
|
+
*
|
|
118
|
+
* @param params - Method params.
|
|
119
|
+
* @param params.apiKey - The new API Key to use.
|
|
120
|
+
*/
|
|
121
|
+
setClientApiKey({ apiKey }) {
|
|
122
|
+
if (!authMode || authMode === "WithinHeaders") {
|
|
123
|
+
this.transporter.baseHeaders["x-algolia-api-key"] = apiKey;
|
|
124
|
+
} else {
|
|
125
|
+
this.transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
|
|
126
|
+
}
|
|
113
127
|
},
|
|
114
128
|
/**
|
|
115
129
|
* Helper: Wait for a task to be published (completed) for a given `indexName` and `taskID`.
|
|
@@ -473,6 +487,17 @@ function createSearchClient({
|
|
|
473
487
|
});
|
|
474
488
|
return { copyOperationResponse, batchResponses, moveOperationResponse };
|
|
475
489
|
},
|
|
490
|
+
async indexExists({ indexName }) {
|
|
491
|
+
try {
|
|
492
|
+
await this.getSettings({ indexName });
|
|
493
|
+
} catch (error) {
|
|
494
|
+
if (error instanceof import_client_common.ApiError && error.status === 404) {
|
|
495
|
+
return false;
|
|
496
|
+
}
|
|
497
|
+
throw error;
|
|
498
|
+
}
|
|
499
|
+
return true;
|
|
500
|
+
},
|
|
476
501
|
/**
|
|
477
502
|
* Helper: calls the `search` method but with certainty that we will only request Algolia records (hits) and not facets.
|
|
478
503
|
* Disclaimer: We don't assert that the parameters you pass to this method only contains `hits` requests to prevent impacting search performances, this helper is purely for typing purposes.
|
|
@@ -521,7 +546,7 @@ function createSearchClient({
|
|
|
521
546
|
headers,
|
|
522
547
|
data: apiKey
|
|
523
548
|
};
|
|
524
|
-
return transporter.request(request, requestOptions);
|
|
549
|
+
return this.transporter.request(request, requestOptions);
|
|
525
550
|
},
|
|
526
551
|
/**
|
|
527
552
|
* If a record with the specified object ID exists, the existing record is replaced. Otherwise, a new record is added to the index. To update _some_ attributes of an existing record, use the [`partial` operation](#tag/Records/operation/partialUpdateObject) instead. To add, update, or replace multiple records, use the [`batch` operation](#tag/Records/operation/batch).
|
|
@@ -555,7 +580,7 @@ function createSearchClient({
|
|
|
555
580
|
headers,
|
|
556
581
|
data: body
|
|
557
582
|
};
|
|
558
|
-
return transporter.request(request, requestOptions);
|
|
583
|
+
return this.transporter.request(request, requestOptions);
|
|
559
584
|
},
|
|
560
585
|
/**
|
|
561
586
|
* Adds a source to the list of allowed sources.
|
|
@@ -583,7 +608,7 @@ function createSearchClient({
|
|
|
583
608
|
headers,
|
|
584
609
|
data: source
|
|
585
610
|
};
|
|
586
|
-
return transporter.request(request, requestOptions);
|
|
611
|
+
return this.transporter.request(request, requestOptions);
|
|
587
612
|
},
|
|
588
613
|
/**
|
|
589
614
|
* Assigns or moves a user ID to a cluster. The time it takes to move a user is proportional to the amount of data linked to the user ID.
|
|
@@ -619,7 +644,7 @@ function createSearchClient({
|
|
|
619
644
|
headers,
|
|
620
645
|
data: assignUserIdParams
|
|
621
646
|
};
|
|
622
|
-
return transporter.request(request, requestOptions);
|
|
647
|
+
return this.transporter.request(request, requestOptions);
|
|
623
648
|
},
|
|
624
649
|
/**
|
|
625
650
|
* Adds, updates, or deletes records in one index with a single API request. Batching index updates reduces latency and increases data integrity. - Actions are applied in the order they\'re specified. - Actions are equivalent to the individual API requests of the same name.
|
|
@@ -649,7 +674,7 @@ function createSearchClient({
|
|
|
649
674
|
headers,
|
|
650
675
|
data: batchWriteParams
|
|
651
676
|
};
|
|
652
|
-
return transporter.request(request, requestOptions);
|
|
677
|
+
return this.transporter.request(request, requestOptions);
|
|
653
678
|
},
|
|
654
679
|
/**
|
|
655
680
|
* Assigns multiple user IDs to a cluster. **You can\'t move users with this operation**.
|
|
@@ -688,7 +713,7 @@ function createSearchClient({
|
|
|
688
713
|
headers,
|
|
689
714
|
data: batchAssignUserIdsParams
|
|
690
715
|
};
|
|
691
|
-
return transporter.request(request, requestOptions);
|
|
716
|
+
return this.transporter.request(request, requestOptions);
|
|
692
717
|
},
|
|
693
718
|
/**
|
|
694
719
|
* Adds or deletes multiple entries from your plurals, segmentation, or stop word dictionaries.
|
|
@@ -726,7 +751,7 @@ function createSearchClient({
|
|
|
726
751
|
headers,
|
|
727
752
|
data: batchDictionaryEntriesParams
|
|
728
753
|
};
|
|
729
|
-
return transporter.request(request, requestOptions);
|
|
754
|
+
return this.transporter.request(request, requestOptions);
|
|
730
755
|
},
|
|
731
756
|
/**
|
|
732
757
|
* Retrieves records from an index, up to 1,000 per request. While searching retrieves _hits_ (records augmented with attributes for highlighting and ranking details), browsing _just_ returns matching records. This can be useful if you want to export your indices. - The Analytics API doesn\'t collect data when using `browse`. - Records are ranked by attributes and custom ranking. - There\'s no ranking for: typo-tolerance, number of matched words, proximity, geo distance. Browse requests automatically apply these settings: - `advancedSyntax`: `false` - `attributesToHighlight`: `[]` - `attributesToSnippet`: `[]` - `distinct`: `false` - `enablePersonalization`: `false` - `enableRules`: `false` - `facets`: `[]` - `getRankingInfo`: `false` - `ignorePlurals`: `false` - `optionalFilters`: `[]` - `typoTolerance`: `true` or `false` (`min` and `strict` is evaluated to `true`) If you send these parameters with your browse requests, they\'ll be ignored.
|
|
@@ -753,7 +778,7 @@ function createSearchClient({
|
|
|
753
778
|
headers,
|
|
754
779
|
data: browseParams ? browseParams : {}
|
|
755
780
|
};
|
|
756
|
-
return transporter.request(request, requestOptions);
|
|
781
|
+
return this.transporter.request(request, requestOptions);
|
|
757
782
|
},
|
|
758
783
|
/**
|
|
759
784
|
* Deletes only the records from an index while keeping settings, synonyms, and rules.
|
|
@@ -778,7 +803,7 @@ function createSearchClient({
|
|
|
778
803
|
queryParameters,
|
|
779
804
|
headers
|
|
780
805
|
};
|
|
781
|
-
return transporter.request(request, requestOptions);
|
|
806
|
+
return this.transporter.request(request, requestOptions);
|
|
782
807
|
},
|
|
783
808
|
/**
|
|
784
809
|
* Deletes all rules from the index.
|
|
@@ -807,7 +832,7 @@ function createSearchClient({
|
|
|
807
832
|
queryParameters,
|
|
808
833
|
headers
|
|
809
834
|
};
|
|
810
|
-
return transporter.request(request, requestOptions);
|
|
835
|
+
return this.transporter.request(request, requestOptions);
|
|
811
836
|
},
|
|
812
837
|
/**
|
|
813
838
|
* Deletes all synonyms from the index.
|
|
@@ -836,7 +861,7 @@ function createSearchClient({
|
|
|
836
861
|
queryParameters,
|
|
837
862
|
headers
|
|
838
863
|
};
|
|
839
|
-
return transporter.request(request, requestOptions);
|
|
864
|
+
return this.transporter.request(request, requestOptions);
|
|
840
865
|
},
|
|
841
866
|
/**
|
|
842
867
|
* This method allow you to send requests to the Algolia REST API.
|
|
@@ -859,7 +884,7 @@ function createSearchClient({
|
|
|
859
884
|
queryParameters,
|
|
860
885
|
headers
|
|
861
886
|
};
|
|
862
|
-
return transporter.request(request, requestOptions);
|
|
887
|
+
return this.transporter.request(request, requestOptions);
|
|
863
888
|
},
|
|
864
889
|
/**
|
|
865
890
|
* This method allow you to send requests to the Algolia REST API.
|
|
@@ -882,7 +907,7 @@ function createSearchClient({
|
|
|
882
907
|
queryParameters,
|
|
883
908
|
headers
|
|
884
909
|
};
|
|
885
|
-
return transporter.request(request, requestOptions);
|
|
910
|
+
return this.transporter.request(request, requestOptions);
|
|
886
911
|
},
|
|
887
912
|
/**
|
|
888
913
|
* This method allow you to send requests to the Algolia REST API.
|
|
@@ -907,7 +932,7 @@ function createSearchClient({
|
|
|
907
932
|
headers,
|
|
908
933
|
data: body ? body : {}
|
|
909
934
|
};
|
|
910
|
-
return transporter.request(request, requestOptions);
|
|
935
|
+
return this.transporter.request(request, requestOptions);
|
|
911
936
|
},
|
|
912
937
|
/**
|
|
913
938
|
* This method allow you to send requests to the Algolia REST API.
|
|
@@ -932,7 +957,7 @@ function createSearchClient({
|
|
|
932
957
|
headers,
|
|
933
958
|
data: body ? body : {}
|
|
934
959
|
};
|
|
935
|
-
return transporter.request(request, requestOptions);
|
|
960
|
+
return this.transporter.request(request, requestOptions);
|
|
936
961
|
},
|
|
937
962
|
/**
|
|
938
963
|
* Deletes the API key.
|
|
@@ -957,7 +982,7 @@ function createSearchClient({
|
|
|
957
982
|
queryParameters,
|
|
958
983
|
headers
|
|
959
984
|
};
|
|
960
|
-
return transporter.request(request, requestOptions);
|
|
985
|
+
return this.transporter.request(request, requestOptions);
|
|
961
986
|
},
|
|
962
987
|
/**
|
|
963
988
|
* This operation doesn\'t accept empty queries or filters. It\'s more efficient to get a list of object IDs with the [`browse` operation](#tag/Search/operation/browse), and then delete the records using the [`batch` operation](#tag/Records/operation/batch).
|
|
@@ -987,7 +1012,7 @@ function createSearchClient({
|
|
|
987
1012
|
headers,
|
|
988
1013
|
data: deleteByParams
|
|
989
1014
|
};
|
|
990
|
-
return transporter.request(request, requestOptions);
|
|
1015
|
+
return this.transporter.request(request, requestOptions);
|
|
991
1016
|
},
|
|
992
1017
|
/**
|
|
993
1018
|
* Deletes an index and all its settings. - Deleting an index doesn\'t delete its analytics data. - If you try to delete a non-existing index, the operation is ignored without warning. - If the index you want to delete has replica indices, the replicas become independent indices. - If the index you want to delete is a replica index, you must first unlink it from its primary index before you can delete it. For more information, see [Delete replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/how-to/deleting-replicas/).
|
|
@@ -1012,7 +1037,7 @@ function createSearchClient({
|
|
|
1012
1037
|
queryParameters,
|
|
1013
1038
|
headers
|
|
1014
1039
|
};
|
|
1015
|
-
return transporter.request(request, requestOptions);
|
|
1040
|
+
return this.transporter.request(request, requestOptions);
|
|
1016
1041
|
},
|
|
1017
1042
|
/**
|
|
1018
1043
|
* Deletes a record by its object ID. To delete more than one record, use the [`batch` operation](#tag/Records/operation/batch). To delete records matching a query, use the [`deleteByQuery` operation](#tag/Records/operation/deleteBy).
|
|
@@ -1041,7 +1066,7 @@ function createSearchClient({
|
|
|
1041
1066
|
queryParameters,
|
|
1042
1067
|
headers
|
|
1043
1068
|
};
|
|
1044
|
-
return transporter.request(request, requestOptions);
|
|
1069
|
+
return this.transporter.request(request, requestOptions);
|
|
1045
1070
|
},
|
|
1046
1071
|
/**
|
|
1047
1072
|
* Deletes a rule by its ID. To find the object ID for rules, use the [`search` operation](#tag/Rules/operation/searchRules).
|
|
@@ -1074,7 +1099,7 @@ function createSearchClient({
|
|
|
1074
1099
|
queryParameters,
|
|
1075
1100
|
headers
|
|
1076
1101
|
};
|
|
1077
|
-
return transporter.request(request, requestOptions);
|
|
1102
|
+
return this.transporter.request(request, requestOptions);
|
|
1078
1103
|
},
|
|
1079
1104
|
/**
|
|
1080
1105
|
* Deletes a source from the list of allowed sources.
|
|
@@ -1099,7 +1124,7 @@ function createSearchClient({
|
|
|
1099
1124
|
queryParameters,
|
|
1100
1125
|
headers
|
|
1101
1126
|
};
|
|
1102
|
-
return transporter.request(request, requestOptions);
|
|
1127
|
+
return this.transporter.request(request, requestOptions);
|
|
1103
1128
|
},
|
|
1104
1129
|
/**
|
|
1105
1130
|
* Deletes a synonym by its ID. To find the object IDs of your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).
|
|
@@ -1132,7 +1157,7 @@ function createSearchClient({
|
|
|
1132
1157
|
queryParameters,
|
|
1133
1158
|
headers
|
|
1134
1159
|
};
|
|
1135
|
-
return transporter.request(request, requestOptions);
|
|
1160
|
+
return this.transporter.request(request, requestOptions);
|
|
1136
1161
|
},
|
|
1137
1162
|
/**
|
|
1138
1163
|
* Gets the permissions and restrictions of an API key. When authenticating with the admin API key, you can request information for any of your application\'s keys. When authenticating with other API keys, you can only retrieve information for that key.
|
|
@@ -1154,7 +1179,7 @@ function createSearchClient({
|
|
|
1154
1179
|
queryParameters,
|
|
1155
1180
|
headers
|
|
1156
1181
|
};
|
|
1157
|
-
return transporter.request(request, requestOptions);
|
|
1182
|
+
return this.transporter.request(request, requestOptions);
|
|
1158
1183
|
},
|
|
1159
1184
|
/**
|
|
1160
1185
|
* Checks the status of a given application task.
|
|
@@ -1179,7 +1204,7 @@ function createSearchClient({
|
|
|
1179
1204
|
queryParameters,
|
|
1180
1205
|
headers
|
|
1181
1206
|
};
|
|
1182
|
-
return transporter.request(request, requestOptions);
|
|
1207
|
+
return this.transporter.request(request, requestOptions);
|
|
1183
1208
|
},
|
|
1184
1209
|
/**
|
|
1185
1210
|
* Lists supported languages with their supported dictionary types and number of custom entries.
|
|
@@ -1199,7 +1224,7 @@ function createSearchClient({
|
|
|
1199
1224
|
queryParameters,
|
|
1200
1225
|
headers
|
|
1201
1226
|
};
|
|
1202
|
-
return transporter.request(request, requestOptions);
|
|
1227
|
+
return this.transporter.request(request, requestOptions);
|
|
1203
1228
|
},
|
|
1204
1229
|
/**
|
|
1205
1230
|
* Retrieves the languages for which standard dictionary entries are turned off.
|
|
@@ -1219,7 +1244,7 @@ function createSearchClient({
|
|
|
1219
1244
|
queryParameters,
|
|
1220
1245
|
headers
|
|
1221
1246
|
};
|
|
1222
|
-
return transporter.request(request, requestOptions);
|
|
1247
|
+
return this.transporter.request(request, requestOptions);
|
|
1223
1248
|
},
|
|
1224
1249
|
/**
|
|
1225
1250
|
* The request must be authenticated by an API key with the [`logs` ACL](https://www.algolia.com/doc/guides/security/api-keys/#access-control-list-acl). - Logs are held for the last seven days. - Up to 1,000 API requests per server are logged. - This request counts towards your [operations quota](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-) but doesn\'t appear in the logs itself.
|
|
@@ -1256,7 +1281,7 @@ function createSearchClient({
|
|
|
1256
1281
|
queryParameters,
|
|
1257
1282
|
headers
|
|
1258
1283
|
};
|
|
1259
|
-
return transporter.request(request, requestOptions);
|
|
1284
|
+
return this.transporter.request(request, requestOptions);
|
|
1260
1285
|
},
|
|
1261
1286
|
/**
|
|
1262
1287
|
* Retrieves one record by its object ID. To retrieve more than one record, use the [`objects` operation](#tag/Records/operation/getObjects).
|
|
@@ -1289,7 +1314,7 @@ function createSearchClient({
|
|
|
1289
1314
|
queryParameters,
|
|
1290
1315
|
headers
|
|
1291
1316
|
};
|
|
1292
|
-
return transporter.request(request, requestOptions);
|
|
1317
|
+
return this.transporter.request(request, requestOptions);
|
|
1293
1318
|
},
|
|
1294
1319
|
/**
|
|
1295
1320
|
* Retrieves one or more records, potentially from different indices. Records are returned in the same order as the requests.
|
|
@@ -1319,7 +1344,7 @@ function createSearchClient({
|
|
|
1319
1344
|
useReadTransporter: true,
|
|
1320
1345
|
cacheable: true
|
|
1321
1346
|
};
|
|
1322
|
-
return transporter.request(request, requestOptions);
|
|
1347
|
+
return this.transporter.request(request, requestOptions);
|
|
1323
1348
|
},
|
|
1324
1349
|
/**
|
|
1325
1350
|
* Retrieves a rule by its ID. To find the object ID of rules, use the [`search` operation](#tag/Rules/operation/searchRules).
|
|
@@ -1348,7 +1373,7 @@ function createSearchClient({
|
|
|
1348
1373
|
queryParameters,
|
|
1349
1374
|
headers
|
|
1350
1375
|
};
|
|
1351
|
-
return transporter.request(request, requestOptions);
|
|
1376
|
+
return this.transporter.request(request, requestOptions);
|
|
1352
1377
|
},
|
|
1353
1378
|
/**
|
|
1354
1379
|
* Retrieves an object with non-null index settings.
|
|
@@ -1373,7 +1398,7 @@ function createSearchClient({
|
|
|
1373
1398
|
queryParameters,
|
|
1374
1399
|
headers
|
|
1375
1400
|
};
|
|
1376
|
-
return transporter.request(request, requestOptions);
|
|
1401
|
+
return this.transporter.request(request, requestOptions);
|
|
1377
1402
|
},
|
|
1378
1403
|
/**
|
|
1379
1404
|
* Retrieves all allowed IP addresses with access to your application.
|
|
@@ -1393,7 +1418,7 @@ function createSearchClient({
|
|
|
1393
1418
|
queryParameters,
|
|
1394
1419
|
headers
|
|
1395
1420
|
};
|
|
1396
|
-
return transporter.request(request, requestOptions);
|
|
1421
|
+
return this.transporter.request(request, requestOptions);
|
|
1397
1422
|
},
|
|
1398
1423
|
/**
|
|
1399
1424
|
* Retrieves a syonym by its ID. To find the object IDs for your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).
|
|
@@ -1422,7 +1447,7 @@ function createSearchClient({
|
|
|
1422
1447
|
queryParameters,
|
|
1423
1448
|
headers
|
|
1424
1449
|
};
|
|
1425
|
-
return transporter.request(request, requestOptions);
|
|
1450
|
+
return this.transporter.request(request, requestOptions);
|
|
1426
1451
|
},
|
|
1427
1452
|
/**
|
|
1428
1453
|
* Checks the status of a given task. Indexing tasks are asynchronous. When you add, update, or delete records or indices, a task is created on a queue and completed depending on the load on the server. The indexing tasks\' responses include a task ID that you can use to check the status.
|
|
@@ -1451,7 +1476,7 @@ function createSearchClient({
|
|
|
1451
1476
|
queryParameters,
|
|
1452
1477
|
headers
|
|
1453
1478
|
};
|
|
1454
|
-
return transporter.request(request, requestOptions);
|
|
1479
|
+
return this.transporter.request(request, requestOptions);
|
|
1455
1480
|
},
|
|
1456
1481
|
/**
|
|
1457
1482
|
* Get the IDs of the 10 users with the highest number of records per cluster. Since it can take a few seconds to get the data from the different clusters, the response isn\'t real-time.
|
|
@@ -1471,7 +1496,7 @@ function createSearchClient({
|
|
|
1471
1496
|
queryParameters,
|
|
1472
1497
|
headers
|
|
1473
1498
|
};
|
|
1474
|
-
return transporter.request(request, requestOptions);
|
|
1499
|
+
return this.transporter.request(request, requestOptions);
|
|
1475
1500
|
},
|
|
1476
1501
|
/**
|
|
1477
1502
|
* Returns the user ID data stored in the mapping. Since it can take a few seconds to get the data from the different clusters, the response isn\'t real-time.
|
|
@@ -1496,7 +1521,7 @@ function createSearchClient({
|
|
|
1496
1521
|
queryParameters,
|
|
1497
1522
|
headers
|
|
1498
1523
|
};
|
|
1499
|
-
return transporter.request(request, requestOptions);
|
|
1524
|
+
return this.transporter.request(request, requestOptions);
|
|
1500
1525
|
},
|
|
1501
1526
|
/**
|
|
1502
1527
|
* To determine when the time-consuming process of creating a large batch of users or migrating users from one cluster to another is complete, this operation retrieves the status of the process.
|
|
@@ -1521,7 +1546,7 @@ function createSearchClient({
|
|
|
1521
1546
|
queryParameters,
|
|
1522
1547
|
headers
|
|
1523
1548
|
};
|
|
1524
|
-
return transporter.request(request, requestOptions);
|
|
1549
|
+
return this.transporter.request(request, requestOptions);
|
|
1525
1550
|
},
|
|
1526
1551
|
/**
|
|
1527
1552
|
* Lists all API keys associated with your Algolia application, including their permissions and restrictions.
|
|
@@ -1541,7 +1566,7 @@ function createSearchClient({
|
|
|
1541
1566
|
queryParameters,
|
|
1542
1567
|
headers
|
|
1543
1568
|
};
|
|
1544
|
-
return transporter.request(request, requestOptions);
|
|
1569
|
+
return this.transporter.request(request, requestOptions);
|
|
1545
1570
|
},
|
|
1546
1571
|
/**
|
|
1547
1572
|
* Lists the available clusters in a multi-cluster setup.
|
|
@@ -1561,7 +1586,7 @@ function createSearchClient({
|
|
|
1561
1586
|
queryParameters,
|
|
1562
1587
|
headers
|
|
1563
1588
|
};
|
|
1564
|
-
return transporter.request(request, requestOptions);
|
|
1589
|
+
return this.transporter.request(request, requestOptions);
|
|
1565
1590
|
},
|
|
1566
1591
|
/**
|
|
1567
1592
|
* Lists all indices in the current Algolia application. The request follows any index restrictions of the API key you use to make the request.
|
|
@@ -1590,7 +1615,7 @@ function createSearchClient({
|
|
|
1590
1615
|
queryParameters,
|
|
1591
1616
|
headers
|
|
1592
1617
|
};
|
|
1593
|
-
return transporter.request(request, requestOptions);
|
|
1618
|
+
return this.transporter.request(request, requestOptions);
|
|
1594
1619
|
},
|
|
1595
1620
|
/**
|
|
1596
1621
|
* Lists the userIDs assigned to a multi-cluster application. Since it can take a few seconds to get the data from the different clusters, the response isn\'t real-time.
|
|
@@ -1619,7 +1644,7 @@ function createSearchClient({
|
|
|
1619
1644
|
queryParameters,
|
|
1620
1645
|
headers
|
|
1621
1646
|
};
|
|
1622
|
-
return transporter.request(request, requestOptions);
|
|
1647
|
+
return this.transporter.request(request, requestOptions);
|
|
1623
1648
|
},
|
|
1624
1649
|
/**
|
|
1625
1650
|
* Adds, updates, or deletes records in multiple indices with a single API request. - Actions are applied in the order they are specified. - Actions are equivalent to the individual API requests of the same name.
|
|
@@ -1644,7 +1669,7 @@ function createSearchClient({
|
|
|
1644
1669
|
headers,
|
|
1645
1670
|
data: batchParams
|
|
1646
1671
|
};
|
|
1647
|
-
return transporter.request(request, requestOptions);
|
|
1672
|
+
return this.transporter.request(request, requestOptions);
|
|
1648
1673
|
},
|
|
1649
1674
|
/**
|
|
1650
1675
|
* Copies or moves (renames) an index within the same Algolia application. - Existing destination indices are overwritten, except for their analytics data. - If the destination index doesn\'t exist yet, it\'ll be created. **Copy** - Copying a source index that doesn\'t exist creates a new index with 0 records and default settings. - The API keys of the source index are merged with the existing keys in the destination index. - You can\'t copy the `enableReRanking`, `mode`, and `replicas` settings. - You can\'t copy to a destination index that already has replicas. - Be aware of the [size limits](https://www.algolia.com/doc/guides/scaling/algolia-service-limits/#application-record-and-index-limits). - Related guide: [Copy indices](https://www.algolia.com/doc/guides/sending-and-managing-data/manage-indices-and-apps/manage-indices/how-to/copy-indices/) **Move** - Moving a source index that doesn\'t exist is ignored without returning an error. - When moving an index, the analytics data keep their original name and a new set of analytics data is started for the new name. To access the original analytics in the dashboard, create an index with the original name. - If the destination index has replicas, moving will overwrite the existing index and copy the data to the replica indices. - Related guide: [Move indices](https://www.algolia.com/doc/guides/sending-and-managing-data/manage-indices-and-apps/manage-indices/how-to/move-indices/).
|
|
@@ -1680,7 +1705,7 @@ function createSearchClient({
|
|
|
1680
1705
|
headers,
|
|
1681
1706
|
data: operationIndexParams
|
|
1682
1707
|
};
|
|
1683
|
-
return transporter.request(request, requestOptions);
|
|
1708
|
+
return this.transporter.request(request, requestOptions);
|
|
1684
1709
|
},
|
|
1685
1710
|
/**
|
|
1686
1711
|
* Adds new attributes to a record, or update existing ones. - If a record with the specified object ID doesn\'t exist, a new record is added to the index **if** `createIfNotExists` is true. - If the index doesn\'t exist yet, this method creates a new index. - You can use any first-level attribute but not nested attributes. If you specify a nested attribute, the engine treats it as a replacement for its first-level ancestor. To update an attribute without pushing the entire record, you can use these built-in operations. These operations can be helpful if you don\'t have access to your initial data. - Increment: increment a numeric attribute - Decrement: decrement a numeric attribute - Add: append a number or string element to an array attribute - Remove: remove all matching number or string elements from an array attribute made of numbers or strings - AddUnique: add a number or string element to an array attribute made of numbers or strings only if it\'s not already present - IncrementFrom: increment a numeric integer attribute only if the provided value matches the current value, and otherwise ignore the whole object update. For example, if you pass an IncrementFrom value of 2 for the version attribute, but the current value of the attribute is 1, the engine ignores the update. If the object doesn\'t exist, the engine only creates it if you pass an IncrementFrom value of 0. - IncrementSet: increment a numeric integer attribute only if the provided value is greater than the current value, and otherwise ignore the whole object update. For example, if you pass an IncrementSet value of 2 for the version attribute, and the current value of the attribute is 1, the engine updates the object. If the object doesn\'t exist yet, the engine only creates it if you pass an IncrementSet value that\'s greater than 0. You can specify an operation by providing an object with the attribute to update as the key and its value being an object with the following properties: - _operation: the operation to apply on the attribute - value: the right-hand side argument to the operation, for example, increment or decrement step, value to add or remove.
|
|
@@ -1718,7 +1743,7 @@ function createSearchClient({
|
|
|
1718
1743
|
headers,
|
|
1719
1744
|
data: attributesToUpdate
|
|
1720
1745
|
};
|
|
1721
|
-
return transporter.request(request, requestOptions);
|
|
1746
|
+
return this.transporter.request(request, requestOptions);
|
|
1722
1747
|
},
|
|
1723
1748
|
/**
|
|
1724
1749
|
* Deletes a user ID and its associated data from the clusters.
|
|
@@ -1743,7 +1768,7 @@ function createSearchClient({
|
|
|
1743
1768
|
queryParameters,
|
|
1744
1769
|
headers
|
|
1745
1770
|
};
|
|
1746
|
-
return transporter.request(request, requestOptions);
|
|
1771
|
+
return this.transporter.request(request, requestOptions);
|
|
1747
1772
|
},
|
|
1748
1773
|
/**
|
|
1749
1774
|
* Replaces the list of allowed sources.
|
|
@@ -1769,7 +1794,7 @@ function createSearchClient({
|
|
|
1769
1794
|
headers,
|
|
1770
1795
|
data: source
|
|
1771
1796
|
};
|
|
1772
|
-
return transporter.request(request, requestOptions);
|
|
1797
|
+
return this.transporter.request(request, requestOptions);
|
|
1773
1798
|
},
|
|
1774
1799
|
/**
|
|
1775
1800
|
* Restores a deleted API key. Restoring resets the `validity` attribute to `0`. Algolia stores up to 1,000 API keys per application. If you create more, the oldest API keys are deleted and can\'t be restored.
|
|
@@ -1794,7 +1819,7 @@ function createSearchClient({
|
|
|
1794
1819
|
queryParameters,
|
|
1795
1820
|
headers
|
|
1796
1821
|
};
|
|
1797
|
-
return transporter.request(request, requestOptions);
|
|
1822
|
+
return this.transporter.request(request, requestOptions);
|
|
1798
1823
|
},
|
|
1799
1824
|
/**
|
|
1800
1825
|
* Adds a record to an index or replace it. - If the record doesn\'t have an object ID, a new record with an auto-generated object ID is added to your index. - If a record with the specified object ID exists, the existing record is replaced. - If a record with the specified object ID doesn\'t exist, a new record is added to your index. - If you add a record to an index that doesn\'t exist yet, a new index is created. To update _some_ attributes of a record, use the [`partial` operation](#tag/Records/operation/partialUpdateObject). To add, update, or replace multiple records, use the [`batch` operation](#tag/Records/operation/batch).
|
|
@@ -1824,7 +1849,7 @@ function createSearchClient({
|
|
|
1824
1849
|
headers,
|
|
1825
1850
|
data: body
|
|
1826
1851
|
};
|
|
1827
|
-
return transporter.request(request, requestOptions);
|
|
1852
|
+
return this.transporter.request(request, requestOptions);
|
|
1828
1853
|
},
|
|
1829
1854
|
/**
|
|
1830
1855
|
* If a rule with the specified object ID doesn\'t exist, it\'s created. Otherwise, the existing rule is replaced. To create or update more than one rule, use the [`batch` operation](#tag/Rules/operation/saveRules).
|
|
@@ -1865,7 +1890,7 @@ function createSearchClient({
|
|
|
1865
1890
|
headers,
|
|
1866
1891
|
data: rule
|
|
1867
1892
|
};
|
|
1868
|
-
return transporter.request(request, requestOptions);
|
|
1893
|
+
return this.transporter.request(request, requestOptions);
|
|
1869
1894
|
},
|
|
1870
1895
|
/**
|
|
1871
1896
|
* Create or update multiple rules. If a rule with the specified object ID doesn\'t exist, Algolia creates a new one. Otherwise, existing rules are replaced.
|
|
@@ -1903,7 +1928,7 @@ function createSearchClient({
|
|
|
1903
1928
|
headers,
|
|
1904
1929
|
data: rules
|
|
1905
1930
|
};
|
|
1906
|
-
return transporter.request(request, requestOptions);
|
|
1931
|
+
return this.transporter.request(request, requestOptions);
|
|
1907
1932
|
},
|
|
1908
1933
|
/**
|
|
1909
1934
|
* If a synonym with the specified object ID doesn\'t exist, Algolia adds a new one. Otherwise, the existing synonym is replaced. To add multiple synonyms in a single API request, use the [`batch` operation](#tag/Synonyms/operation/saveSynonyms).
|
|
@@ -1947,7 +1972,7 @@ function createSearchClient({
|
|
|
1947
1972
|
headers,
|
|
1948
1973
|
data: synonymHit
|
|
1949
1974
|
};
|
|
1950
|
-
return transporter.request(request, requestOptions);
|
|
1975
|
+
return this.transporter.request(request, requestOptions);
|
|
1951
1976
|
},
|
|
1952
1977
|
/**
|
|
1953
1978
|
* If a synonym with the `objectID` doesn\'t exist, Algolia adds a new one. Otherwise, existing synonyms are replaced.
|
|
@@ -1985,7 +2010,7 @@ function createSearchClient({
|
|
|
1985
2010
|
headers,
|
|
1986
2011
|
data: synonymHit
|
|
1987
2012
|
};
|
|
1988
|
-
return transporter.request(request, requestOptions);
|
|
2013
|
+
return this.transporter.request(request, requestOptions);
|
|
1989
2014
|
},
|
|
1990
2015
|
/**
|
|
1991
2016
|
* Sends multiple search request to one or more indices. This can be useful in these cases: - Different indices for different purposes, such as, one index for products, another one for marketing content. - Multiple searches to the same index—for example, with different filters.
|
|
@@ -2036,7 +2061,7 @@ function createSearchClient({
|
|
|
2036
2061
|
useReadTransporter: true,
|
|
2037
2062
|
cacheable: true
|
|
2038
2063
|
};
|
|
2039
|
-
return transporter.request(request, requestOptions);
|
|
2064
|
+
return this.transporter.request(request, requestOptions);
|
|
2040
2065
|
},
|
|
2041
2066
|
/**
|
|
2042
2067
|
* Searches for standard and custom dictionary entries.
|
|
@@ -2078,7 +2103,7 @@ function createSearchClient({
|
|
|
2078
2103
|
useReadTransporter: true,
|
|
2079
2104
|
cacheable: true
|
|
2080
2105
|
};
|
|
2081
|
-
return transporter.request(request, requestOptions);
|
|
2106
|
+
return this.transporter.request(request, requestOptions);
|
|
2082
2107
|
},
|
|
2083
2108
|
/**
|
|
2084
2109
|
* Searches for values of a specified facet attribute. - By default, facet values are sorted by decreasing count. You can adjust this with the `sortFacetValueBy` parameter. - Searching for facet values doesn\'t work if you have **more than 65 searchable facets and searchable attributes combined**.
|
|
@@ -2111,7 +2136,7 @@ function createSearchClient({
|
|
|
2111
2136
|
useReadTransporter: true,
|
|
2112
2137
|
cacheable: true
|
|
2113
2138
|
};
|
|
2114
|
-
return transporter.request(request, requestOptions);
|
|
2139
|
+
return this.transporter.request(request, requestOptions);
|
|
2115
2140
|
},
|
|
2116
2141
|
/**
|
|
2117
2142
|
* Searches for rules in your index.
|
|
@@ -2140,7 +2165,7 @@ function createSearchClient({
|
|
|
2140
2165
|
useReadTransporter: true,
|
|
2141
2166
|
cacheable: true
|
|
2142
2167
|
};
|
|
2143
|
-
return transporter.request(request, requestOptions);
|
|
2168
|
+
return this.transporter.request(request, requestOptions);
|
|
2144
2169
|
},
|
|
2145
2170
|
/**
|
|
2146
2171
|
* Searches a single index and return matching search results (_hits_). This method lets you retrieve up to 1,000 hits. If you need more, use the [`browse` operation](#tag/Search/operation/browse) or increase the `paginatedLimitedTo` index setting.
|
|
@@ -2169,7 +2194,7 @@ function createSearchClient({
|
|
|
2169
2194
|
useReadTransporter: true,
|
|
2170
2195
|
cacheable: true
|
|
2171
2196
|
};
|
|
2172
|
-
return transporter.request(request, requestOptions);
|
|
2197
|
+
return this.transporter.request(request, requestOptions);
|
|
2173
2198
|
},
|
|
2174
2199
|
/**
|
|
2175
2200
|
* Searches for synonyms in your index.
|
|
@@ -2201,7 +2226,7 @@ function createSearchClient({
|
|
|
2201
2226
|
useReadTransporter: true,
|
|
2202
2227
|
cacheable: true
|
|
2203
2228
|
};
|
|
2204
|
-
return transporter.request(request, requestOptions);
|
|
2229
|
+
return this.transporter.request(request, requestOptions);
|
|
2205
2230
|
},
|
|
2206
2231
|
/**
|
|
2207
2232
|
* Since it can take a few seconds to get the data from the different clusters, the response isn\'t real-time. To ensure rapid updates, the user IDs index isn\'t built at the same time as the mapping. Instead, it\'s built every 12 hours, at the same time as the update of user ID usage. For example, if you add or move a user ID, the search will show an old value until the next time the mapping is rebuilt (every 12 hours).
|
|
@@ -2231,7 +2256,7 @@ function createSearchClient({
|
|
|
2231
2256
|
useReadTransporter: true,
|
|
2232
2257
|
cacheable: true
|
|
2233
2258
|
};
|
|
2234
|
-
return transporter.request(request, requestOptions);
|
|
2259
|
+
return this.transporter.request(request, requestOptions);
|
|
2235
2260
|
},
|
|
2236
2261
|
/**
|
|
2237
2262
|
* Turns standard stop word dictionary entries on or off for a given language.
|
|
@@ -2261,7 +2286,7 @@ function createSearchClient({
|
|
|
2261
2286
|
headers,
|
|
2262
2287
|
data: dictionarySettingsParams
|
|
2263
2288
|
};
|
|
2264
|
-
return transporter.request(request, requestOptions);
|
|
2289
|
+
return this.transporter.request(request, requestOptions);
|
|
2265
2290
|
},
|
|
2266
2291
|
/**
|
|
2267
2292
|
* Update the specified index settings. Index settings that you don\'t specify are left unchanged. Specify `null` to reset a setting to its default value. For best performance, update the index settings before you add new records to your index.
|
|
@@ -2295,7 +2320,7 @@ function createSearchClient({
|
|
|
2295
2320
|
headers,
|
|
2296
2321
|
data: indexSettings
|
|
2297
2322
|
};
|
|
2298
|
-
return transporter.request(request, requestOptions);
|
|
2323
|
+
return this.transporter.request(request, requestOptions);
|
|
2299
2324
|
},
|
|
2300
2325
|
/**
|
|
2301
2326
|
* Replaces the permissions of an existing API key. Any unspecified attribute resets that attribute to its default value.
|
|
@@ -2328,7 +2353,7 @@ function createSearchClient({
|
|
|
2328
2353
|
headers,
|
|
2329
2354
|
data: apiKey
|
|
2330
2355
|
};
|
|
2331
|
-
return transporter.request(request, requestOptions);
|
|
2356
|
+
return this.transporter.request(request, requestOptions);
|
|
2332
2357
|
}
|
|
2333
2358
|
};
|
|
2334
2359
|
}
|