@algolia/client-search 5.2.5 → 5.3.0
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 +114 -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 +108 -87
- package/dist/builds/node.cjs.map +1 -1
- package/dist/builds/node.js +116 -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 +106 -85
- package/dist/src/searchClient.cjs.map +1 -1
- package/dist/src/searchClient.js +114 -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.0";
|
|
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,16 @@ 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
|
+
this.transporter.baseHeaders["x-algolia-api-key"] = apiKey;
|
|
113
123
|
},
|
|
114
124
|
/**
|
|
115
125
|
* Helper: Wait for a task to be published (completed) for a given `indexName` and `taskID`.
|
|
@@ -473,6 +483,17 @@ function createSearchClient({
|
|
|
473
483
|
});
|
|
474
484
|
return { copyOperationResponse, batchResponses, moveOperationResponse };
|
|
475
485
|
},
|
|
486
|
+
async indexExists({ indexName }) {
|
|
487
|
+
try {
|
|
488
|
+
await this.getSettings({ indexName });
|
|
489
|
+
} catch (error) {
|
|
490
|
+
if (error instanceof import_client_common.ApiError && error.status === 404) {
|
|
491
|
+
return false;
|
|
492
|
+
}
|
|
493
|
+
throw error;
|
|
494
|
+
}
|
|
495
|
+
return true;
|
|
496
|
+
},
|
|
476
497
|
/**
|
|
477
498
|
* Helper: calls the `search` method but with certainty that we will only request Algolia records (hits) and not facets.
|
|
478
499
|
* 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 +542,7 @@ function createSearchClient({
|
|
|
521
542
|
headers,
|
|
522
543
|
data: apiKey
|
|
523
544
|
};
|
|
524
|
-
return transporter.request(request, requestOptions);
|
|
545
|
+
return this.transporter.request(request, requestOptions);
|
|
525
546
|
},
|
|
526
547
|
/**
|
|
527
548
|
* 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 +576,7 @@ function createSearchClient({
|
|
|
555
576
|
headers,
|
|
556
577
|
data: body
|
|
557
578
|
};
|
|
558
|
-
return transporter.request(request, requestOptions);
|
|
579
|
+
return this.transporter.request(request, requestOptions);
|
|
559
580
|
},
|
|
560
581
|
/**
|
|
561
582
|
* Adds a source to the list of allowed sources.
|
|
@@ -583,7 +604,7 @@ function createSearchClient({
|
|
|
583
604
|
headers,
|
|
584
605
|
data: source
|
|
585
606
|
};
|
|
586
|
-
return transporter.request(request, requestOptions);
|
|
607
|
+
return this.transporter.request(request, requestOptions);
|
|
587
608
|
},
|
|
588
609
|
/**
|
|
589
610
|
* 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 +640,7 @@ function createSearchClient({
|
|
|
619
640
|
headers,
|
|
620
641
|
data: assignUserIdParams
|
|
621
642
|
};
|
|
622
|
-
return transporter.request(request, requestOptions);
|
|
643
|
+
return this.transporter.request(request, requestOptions);
|
|
623
644
|
},
|
|
624
645
|
/**
|
|
625
646
|
* 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 +670,7 @@ function createSearchClient({
|
|
|
649
670
|
headers,
|
|
650
671
|
data: batchWriteParams
|
|
651
672
|
};
|
|
652
|
-
return transporter.request(request, requestOptions);
|
|
673
|
+
return this.transporter.request(request, requestOptions);
|
|
653
674
|
},
|
|
654
675
|
/**
|
|
655
676
|
* Assigns multiple user IDs to a cluster. **You can\'t move users with this operation**.
|
|
@@ -688,7 +709,7 @@ function createSearchClient({
|
|
|
688
709
|
headers,
|
|
689
710
|
data: batchAssignUserIdsParams
|
|
690
711
|
};
|
|
691
|
-
return transporter.request(request, requestOptions);
|
|
712
|
+
return this.transporter.request(request, requestOptions);
|
|
692
713
|
},
|
|
693
714
|
/**
|
|
694
715
|
* Adds or deletes multiple entries from your plurals, segmentation, or stop word dictionaries.
|
|
@@ -726,7 +747,7 @@ function createSearchClient({
|
|
|
726
747
|
headers,
|
|
727
748
|
data: batchDictionaryEntriesParams
|
|
728
749
|
};
|
|
729
|
-
return transporter.request(request, requestOptions);
|
|
750
|
+
return this.transporter.request(request, requestOptions);
|
|
730
751
|
},
|
|
731
752
|
/**
|
|
732
753
|
* 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 +774,7 @@ function createSearchClient({
|
|
|
753
774
|
headers,
|
|
754
775
|
data: browseParams ? browseParams : {}
|
|
755
776
|
};
|
|
756
|
-
return transporter.request(request, requestOptions);
|
|
777
|
+
return this.transporter.request(request, requestOptions);
|
|
757
778
|
},
|
|
758
779
|
/**
|
|
759
780
|
* Deletes only the records from an index while keeping settings, synonyms, and rules.
|
|
@@ -778,7 +799,7 @@ function createSearchClient({
|
|
|
778
799
|
queryParameters,
|
|
779
800
|
headers
|
|
780
801
|
};
|
|
781
|
-
return transporter.request(request, requestOptions);
|
|
802
|
+
return this.transporter.request(request, requestOptions);
|
|
782
803
|
},
|
|
783
804
|
/**
|
|
784
805
|
* Deletes all rules from the index.
|
|
@@ -807,7 +828,7 @@ function createSearchClient({
|
|
|
807
828
|
queryParameters,
|
|
808
829
|
headers
|
|
809
830
|
};
|
|
810
|
-
return transporter.request(request, requestOptions);
|
|
831
|
+
return this.transporter.request(request, requestOptions);
|
|
811
832
|
},
|
|
812
833
|
/**
|
|
813
834
|
* Deletes all synonyms from the index.
|
|
@@ -836,7 +857,7 @@ function createSearchClient({
|
|
|
836
857
|
queryParameters,
|
|
837
858
|
headers
|
|
838
859
|
};
|
|
839
|
-
return transporter.request(request, requestOptions);
|
|
860
|
+
return this.transporter.request(request, requestOptions);
|
|
840
861
|
},
|
|
841
862
|
/**
|
|
842
863
|
* This method allow you to send requests to the Algolia REST API.
|
|
@@ -859,7 +880,7 @@ function createSearchClient({
|
|
|
859
880
|
queryParameters,
|
|
860
881
|
headers
|
|
861
882
|
};
|
|
862
|
-
return transporter.request(request, requestOptions);
|
|
883
|
+
return this.transporter.request(request, requestOptions);
|
|
863
884
|
},
|
|
864
885
|
/**
|
|
865
886
|
* This method allow you to send requests to the Algolia REST API.
|
|
@@ -882,7 +903,7 @@ function createSearchClient({
|
|
|
882
903
|
queryParameters,
|
|
883
904
|
headers
|
|
884
905
|
};
|
|
885
|
-
return transporter.request(request, requestOptions);
|
|
906
|
+
return this.transporter.request(request, requestOptions);
|
|
886
907
|
},
|
|
887
908
|
/**
|
|
888
909
|
* This method allow you to send requests to the Algolia REST API.
|
|
@@ -907,7 +928,7 @@ function createSearchClient({
|
|
|
907
928
|
headers,
|
|
908
929
|
data: body ? body : {}
|
|
909
930
|
};
|
|
910
|
-
return transporter.request(request, requestOptions);
|
|
931
|
+
return this.transporter.request(request, requestOptions);
|
|
911
932
|
},
|
|
912
933
|
/**
|
|
913
934
|
* This method allow you to send requests to the Algolia REST API.
|
|
@@ -932,7 +953,7 @@ function createSearchClient({
|
|
|
932
953
|
headers,
|
|
933
954
|
data: body ? body : {}
|
|
934
955
|
};
|
|
935
|
-
return transporter.request(request, requestOptions);
|
|
956
|
+
return this.transporter.request(request, requestOptions);
|
|
936
957
|
},
|
|
937
958
|
/**
|
|
938
959
|
* Deletes the API key.
|
|
@@ -957,7 +978,7 @@ function createSearchClient({
|
|
|
957
978
|
queryParameters,
|
|
958
979
|
headers
|
|
959
980
|
};
|
|
960
|
-
return transporter.request(request, requestOptions);
|
|
981
|
+
return this.transporter.request(request, requestOptions);
|
|
961
982
|
},
|
|
962
983
|
/**
|
|
963
984
|
* 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 +1008,7 @@ function createSearchClient({
|
|
|
987
1008
|
headers,
|
|
988
1009
|
data: deleteByParams
|
|
989
1010
|
};
|
|
990
|
-
return transporter.request(request, requestOptions);
|
|
1011
|
+
return this.transporter.request(request, requestOptions);
|
|
991
1012
|
},
|
|
992
1013
|
/**
|
|
993
1014
|
* 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 +1033,7 @@ function createSearchClient({
|
|
|
1012
1033
|
queryParameters,
|
|
1013
1034
|
headers
|
|
1014
1035
|
};
|
|
1015
|
-
return transporter.request(request, requestOptions);
|
|
1036
|
+
return this.transporter.request(request, requestOptions);
|
|
1016
1037
|
},
|
|
1017
1038
|
/**
|
|
1018
1039
|
* 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 +1062,7 @@ function createSearchClient({
|
|
|
1041
1062
|
queryParameters,
|
|
1042
1063
|
headers
|
|
1043
1064
|
};
|
|
1044
|
-
return transporter.request(request, requestOptions);
|
|
1065
|
+
return this.transporter.request(request, requestOptions);
|
|
1045
1066
|
},
|
|
1046
1067
|
/**
|
|
1047
1068
|
* Deletes a rule by its ID. To find the object ID for rules, use the [`search` operation](#tag/Rules/operation/searchRules).
|
|
@@ -1074,7 +1095,7 @@ function createSearchClient({
|
|
|
1074
1095
|
queryParameters,
|
|
1075
1096
|
headers
|
|
1076
1097
|
};
|
|
1077
|
-
return transporter.request(request, requestOptions);
|
|
1098
|
+
return this.transporter.request(request, requestOptions);
|
|
1078
1099
|
},
|
|
1079
1100
|
/**
|
|
1080
1101
|
* Deletes a source from the list of allowed sources.
|
|
@@ -1099,7 +1120,7 @@ function createSearchClient({
|
|
|
1099
1120
|
queryParameters,
|
|
1100
1121
|
headers
|
|
1101
1122
|
};
|
|
1102
|
-
return transporter.request(request, requestOptions);
|
|
1123
|
+
return this.transporter.request(request, requestOptions);
|
|
1103
1124
|
},
|
|
1104
1125
|
/**
|
|
1105
1126
|
* Deletes a synonym by its ID. To find the object IDs of your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).
|
|
@@ -1132,7 +1153,7 @@ function createSearchClient({
|
|
|
1132
1153
|
queryParameters,
|
|
1133
1154
|
headers
|
|
1134
1155
|
};
|
|
1135
|
-
return transporter.request(request, requestOptions);
|
|
1156
|
+
return this.transporter.request(request, requestOptions);
|
|
1136
1157
|
},
|
|
1137
1158
|
/**
|
|
1138
1159
|
* 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 +1175,7 @@ function createSearchClient({
|
|
|
1154
1175
|
queryParameters,
|
|
1155
1176
|
headers
|
|
1156
1177
|
};
|
|
1157
|
-
return transporter.request(request, requestOptions);
|
|
1178
|
+
return this.transporter.request(request, requestOptions);
|
|
1158
1179
|
},
|
|
1159
1180
|
/**
|
|
1160
1181
|
* Checks the status of a given application task.
|
|
@@ -1179,7 +1200,7 @@ function createSearchClient({
|
|
|
1179
1200
|
queryParameters,
|
|
1180
1201
|
headers
|
|
1181
1202
|
};
|
|
1182
|
-
return transporter.request(request, requestOptions);
|
|
1203
|
+
return this.transporter.request(request, requestOptions);
|
|
1183
1204
|
},
|
|
1184
1205
|
/**
|
|
1185
1206
|
* Lists supported languages with their supported dictionary types and number of custom entries.
|
|
@@ -1199,7 +1220,7 @@ function createSearchClient({
|
|
|
1199
1220
|
queryParameters,
|
|
1200
1221
|
headers
|
|
1201
1222
|
};
|
|
1202
|
-
return transporter.request(request, requestOptions);
|
|
1223
|
+
return this.transporter.request(request, requestOptions);
|
|
1203
1224
|
},
|
|
1204
1225
|
/**
|
|
1205
1226
|
* Retrieves the languages for which standard dictionary entries are turned off.
|
|
@@ -1219,7 +1240,7 @@ function createSearchClient({
|
|
|
1219
1240
|
queryParameters,
|
|
1220
1241
|
headers
|
|
1221
1242
|
};
|
|
1222
|
-
return transporter.request(request, requestOptions);
|
|
1243
|
+
return this.transporter.request(request, requestOptions);
|
|
1223
1244
|
},
|
|
1224
1245
|
/**
|
|
1225
1246
|
* 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 +1277,7 @@ function createSearchClient({
|
|
|
1256
1277
|
queryParameters,
|
|
1257
1278
|
headers
|
|
1258
1279
|
};
|
|
1259
|
-
return transporter.request(request, requestOptions);
|
|
1280
|
+
return this.transporter.request(request, requestOptions);
|
|
1260
1281
|
},
|
|
1261
1282
|
/**
|
|
1262
1283
|
* Retrieves one record by its object ID. To retrieve more than one record, use the [`objects` operation](#tag/Records/operation/getObjects).
|
|
@@ -1289,7 +1310,7 @@ function createSearchClient({
|
|
|
1289
1310
|
queryParameters,
|
|
1290
1311
|
headers
|
|
1291
1312
|
};
|
|
1292
|
-
return transporter.request(request, requestOptions);
|
|
1313
|
+
return this.transporter.request(request, requestOptions);
|
|
1293
1314
|
},
|
|
1294
1315
|
/**
|
|
1295
1316
|
* Retrieves one or more records, potentially from different indices. Records are returned in the same order as the requests.
|
|
@@ -1319,7 +1340,7 @@ function createSearchClient({
|
|
|
1319
1340
|
useReadTransporter: true,
|
|
1320
1341
|
cacheable: true
|
|
1321
1342
|
};
|
|
1322
|
-
return transporter.request(request, requestOptions);
|
|
1343
|
+
return this.transporter.request(request, requestOptions);
|
|
1323
1344
|
},
|
|
1324
1345
|
/**
|
|
1325
1346
|
* Retrieves a rule by its ID. To find the object ID of rules, use the [`search` operation](#tag/Rules/operation/searchRules).
|
|
@@ -1348,7 +1369,7 @@ function createSearchClient({
|
|
|
1348
1369
|
queryParameters,
|
|
1349
1370
|
headers
|
|
1350
1371
|
};
|
|
1351
|
-
return transporter.request(request, requestOptions);
|
|
1372
|
+
return this.transporter.request(request, requestOptions);
|
|
1352
1373
|
},
|
|
1353
1374
|
/**
|
|
1354
1375
|
* Retrieves an object with non-null index settings.
|
|
@@ -1373,7 +1394,7 @@ function createSearchClient({
|
|
|
1373
1394
|
queryParameters,
|
|
1374
1395
|
headers
|
|
1375
1396
|
};
|
|
1376
|
-
return transporter.request(request, requestOptions);
|
|
1397
|
+
return this.transporter.request(request, requestOptions);
|
|
1377
1398
|
},
|
|
1378
1399
|
/**
|
|
1379
1400
|
* Retrieves all allowed IP addresses with access to your application.
|
|
@@ -1393,7 +1414,7 @@ function createSearchClient({
|
|
|
1393
1414
|
queryParameters,
|
|
1394
1415
|
headers
|
|
1395
1416
|
};
|
|
1396
|
-
return transporter.request(request, requestOptions);
|
|
1417
|
+
return this.transporter.request(request, requestOptions);
|
|
1397
1418
|
},
|
|
1398
1419
|
/**
|
|
1399
1420
|
* Retrieves a syonym by its ID. To find the object IDs for your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).
|
|
@@ -1422,7 +1443,7 @@ function createSearchClient({
|
|
|
1422
1443
|
queryParameters,
|
|
1423
1444
|
headers
|
|
1424
1445
|
};
|
|
1425
|
-
return transporter.request(request, requestOptions);
|
|
1446
|
+
return this.transporter.request(request, requestOptions);
|
|
1426
1447
|
},
|
|
1427
1448
|
/**
|
|
1428
1449
|
* 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 +1472,7 @@ function createSearchClient({
|
|
|
1451
1472
|
queryParameters,
|
|
1452
1473
|
headers
|
|
1453
1474
|
};
|
|
1454
|
-
return transporter.request(request, requestOptions);
|
|
1475
|
+
return this.transporter.request(request, requestOptions);
|
|
1455
1476
|
},
|
|
1456
1477
|
/**
|
|
1457
1478
|
* 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 +1492,7 @@ function createSearchClient({
|
|
|
1471
1492
|
queryParameters,
|
|
1472
1493
|
headers
|
|
1473
1494
|
};
|
|
1474
|
-
return transporter.request(request, requestOptions);
|
|
1495
|
+
return this.transporter.request(request, requestOptions);
|
|
1475
1496
|
},
|
|
1476
1497
|
/**
|
|
1477
1498
|
* 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 +1517,7 @@ function createSearchClient({
|
|
|
1496
1517
|
queryParameters,
|
|
1497
1518
|
headers
|
|
1498
1519
|
};
|
|
1499
|
-
return transporter.request(request, requestOptions);
|
|
1520
|
+
return this.transporter.request(request, requestOptions);
|
|
1500
1521
|
},
|
|
1501
1522
|
/**
|
|
1502
1523
|
* 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 +1542,7 @@ function createSearchClient({
|
|
|
1521
1542
|
queryParameters,
|
|
1522
1543
|
headers
|
|
1523
1544
|
};
|
|
1524
|
-
return transporter.request(request, requestOptions);
|
|
1545
|
+
return this.transporter.request(request, requestOptions);
|
|
1525
1546
|
},
|
|
1526
1547
|
/**
|
|
1527
1548
|
* Lists all API keys associated with your Algolia application, including their permissions and restrictions.
|
|
@@ -1541,7 +1562,7 @@ function createSearchClient({
|
|
|
1541
1562
|
queryParameters,
|
|
1542
1563
|
headers
|
|
1543
1564
|
};
|
|
1544
|
-
return transporter.request(request, requestOptions);
|
|
1565
|
+
return this.transporter.request(request, requestOptions);
|
|
1545
1566
|
},
|
|
1546
1567
|
/**
|
|
1547
1568
|
* Lists the available clusters in a multi-cluster setup.
|
|
@@ -1561,7 +1582,7 @@ function createSearchClient({
|
|
|
1561
1582
|
queryParameters,
|
|
1562
1583
|
headers
|
|
1563
1584
|
};
|
|
1564
|
-
return transporter.request(request, requestOptions);
|
|
1585
|
+
return this.transporter.request(request, requestOptions);
|
|
1565
1586
|
},
|
|
1566
1587
|
/**
|
|
1567
1588
|
* 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 +1611,7 @@ function createSearchClient({
|
|
|
1590
1611
|
queryParameters,
|
|
1591
1612
|
headers
|
|
1592
1613
|
};
|
|
1593
|
-
return transporter.request(request, requestOptions);
|
|
1614
|
+
return this.transporter.request(request, requestOptions);
|
|
1594
1615
|
},
|
|
1595
1616
|
/**
|
|
1596
1617
|
* 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 +1640,7 @@ function createSearchClient({
|
|
|
1619
1640
|
queryParameters,
|
|
1620
1641
|
headers
|
|
1621
1642
|
};
|
|
1622
|
-
return transporter.request(request, requestOptions);
|
|
1643
|
+
return this.transporter.request(request, requestOptions);
|
|
1623
1644
|
},
|
|
1624
1645
|
/**
|
|
1625
1646
|
* 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 +1665,7 @@ function createSearchClient({
|
|
|
1644
1665
|
headers,
|
|
1645
1666
|
data: batchParams
|
|
1646
1667
|
};
|
|
1647
|
-
return transporter.request(request, requestOptions);
|
|
1668
|
+
return this.transporter.request(request, requestOptions);
|
|
1648
1669
|
},
|
|
1649
1670
|
/**
|
|
1650
1671
|
* 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 +1701,7 @@ function createSearchClient({
|
|
|
1680
1701
|
headers,
|
|
1681
1702
|
data: operationIndexParams
|
|
1682
1703
|
};
|
|
1683
|
-
return transporter.request(request, requestOptions);
|
|
1704
|
+
return this.transporter.request(request, requestOptions);
|
|
1684
1705
|
},
|
|
1685
1706
|
/**
|
|
1686
1707
|
* 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 +1739,7 @@ function createSearchClient({
|
|
|
1718
1739
|
headers,
|
|
1719
1740
|
data: attributesToUpdate
|
|
1720
1741
|
};
|
|
1721
|
-
return transporter.request(request, requestOptions);
|
|
1742
|
+
return this.transporter.request(request, requestOptions);
|
|
1722
1743
|
},
|
|
1723
1744
|
/**
|
|
1724
1745
|
* Deletes a user ID and its associated data from the clusters.
|
|
@@ -1743,7 +1764,7 @@ function createSearchClient({
|
|
|
1743
1764
|
queryParameters,
|
|
1744
1765
|
headers
|
|
1745
1766
|
};
|
|
1746
|
-
return transporter.request(request, requestOptions);
|
|
1767
|
+
return this.transporter.request(request, requestOptions);
|
|
1747
1768
|
},
|
|
1748
1769
|
/**
|
|
1749
1770
|
* Replaces the list of allowed sources.
|
|
@@ -1769,7 +1790,7 @@ function createSearchClient({
|
|
|
1769
1790
|
headers,
|
|
1770
1791
|
data: source
|
|
1771
1792
|
};
|
|
1772
|
-
return transporter.request(request, requestOptions);
|
|
1793
|
+
return this.transporter.request(request, requestOptions);
|
|
1773
1794
|
},
|
|
1774
1795
|
/**
|
|
1775
1796
|
* 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 +1815,7 @@ function createSearchClient({
|
|
|
1794
1815
|
queryParameters,
|
|
1795
1816
|
headers
|
|
1796
1817
|
};
|
|
1797
|
-
return transporter.request(request, requestOptions);
|
|
1818
|
+
return this.transporter.request(request, requestOptions);
|
|
1798
1819
|
},
|
|
1799
1820
|
/**
|
|
1800
1821
|
* 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 +1845,7 @@ function createSearchClient({
|
|
|
1824
1845
|
headers,
|
|
1825
1846
|
data: body
|
|
1826
1847
|
};
|
|
1827
|
-
return transporter.request(request, requestOptions);
|
|
1848
|
+
return this.transporter.request(request, requestOptions);
|
|
1828
1849
|
},
|
|
1829
1850
|
/**
|
|
1830
1851
|
* 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 +1886,7 @@ function createSearchClient({
|
|
|
1865
1886
|
headers,
|
|
1866
1887
|
data: rule
|
|
1867
1888
|
};
|
|
1868
|
-
return transporter.request(request, requestOptions);
|
|
1889
|
+
return this.transporter.request(request, requestOptions);
|
|
1869
1890
|
},
|
|
1870
1891
|
/**
|
|
1871
1892
|
* 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 +1924,7 @@ function createSearchClient({
|
|
|
1903
1924
|
headers,
|
|
1904
1925
|
data: rules
|
|
1905
1926
|
};
|
|
1906
|
-
return transporter.request(request, requestOptions);
|
|
1927
|
+
return this.transporter.request(request, requestOptions);
|
|
1907
1928
|
},
|
|
1908
1929
|
/**
|
|
1909
1930
|
* 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 +1968,7 @@ function createSearchClient({
|
|
|
1947
1968
|
headers,
|
|
1948
1969
|
data: synonymHit
|
|
1949
1970
|
};
|
|
1950
|
-
return transporter.request(request, requestOptions);
|
|
1971
|
+
return this.transporter.request(request, requestOptions);
|
|
1951
1972
|
},
|
|
1952
1973
|
/**
|
|
1953
1974
|
* If a synonym with the `objectID` doesn\'t exist, Algolia adds a new one. Otherwise, existing synonyms are replaced.
|
|
@@ -1985,7 +2006,7 @@ function createSearchClient({
|
|
|
1985
2006
|
headers,
|
|
1986
2007
|
data: synonymHit
|
|
1987
2008
|
};
|
|
1988
|
-
return transporter.request(request, requestOptions);
|
|
2009
|
+
return this.transporter.request(request, requestOptions);
|
|
1989
2010
|
},
|
|
1990
2011
|
/**
|
|
1991
2012
|
* 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 +2057,7 @@ function createSearchClient({
|
|
|
2036
2057
|
useReadTransporter: true,
|
|
2037
2058
|
cacheable: true
|
|
2038
2059
|
};
|
|
2039
|
-
return transporter.request(request, requestOptions);
|
|
2060
|
+
return this.transporter.request(request, requestOptions);
|
|
2040
2061
|
},
|
|
2041
2062
|
/**
|
|
2042
2063
|
* Searches for standard and custom dictionary entries.
|
|
@@ -2078,7 +2099,7 @@ function createSearchClient({
|
|
|
2078
2099
|
useReadTransporter: true,
|
|
2079
2100
|
cacheable: true
|
|
2080
2101
|
};
|
|
2081
|
-
return transporter.request(request, requestOptions);
|
|
2102
|
+
return this.transporter.request(request, requestOptions);
|
|
2082
2103
|
},
|
|
2083
2104
|
/**
|
|
2084
2105
|
* 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 +2132,7 @@ function createSearchClient({
|
|
|
2111
2132
|
useReadTransporter: true,
|
|
2112
2133
|
cacheable: true
|
|
2113
2134
|
};
|
|
2114
|
-
return transporter.request(request, requestOptions);
|
|
2135
|
+
return this.transporter.request(request, requestOptions);
|
|
2115
2136
|
},
|
|
2116
2137
|
/**
|
|
2117
2138
|
* Searches for rules in your index.
|
|
@@ -2140,7 +2161,7 @@ function createSearchClient({
|
|
|
2140
2161
|
useReadTransporter: true,
|
|
2141
2162
|
cacheable: true
|
|
2142
2163
|
};
|
|
2143
|
-
return transporter.request(request, requestOptions);
|
|
2164
|
+
return this.transporter.request(request, requestOptions);
|
|
2144
2165
|
},
|
|
2145
2166
|
/**
|
|
2146
2167
|
* 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 +2190,7 @@ function createSearchClient({
|
|
|
2169
2190
|
useReadTransporter: true,
|
|
2170
2191
|
cacheable: true
|
|
2171
2192
|
};
|
|
2172
|
-
return transporter.request(request, requestOptions);
|
|
2193
|
+
return this.transporter.request(request, requestOptions);
|
|
2173
2194
|
},
|
|
2174
2195
|
/**
|
|
2175
2196
|
* Searches for synonyms in your index.
|
|
@@ -2201,7 +2222,7 @@ function createSearchClient({
|
|
|
2201
2222
|
useReadTransporter: true,
|
|
2202
2223
|
cacheable: true
|
|
2203
2224
|
};
|
|
2204
|
-
return transporter.request(request, requestOptions);
|
|
2225
|
+
return this.transporter.request(request, requestOptions);
|
|
2205
2226
|
},
|
|
2206
2227
|
/**
|
|
2207
2228
|
* 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 +2252,7 @@ function createSearchClient({
|
|
|
2231
2252
|
useReadTransporter: true,
|
|
2232
2253
|
cacheable: true
|
|
2233
2254
|
};
|
|
2234
|
-
return transporter.request(request, requestOptions);
|
|
2255
|
+
return this.transporter.request(request, requestOptions);
|
|
2235
2256
|
},
|
|
2236
2257
|
/**
|
|
2237
2258
|
* Turns standard stop word dictionary entries on or off for a given language.
|
|
@@ -2261,7 +2282,7 @@ function createSearchClient({
|
|
|
2261
2282
|
headers,
|
|
2262
2283
|
data: dictionarySettingsParams
|
|
2263
2284
|
};
|
|
2264
|
-
return transporter.request(request, requestOptions);
|
|
2285
|
+
return this.transporter.request(request, requestOptions);
|
|
2265
2286
|
},
|
|
2266
2287
|
/**
|
|
2267
2288
|
* 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 +2316,7 @@ function createSearchClient({
|
|
|
2295
2316
|
headers,
|
|
2296
2317
|
data: indexSettings
|
|
2297
2318
|
};
|
|
2298
|
-
return transporter.request(request, requestOptions);
|
|
2319
|
+
return this.transporter.request(request, requestOptions);
|
|
2299
2320
|
},
|
|
2300
2321
|
/**
|
|
2301
2322
|
* Replaces the permissions of an existing API key. Any unspecified attribute resets that attribute to its default value.
|
|
@@ -2328,7 +2349,7 @@ function createSearchClient({
|
|
|
2328
2349
|
headers,
|
|
2329
2350
|
data: apiKey
|
|
2330
2351
|
};
|
|
2331
|
-
return transporter.request(request, requestOptions);
|
|
2352
|
+
return this.transporter.request(request, requestOptions);
|
|
2332
2353
|
}
|
|
2333
2354
|
};
|
|
2334
2355
|
}
|