@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
package/dist/builds/browser.js
CHANGED
|
@@ -10,8 +10,15 @@ import {
|
|
|
10
10
|
import { createXhrRequester } from "@algolia/requester-browser-xhr";
|
|
11
11
|
|
|
12
12
|
// src/searchClient.ts
|
|
13
|
-
import {
|
|
14
|
-
|
|
13
|
+
import {
|
|
14
|
+
createAuth,
|
|
15
|
+
createTransporter,
|
|
16
|
+
getAlgoliaAgent,
|
|
17
|
+
shuffle,
|
|
18
|
+
ApiError,
|
|
19
|
+
createIterablePromise
|
|
20
|
+
} from "@algolia/client-common";
|
|
21
|
+
var apiClientVersion = "5.3.1";
|
|
15
22
|
function getDefaultHosts(appId) {
|
|
16
23
|
return [
|
|
17
24
|
{
|
|
@@ -52,26 +59,25 @@ function createSearchClient({
|
|
|
52
59
|
...options
|
|
53
60
|
}) {
|
|
54
61
|
const auth = createAuth(appIdOption, apiKeyOption, authMode);
|
|
55
|
-
const transporter = createTransporter({
|
|
56
|
-
hosts: getDefaultHosts(appIdOption),
|
|
57
|
-
...options,
|
|
58
|
-
algoliaAgent: getAlgoliaAgent({
|
|
59
|
-
algoliaAgents,
|
|
60
|
-
client: "Search",
|
|
61
|
-
version: apiClientVersion
|
|
62
|
-
}),
|
|
63
|
-
baseHeaders: {
|
|
64
|
-
"content-type": "text/plain",
|
|
65
|
-
...auth.headers(),
|
|
66
|
-
...options.baseHeaders
|
|
67
|
-
},
|
|
68
|
-
baseQueryParameters: {
|
|
69
|
-
...auth.queryParameters(),
|
|
70
|
-
...options.baseQueryParameters
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
62
|
return {
|
|
74
|
-
transporter
|
|
63
|
+
transporter: createTransporter({
|
|
64
|
+
hosts: getDefaultHosts(appIdOption),
|
|
65
|
+
...options,
|
|
66
|
+
algoliaAgent: getAlgoliaAgent({
|
|
67
|
+
algoliaAgents,
|
|
68
|
+
client: "Search",
|
|
69
|
+
version: apiClientVersion
|
|
70
|
+
}),
|
|
71
|
+
baseHeaders: {
|
|
72
|
+
"content-type": "text/plain",
|
|
73
|
+
...auth.headers(),
|
|
74
|
+
...options.baseHeaders
|
|
75
|
+
},
|
|
76
|
+
baseQueryParameters: {
|
|
77
|
+
...auth.queryParameters(),
|
|
78
|
+
...options.baseQueryParameters
|
|
79
|
+
}
|
|
80
|
+
}),
|
|
75
81
|
/**
|
|
76
82
|
* The `appId` currently in use.
|
|
77
83
|
*/
|
|
@@ -80,13 +86,15 @@ function createSearchClient({
|
|
|
80
86
|
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
81
87
|
*/
|
|
82
88
|
clearCache() {
|
|
83
|
-
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(
|
|
89
|
+
return Promise.all([this.transporter.requestsCache.clear(), this.transporter.responsesCache.clear()]).then(
|
|
90
|
+
() => void 0
|
|
91
|
+
);
|
|
84
92
|
},
|
|
85
93
|
/**
|
|
86
94
|
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
87
95
|
*/
|
|
88
96
|
get _ua() {
|
|
89
|
-
return transporter.algoliaAgent.value;
|
|
97
|
+
return this.transporter.algoliaAgent.value;
|
|
90
98
|
},
|
|
91
99
|
/**
|
|
92
100
|
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
|
@@ -95,7 +103,20 @@ function createSearchClient({
|
|
|
95
103
|
* @param version - The version of the agent.
|
|
96
104
|
*/
|
|
97
105
|
addAlgoliaAgent(segment, version) {
|
|
98
|
-
transporter.algoliaAgent.add({ segment, version });
|
|
106
|
+
this.transporter.algoliaAgent.add({ segment, version });
|
|
107
|
+
},
|
|
108
|
+
/**
|
|
109
|
+
* Helper method to switch the API key used to authenticate the requests.
|
|
110
|
+
*
|
|
111
|
+
* @param params - Method params.
|
|
112
|
+
* @param params.apiKey - The new API Key to use.
|
|
113
|
+
*/
|
|
114
|
+
setClientApiKey({ apiKey }) {
|
|
115
|
+
if (!authMode || authMode === "WithinHeaders") {
|
|
116
|
+
this.transporter.baseHeaders["x-algolia-api-key"] = apiKey;
|
|
117
|
+
} else {
|
|
118
|
+
this.transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
|
|
119
|
+
}
|
|
99
120
|
},
|
|
100
121
|
/**
|
|
101
122
|
* Helper: Wait for a task to be published (completed) for a given `indexName` and `taskID`.
|
|
@@ -459,6 +480,17 @@ function createSearchClient({
|
|
|
459
480
|
});
|
|
460
481
|
return { copyOperationResponse, batchResponses, moveOperationResponse };
|
|
461
482
|
},
|
|
483
|
+
async indexExists({ indexName }) {
|
|
484
|
+
try {
|
|
485
|
+
await this.getSettings({ indexName });
|
|
486
|
+
} catch (error) {
|
|
487
|
+
if (error instanceof ApiError && error.status === 404) {
|
|
488
|
+
return false;
|
|
489
|
+
}
|
|
490
|
+
throw error;
|
|
491
|
+
}
|
|
492
|
+
return true;
|
|
493
|
+
},
|
|
462
494
|
/**
|
|
463
495
|
* Helper: calls the `search` method but with certainty that we will only request Algolia records (hits) and not facets.
|
|
464
496
|
* 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.
|
|
@@ -507,7 +539,7 @@ function createSearchClient({
|
|
|
507
539
|
headers,
|
|
508
540
|
data: apiKey
|
|
509
541
|
};
|
|
510
|
-
return transporter.request(request, requestOptions);
|
|
542
|
+
return this.transporter.request(request, requestOptions);
|
|
511
543
|
},
|
|
512
544
|
/**
|
|
513
545
|
* 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).
|
|
@@ -541,7 +573,7 @@ function createSearchClient({
|
|
|
541
573
|
headers,
|
|
542
574
|
data: body
|
|
543
575
|
};
|
|
544
|
-
return transporter.request(request, requestOptions);
|
|
576
|
+
return this.transporter.request(request, requestOptions);
|
|
545
577
|
},
|
|
546
578
|
/**
|
|
547
579
|
* Adds a source to the list of allowed sources.
|
|
@@ -569,7 +601,7 @@ function createSearchClient({
|
|
|
569
601
|
headers,
|
|
570
602
|
data: source
|
|
571
603
|
};
|
|
572
|
-
return transporter.request(request, requestOptions);
|
|
604
|
+
return this.transporter.request(request, requestOptions);
|
|
573
605
|
},
|
|
574
606
|
/**
|
|
575
607
|
* 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.
|
|
@@ -605,7 +637,7 @@ function createSearchClient({
|
|
|
605
637
|
headers,
|
|
606
638
|
data: assignUserIdParams
|
|
607
639
|
};
|
|
608
|
-
return transporter.request(request, requestOptions);
|
|
640
|
+
return this.transporter.request(request, requestOptions);
|
|
609
641
|
},
|
|
610
642
|
/**
|
|
611
643
|
* 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.
|
|
@@ -635,7 +667,7 @@ function createSearchClient({
|
|
|
635
667
|
headers,
|
|
636
668
|
data: batchWriteParams
|
|
637
669
|
};
|
|
638
|
-
return transporter.request(request, requestOptions);
|
|
670
|
+
return this.transporter.request(request, requestOptions);
|
|
639
671
|
},
|
|
640
672
|
/**
|
|
641
673
|
* Assigns multiple user IDs to a cluster. **You can\'t move users with this operation**.
|
|
@@ -674,7 +706,7 @@ function createSearchClient({
|
|
|
674
706
|
headers,
|
|
675
707
|
data: batchAssignUserIdsParams
|
|
676
708
|
};
|
|
677
|
-
return transporter.request(request, requestOptions);
|
|
709
|
+
return this.transporter.request(request, requestOptions);
|
|
678
710
|
},
|
|
679
711
|
/**
|
|
680
712
|
* Adds or deletes multiple entries from your plurals, segmentation, or stop word dictionaries.
|
|
@@ -712,7 +744,7 @@ function createSearchClient({
|
|
|
712
744
|
headers,
|
|
713
745
|
data: batchDictionaryEntriesParams
|
|
714
746
|
};
|
|
715
|
-
return transporter.request(request, requestOptions);
|
|
747
|
+
return this.transporter.request(request, requestOptions);
|
|
716
748
|
},
|
|
717
749
|
/**
|
|
718
750
|
* 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.
|
|
@@ -739,7 +771,7 @@ function createSearchClient({
|
|
|
739
771
|
headers,
|
|
740
772
|
data: browseParams ? browseParams : {}
|
|
741
773
|
};
|
|
742
|
-
return transporter.request(request, requestOptions);
|
|
774
|
+
return this.transporter.request(request, requestOptions);
|
|
743
775
|
},
|
|
744
776
|
/**
|
|
745
777
|
* Deletes only the records from an index while keeping settings, synonyms, and rules.
|
|
@@ -764,7 +796,7 @@ function createSearchClient({
|
|
|
764
796
|
queryParameters,
|
|
765
797
|
headers
|
|
766
798
|
};
|
|
767
|
-
return transporter.request(request, requestOptions);
|
|
799
|
+
return this.transporter.request(request, requestOptions);
|
|
768
800
|
},
|
|
769
801
|
/**
|
|
770
802
|
* Deletes all rules from the index.
|
|
@@ -793,7 +825,7 @@ function createSearchClient({
|
|
|
793
825
|
queryParameters,
|
|
794
826
|
headers
|
|
795
827
|
};
|
|
796
|
-
return transporter.request(request, requestOptions);
|
|
828
|
+
return this.transporter.request(request, requestOptions);
|
|
797
829
|
},
|
|
798
830
|
/**
|
|
799
831
|
* Deletes all synonyms from the index.
|
|
@@ -822,7 +854,7 @@ function createSearchClient({
|
|
|
822
854
|
queryParameters,
|
|
823
855
|
headers
|
|
824
856
|
};
|
|
825
|
-
return transporter.request(request, requestOptions);
|
|
857
|
+
return this.transporter.request(request, requestOptions);
|
|
826
858
|
},
|
|
827
859
|
/**
|
|
828
860
|
* This method allow you to send requests to the Algolia REST API.
|
|
@@ -845,7 +877,7 @@ function createSearchClient({
|
|
|
845
877
|
queryParameters,
|
|
846
878
|
headers
|
|
847
879
|
};
|
|
848
|
-
return transporter.request(request, requestOptions);
|
|
880
|
+
return this.transporter.request(request, requestOptions);
|
|
849
881
|
},
|
|
850
882
|
/**
|
|
851
883
|
* This method allow you to send requests to the Algolia REST API.
|
|
@@ -868,7 +900,7 @@ function createSearchClient({
|
|
|
868
900
|
queryParameters,
|
|
869
901
|
headers
|
|
870
902
|
};
|
|
871
|
-
return transporter.request(request, requestOptions);
|
|
903
|
+
return this.transporter.request(request, requestOptions);
|
|
872
904
|
},
|
|
873
905
|
/**
|
|
874
906
|
* This method allow you to send requests to the Algolia REST API.
|
|
@@ -893,7 +925,7 @@ function createSearchClient({
|
|
|
893
925
|
headers,
|
|
894
926
|
data: body ? body : {}
|
|
895
927
|
};
|
|
896
|
-
return transporter.request(request, requestOptions);
|
|
928
|
+
return this.transporter.request(request, requestOptions);
|
|
897
929
|
},
|
|
898
930
|
/**
|
|
899
931
|
* This method allow you to send requests to the Algolia REST API.
|
|
@@ -918,7 +950,7 @@ function createSearchClient({
|
|
|
918
950
|
headers,
|
|
919
951
|
data: body ? body : {}
|
|
920
952
|
};
|
|
921
|
-
return transporter.request(request, requestOptions);
|
|
953
|
+
return this.transporter.request(request, requestOptions);
|
|
922
954
|
},
|
|
923
955
|
/**
|
|
924
956
|
* Deletes the API key.
|
|
@@ -943,7 +975,7 @@ function createSearchClient({
|
|
|
943
975
|
queryParameters,
|
|
944
976
|
headers
|
|
945
977
|
};
|
|
946
|
-
return transporter.request(request, requestOptions);
|
|
978
|
+
return this.transporter.request(request, requestOptions);
|
|
947
979
|
},
|
|
948
980
|
/**
|
|
949
981
|
* 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).
|
|
@@ -973,7 +1005,7 @@ function createSearchClient({
|
|
|
973
1005
|
headers,
|
|
974
1006
|
data: deleteByParams
|
|
975
1007
|
};
|
|
976
|
-
return transporter.request(request, requestOptions);
|
|
1008
|
+
return this.transporter.request(request, requestOptions);
|
|
977
1009
|
},
|
|
978
1010
|
/**
|
|
979
1011
|
* 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/).
|
|
@@ -998,7 +1030,7 @@ function createSearchClient({
|
|
|
998
1030
|
queryParameters,
|
|
999
1031
|
headers
|
|
1000
1032
|
};
|
|
1001
|
-
return transporter.request(request, requestOptions);
|
|
1033
|
+
return this.transporter.request(request, requestOptions);
|
|
1002
1034
|
},
|
|
1003
1035
|
/**
|
|
1004
1036
|
* 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).
|
|
@@ -1027,7 +1059,7 @@ function createSearchClient({
|
|
|
1027
1059
|
queryParameters,
|
|
1028
1060
|
headers
|
|
1029
1061
|
};
|
|
1030
|
-
return transporter.request(request, requestOptions);
|
|
1062
|
+
return this.transporter.request(request, requestOptions);
|
|
1031
1063
|
},
|
|
1032
1064
|
/**
|
|
1033
1065
|
* Deletes a rule by its ID. To find the object ID for rules, use the [`search` operation](#tag/Rules/operation/searchRules).
|
|
@@ -1060,7 +1092,7 @@ function createSearchClient({
|
|
|
1060
1092
|
queryParameters,
|
|
1061
1093
|
headers
|
|
1062
1094
|
};
|
|
1063
|
-
return transporter.request(request, requestOptions);
|
|
1095
|
+
return this.transporter.request(request, requestOptions);
|
|
1064
1096
|
},
|
|
1065
1097
|
/**
|
|
1066
1098
|
* Deletes a source from the list of allowed sources.
|
|
@@ -1085,7 +1117,7 @@ function createSearchClient({
|
|
|
1085
1117
|
queryParameters,
|
|
1086
1118
|
headers
|
|
1087
1119
|
};
|
|
1088
|
-
return transporter.request(request, requestOptions);
|
|
1120
|
+
return this.transporter.request(request, requestOptions);
|
|
1089
1121
|
},
|
|
1090
1122
|
/**
|
|
1091
1123
|
* Deletes a synonym by its ID. To find the object IDs of your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).
|
|
@@ -1118,7 +1150,7 @@ function createSearchClient({
|
|
|
1118
1150
|
queryParameters,
|
|
1119
1151
|
headers
|
|
1120
1152
|
};
|
|
1121
|
-
return transporter.request(request, requestOptions);
|
|
1153
|
+
return this.transporter.request(request, requestOptions);
|
|
1122
1154
|
},
|
|
1123
1155
|
/**
|
|
1124
1156
|
* 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.
|
|
@@ -1140,7 +1172,7 @@ function createSearchClient({
|
|
|
1140
1172
|
queryParameters,
|
|
1141
1173
|
headers
|
|
1142
1174
|
};
|
|
1143
|
-
return transporter.request(request, requestOptions);
|
|
1175
|
+
return this.transporter.request(request, requestOptions);
|
|
1144
1176
|
},
|
|
1145
1177
|
/**
|
|
1146
1178
|
* Checks the status of a given application task.
|
|
@@ -1165,7 +1197,7 @@ function createSearchClient({
|
|
|
1165
1197
|
queryParameters,
|
|
1166
1198
|
headers
|
|
1167
1199
|
};
|
|
1168
|
-
return transporter.request(request, requestOptions);
|
|
1200
|
+
return this.transporter.request(request, requestOptions);
|
|
1169
1201
|
},
|
|
1170
1202
|
/**
|
|
1171
1203
|
* Lists supported languages with their supported dictionary types and number of custom entries.
|
|
@@ -1185,7 +1217,7 @@ function createSearchClient({
|
|
|
1185
1217
|
queryParameters,
|
|
1186
1218
|
headers
|
|
1187
1219
|
};
|
|
1188
|
-
return transporter.request(request, requestOptions);
|
|
1220
|
+
return this.transporter.request(request, requestOptions);
|
|
1189
1221
|
},
|
|
1190
1222
|
/**
|
|
1191
1223
|
* Retrieves the languages for which standard dictionary entries are turned off.
|
|
@@ -1205,7 +1237,7 @@ function createSearchClient({
|
|
|
1205
1237
|
queryParameters,
|
|
1206
1238
|
headers
|
|
1207
1239
|
};
|
|
1208
|
-
return transporter.request(request, requestOptions);
|
|
1240
|
+
return this.transporter.request(request, requestOptions);
|
|
1209
1241
|
},
|
|
1210
1242
|
/**
|
|
1211
1243
|
* 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.
|
|
@@ -1242,7 +1274,7 @@ function createSearchClient({
|
|
|
1242
1274
|
queryParameters,
|
|
1243
1275
|
headers
|
|
1244
1276
|
};
|
|
1245
|
-
return transporter.request(request, requestOptions);
|
|
1277
|
+
return this.transporter.request(request, requestOptions);
|
|
1246
1278
|
},
|
|
1247
1279
|
/**
|
|
1248
1280
|
* Retrieves one record by its object ID. To retrieve more than one record, use the [`objects` operation](#tag/Records/operation/getObjects).
|
|
@@ -1275,7 +1307,7 @@ function createSearchClient({
|
|
|
1275
1307
|
queryParameters,
|
|
1276
1308
|
headers
|
|
1277
1309
|
};
|
|
1278
|
-
return transporter.request(request, requestOptions);
|
|
1310
|
+
return this.transporter.request(request, requestOptions);
|
|
1279
1311
|
},
|
|
1280
1312
|
/**
|
|
1281
1313
|
* Retrieves one or more records, potentially from different indices. Records are returned in the same order as the requests.
|
|
@@ -1305,7 +1337,7 @@ function createSearchClient({
|
|
|
1305
1337
|
useReadTransporter: true,
|
|
1306
1338
|
cacheable: true
|
|
1307
1339
|
};
|
|
1308
|
-
return transporter.request(request, requestOptions);
|
|
1340
|
+
return this.transporter.request(request, requestOptions);
|
|
1309
1341
|
},
|
|
1310
1342
|
/**
|
|
1311
1343
|
* Retrieves a rule by its ID. To find the object ID of rules, use the [`search` operation](#tag/Rules/operation/searchRules).
|
|
@@ -1334,7 +1366,7 @@ function createSearchClient({
|
|
|
1334
1366
|
queryParameters,
|
|
1335
1367
|
headers
|
|
1336
1368
|
};
|
|
1337
|
-
return transporter.request(request, requestOptions);
|
|
1369
|
+
return this.transporter.request(request, requestOptions);
|
|
1338
1370
|
},
|
|
1339
1371
|
/**
|
|
1340
1372
|
* Retrieves an object with non-null index settings.
|
|
@@ -1359,7 +1391,7 @@ function createSearchClient({
|
|
|
1359
1391
|
queryParameters,
|
|
1360
1392
|
headers
|
|
1361
1393
|
};
|
|
1362
|
-
return transporter.request(request, requestOptions);
|
|
1394
|
+
return this.transporter.request(request, requestOptions);
|
|
1363
1395
|
},
|
|
1364
1396
|
/**
|
|
1365
1397
|
* Retrieves all allowed IP addresses with access to your application.
|
|
@@ -1379,7 +1411,7 @@ function createSearchClient({
|
|
|
1379
1411
|
queryParameters,
|
|
1380
1412
|
headers
|
|
1381
1413
|
};
|
|
1382
|
-
return transporter.request(request, requestOptions);
|
|
1414
|
+
return this.transporter.request(request, requestOptions);
|
|
1383
1415
|
},
|
|
1384
1416
|
/**
|
|
1385
1417
|
* Retrieves a syonym by its ID. To find the object IDs for your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).
|
|
@@ -1408,7 +1440,7 @@ function createSearchClient({
|
|
|
1408
1440
|
queryParameters,
|
|
1409
1441
|
headers
|
|
1410
1442
|
};
|
|
1411
|
-
return transporter.request(request, requestOptions);
|
|
1443
|
+
return this.transporter.request(request, requestOptions);
|
|
1412
1444
|
},
|
|
1413
1445
|
/**
|
|
1414
1446
|
* 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.
|
|
@@ -1437,7 +1469,7 @@ function createSearchClient({
|
|
|
1437
1469
|
queryParameters,
|
|
1438
1470
|
headers
|
|
1439
1471
|
};
|
|
1440
|
-
return transporter.request(request, requestOptions);
|
|
1472
|
+
return this.transporter.request(request, requestOptions);
|
|
1441
1473
|
},
|
|
1442
1474
|
/**
|
|
1443
1475
|
* 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.
|
|
@@ -1457,7 +1489,7 @@ function createSearchClient({
|
|
|
1457
1489
|
queryParameters,
|
|
1458
1490
|
headers
|
|
1459
1491
|
};
|
|
1460
|
-
return transporter.request(request, requestOptions);
|
|
1492
|
+
return this.transporter.request(request, requestOptions);
|
|
1461
1493
|
},
|
|
1462
1494
|
/**
|
|
1463
1495
|
* 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.
|
|
@@ -1482,7 +1514,7 @@ function createSearchClient({
|
|
|
1482
1514
|
queryParameters,
|
|
1483
1515
|
headers
|
|
1484
1516
|
};
|
|
1485
|
-
return transporter.request(request, requestOptions);
|
|
1517
|
+
return this.transporter.request(request, requestOptions);
|
|
1486
1518
|
},
|
|
1487
1519
|
/**
|
|
1488
1520
|
* 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.
|
|
@@ -1507,7 +1539,7 @@ function createSearchClient({
|
|
|
1507
1539
|
queryParameters,
|
|
1508
1540
|
headers
|
|
1509
1541
|
};
|
|
1510
|
-
return transporter.request(request, requestOptions);
|
|
1542
|
+
return this.transporter.request(request, requestOptions);
|
|
1511
1543
|
},
|
|
1512
1544
|
/**
|
|
1513
1545
|
* Lists all API keys associated with your Algolia application, including their permissions and restrictions.
|
|
@@ -1527,7 +1559,7 @@ function createSearchClient({
|
|
|
1527
1559
|
queryParameters,
|
|
1528
1560
|
headers
|
|
1529
1561
|
};
|
|
1530
|
-
return transporter.request(request, requestOptions);
|
|
1562
|
+
return this.transporter.request(request, requestOptions);
|
|
1531
1563
|
},
|
|
1532
1564
|
/**
|
|
1533
1565
|
* Lists the available clusters in a multi-cluster setup.
|
|
@@ -1547,7 +1579,7 @@ function createSearchClient({
|
|
|
1547
1579
|
queryParameters,
|
|
1548
1580
|
headers
|
|
1549
1581
|
};
|
|
1550
|
-
return transporter.request(request, requestOptions);
|
|
1582
|
+
return this.transporter.request(request, requestOptions);
|
|
1551
1583
|
},
|
|
1552
1584
|
/**
|
|
1553
1585
|
* Lists all indices in the current Algolia application. The request follows any index restrictions of the API key you use to make the request.
|
|
@@ -1576,7 +1608,7 @@ function createSearchClient({
|
|
|
1576
1608
|
queryParameters,
|
|
1577
1609
|
headers
|
|
1578
1610
|
};
|
|
1579
|
-
return transporter.request(request, requestOptions);
|
|
1611
|
+
return this.transporter.request(request, requestOptions);
|
|
1580
1612
|
},
|
|
1581
1613
|
/**
|
|
1582
1614
|
* 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.
|
|
@@ -1605,7 +1637,7 @@ function createSearchClient({
|
|
|
1605
1637
|
queryParameters,
|
|
1606
1638
|
headers
|
|
1607
1639
|
};
|
|
1608
|
-
return transporter.request(request, requestOptions);
|
|
1640
|
+
return this.transporter.request(request, requestOptions);
|
|
1609
1641
|
},
|
|
1610
1642
|
/**
|
|
1611
1643
|
* 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.
|
|
@@ -1630,7 +1662,7 @@ function createSearchClient({
|
|
|
1630
1662
|
headers,
|
|
1631
1663
|
data: batchParams
|
|
1632
1664
|
};
|
|
1633
|
-
return transporter.request(request, requestOptions);
|
|
1665
|
+
return this.transporter.request(request, requestOptions);
|
|
1634
1666
|
},
|
|
1635
1667
|
/**
|
|
1636
1668
|
* 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/).
|
|
@@ -1666,7 +1698,7 @@ function createSearchClient({
|
|
|
1666
1698
|
headers,
|
|
1667
1699
|
data: operationIndexParams
|
|
1668
1700
|
};
|
|
1669
|
-
return transporter.request(request, requestOptions);
|
|
1701
|
+
return this.transporter.request(request, requestOptions);
|
|
1670
1702
|
},
|
|
1671
1703
|
/**
|
|
1672
1704
|
* 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.
|
|
@@ -1704,7 +1736,7 @@ function createSearchClient({
|
|
|
1704
1736
|
headers,
|
|
1705
1737
|
data: attributesToUpdate
|
|
1706
1738
|
};
|
|
1707
|
-
return transporter.request(request, requestOptions);
|
|
1739
|
+
return this.transporter.request(request, requestOptions);
|
|
1708
1740
|
},
|
|
1709
1741
|
/**
|
|
1710
1742
|
* Deletes a user ID and its associated data from the clusters.
|
|
@@ -1729,7 +1761,7 @@ function createSearchClient({
|
|
|
1729
1761
|
queryParameters,
|
|
1730
1762
|
headers
|
|
1731
1763
|
};
|
|
1732
|
-
return transporter.request(request, requestOptions);
|
|
1764
|
+
return this.transporter.request(request, requestOptions);
|
|
1733
1765
|
},
|
|
1734
1766
|
/**
|
|
1735
1767
|
* Replaces the list of allowed sources.
|
|
@@ -1755,7 +1787,7 @@ function createSearchClient({
|
|
|
1755
1787
|
headers,
|
|
1756
1788
|
data: source
|
|
1757
1789
|
};
|
|
1758
|
-
return transporter.request(request, requestOptions);
|
|
1790
|
+
return this.transporter.request(request, requestOptions);
|
|
1759
1791
|
},
|
|
1760
1792
|
/**
|
|
1761
1793
|
* 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.
|
|
@@ -1780,7 +1812,7 @@ function createSearchClient({
|
|
|
1780
1812
|
queryParameters,
|
|
1781
1813
|
headers
|
|
1782
1814
|
};
|
|
1783
|
-
return transporter.request(request, requestOptions);
|
|
1815
|
+
return this.transporter.request(request, requestOptions);
|
|
1784
1816
|
},
|
|
1785
1817
|
/**
|
|
1786
1818
|
* 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).
|
|
@@ -1810,7 +1842,7 @@ function createSearchClient({
|
|
|
1810
1842
|
headers,
|
|
1811
1843
|
data: body
|
|
1812
1844
|
};
|
|
1813
|
-
return transporter.request(request, requestOptions);
|
|
1845
|
+
return this.transporter.request(request, requestOptions);
|
|
1814
1846
|
},
|
|
1815
1847
|
/**
|
|
1816
1848
|
* 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).
|
|
@@ -1851,7 +1883,7 @@ function createSearchClient({
|
|
|
1851
1883
|
headers,
|
|
1852
1884
|
data: rule
|
|
1853
1885
|
};
|
|
1854
|
-
return transporter.request(request, requestOptions);
|
|
1886
|
+
return this.transporter.request(request, requestOptions);
|
|
1855
1887
|
},
|
|
1856
1888
|
/**
|
|
1857
1889
|
* 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.
|
|
@@ -1889,7 +1921,7 @@ function createSearchClient({
|
|
|
1889
1921
|
headers,
|
|
1890
1922
|
data: rules
|
|
1891
1923
|
};
|
|
1892
|
-
return transporter.request(request, requestOptions);
|
|
1924
|
+
return this.transporter.request(request, requestOptions);
|
|
1893
1925
|
},
|
|
1894
1926
|
/**
|
|
1895
1927
|
* 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).
|
|
@@ -1933,7 +1965,7 @@ function createSearchClient({
|
|
|
1933
1965
|
headers,
|
|
1934
1966
|
data: synonymHit
|
|
1935
1967
|
};
|
|
1936
|
-
return transporter.request(request, requestOptions);
|
|
1968
|
+
return this.transporter.request(request, requestOptions);
|
|
1937
1969
|
},
|
|
1938
1970
|
/**
|
|
1939
1971
|
* If a synonym with the `objectID` doesn\'t exist, Algolia adds a new one. Otherwise, existing synonyms are replaced.
|
|
@@ -1971,7 +2003,7 @@ function createSearchClient({
|
|
|
1971
2003
|
headers,
|
|
1972
2004
|
data: synonymHit
|
|
1973
2005
|
};
|
|
1974
|
-
return transporter.request(request, requestOptions);
|
|
2006
|
+
return this.transporter.request(request, requestOptions);
|
|
1975
2007
|
},
|
|
1976
2008
|
/**
|
|
1977
2009
|
* 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.
|
|
@@ -2022,7 +2054,7 @@ function createSearchClient({
|
|
|
2022
2054
|
useReadTransporter: true,
|
|
2023
2055
|
cacheable: true
|
|
2024
2056
|
};
|
|
2025
|
-
return transporter.request(request, requestOptions);
|
|
2057
|
+
return this.transporter.request(request, requestOptions);
|
|
2026
2058
|
},
|
|
2027
2059
|
/**
|
|
2028
2060
|
* Searches for standard and custom dictionary entries.
|
|
@@ -2064,7 +2096,7 @@ function createSearchClient({
|
|
|
2064
2096
|
useReadTransporter: true,
|
|
2065
2097
|
cacheable: true
|
|
2066
2098
|
};
|
|
2067
|
-
return transporter.request(request, requestOptions);
|
|
2099
|
+
return this.transporter.request(request, requestOptions);
|
|
2068
2100
|
},
|
|
2069
2101
|
/**
|
|
2070
2102
|
* 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**.
|
|
@@ -2097,7 +2129,7 @@ function createSearchClient({
|
|
|
2097
2129
|
useReadTransporter: true,
|
|
2098
2130
|
cacheable: true
|
|
2099
2131
|
};
|
|
2100
|
-
return transporter.request(request, requestOptions);
|
|
2132
|
+
return this.transporter.request(request, requestOptions);
|
|
2101
2133
|
},
|
|
2102
2134
|
/**
|
|
2103
2135
|
* Searches for rules in your index.
|
|
@@ -2126,7 +2158,7 @@ function createSearchClient({
|
|
|
2126
2158
|
useReadTransporter: true,
|
|
2127
2159
|
cacheable: true
|
|
2128
2160
|
};
|
|
2129
|
-
return transporter.request(request, requestOptions);
|
|
2161
|
+
return this.transporter.request(request, requestOptions);
|
|
2130
2162
|
},
|
|
2131
2163
|
/**
|
|
2132
2164
|
* 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.
|
|
@@ -2155,7 +2187,7 @@ function createSearchClient({
|
|
|
2155
2187
|
useReadTransporter: true,
|
|
2156
2188
|
cacheable: true
|
|
2157
2189
|
};
|
|
2158
|
-
return transporter.request(request, requestOptions);
|
|
2190
|
+
return this.transporter.request(request, requestOptions);
|
|
2159
2191
|
},
|
|
2160
2192
|
/**
|
|
2161
2193
|
* Searches for synonyms in your index.
|
|
@@ -2187,7 +2219,7 @@ function createSearchClient({
|
|
|
2187
2219
|
useReadTransporter: true,
|
|
2188
2220
|
cacheable: true
|
|
2189
2221
|
};
|
|
2190
|
-
return transporter.request(request, requestOptions);
|
|
2222
|
+
return this.transporter.request(request, requestOptions);
|
|
2191
2223
|
},
|
|
2192
2224
|
/**
|
|
2193
2225
|
* 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).
|
|
@@ -2217,7 +2249,7 @@ function createSearchClient({
|
|
|
2217
2249
|
useReadTransporter: true,
|
|
2218
2250
|
cacheable: true
|
|
2219
2251
|
};
|
|
2220
|
-
return transporter.request(request, requestOptions);
|
|
2252
|
+
return this.transporter.request(request, requestOptions);
|
|
2221
2253
|
},
|
|
2222
2254
|
/**
|
|
2223
2255
|
* Turns standard stop word dictionary entries on or off for a given language.
|
|
@@ -2247,7 +2279,7 @@ function createSearchClient({
|
|
|
2247
2279
|
headers,
|
|
2248
2280
|
data: dictionarySettingsParams
|
|
2249
2281
|
};
|
|
2250
|
-
return transporter.request(request, requestOptions);
|
|
2282
|
+
return this.transporter.request(request, requestOptions);
|
|
2251
2283
|
},
|
|
2252
2284
|
/**
|
|
2253
2285
|
* 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.
|
|
@@ -2281,7 +2313,7 @@ function createSearchClient({
|
|
|
2281
2313
|
headers,
|
|
2282
2314
|
data: indexSettings
|
|
2283
2315
|
};
|
|
2284
|
-
return transporter.request(request, requestOptions);
|
|
2316
|
+
return this.transporter.request(request, requestOptions);
|
|
2285
2317
|
},
|
|
2286
2318
|
/**
|
|
2287
2319
|
* Replaces the permissions of an existing API key. Any unspecified attribute resets that attribute to its default value.
|
|
@@ -2314,7 +2346,7 @@ function createSearchClient({
|
|
|
2314
2346
|
headers,
|
|
2315
2347
|
data: apiKey
|
|
2316
2348
|
};
|
|
2317
|
-
return transporter.request(request, requestOptions);
|
|
2349
|
+
return this.transporter.request(request, requestOptions);
|
|
2318
2350
|
}
|
|
2319
2351
|
};
|
|
2320
2352
|
}
|