@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/src/searchClient.js
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
// src/searchClient.ts
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
createAuth,
|
|
4
|
+
createTransporter,
|
|
5
|
+
getAlgoliaAgent,
|
|
6
|
+
shuffle,
|
|
7
|
+
ApiError,
|
|
8
|
+
createIterablePromise
|
|
9
|
+
} from "@algolia/client-common";
|
|
10
|
+
var apiClientVersion = "5.3.1";
|
|
4
11
|
function getDefaultHosts(appId) {
|
|
5
12
|
return [
|
|
6
13
|
{
|
|
@@ -41,26 +48,25 @@ function createSearchClient({
|
|
|
41
48
|
...options
|
|
42
49
|
}) {
|
|
43
50
|
const auth = createAuth(appIdOption, apiKeyOption, authMode);
|
|
44
|
-
const transporter = createTransporter({
|
|
45
|
-
hosts: getDefaultHosts(appIdOption),
|
|
46
|
-
...options,
|
|
47
|
-
algoliaAgent: getAlgoliaAgent({
|
|
48
|
-
algoliaAgents,
|
|
49
|
-
client: "Search",
|
|
50
|
-
version: apiClientVersion
|
|
51
|
-
}),
|
|
52
|
-
baseHeaders: {
|
|
53
|
-
"content-type": "text/plain",
|
|
54
|
-
...auth.headers(),
|
|
55
|
-
...options.baseHeaders
|
|
56
|
-
},
|
|
57
|
-
baseQueryParameters: {
|
|
58
|
-
...auth.queryParameters(),
|
|
59
|
-
...options.baseQueryParameters
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
51
|
return {
|
|
63
|
-
transporter
|
|
52
|
+
transporter: createTransporter({
|
|
53
|
+
hosts: getDefaultHosts(appIdOption),
|
|
54
|
+
...options,
|
|
55
|
+
algoliaAgent: getAlgoliaAgent({
|
|
56
|
+
algoliaAgents,
|
|
57
|
+
client: "Search",
|
|
58
|
+
version: apiClientVersion
|
|
59
|
+
}),
|
|
60
|
+
baseHeaders: {
|
|
61
|
+
"content-type": "text/plain",
|
|
62
|
+
...auth.headers(),
|
|
63
|
+
...options.baseHeaders
|
|
64
|
+
},
|
|
65
|
+
baseQueryParameters: {
|
|
66
|
+
...auth.queryParameters(),
|
|
67
|
+
...options.baseQueryParameters
|
|
68
|
+
}
|
|
69
|
+
}),
|
|
64
70
|
/**
|
|
65
71
|
* The `appId` currently in use.
|
|
66
72
|
*/
|
|
@@ -69,13 +75,15 @@ function createSearchClient({
|
|
|
69
75
|
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
70
76
|
*/
|
|
71
77
|
clearCache() {
|
|
72
|
-
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(
|
|
78
|
+
return Promise.all([this.transporter.requestsCache.clear(), this.transporter.responsesCache.clear()]).then(
|
|
79
|
+
() => void 0
|
|
80
|
+
);
|
|
73
81
|
},
|
|
74
82
|
/**
|
|
75
83
|
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
76
84
|
*/
|
|
77
85
|
get _ua() {
|
|
78
|
-
return transporter.algoliaAgent.value;
|
|
86
|
+
return this.transporter.algoliaAgent.value;
|
|
79
87
|
},
|
|
80
88
|
/**
|
|
81
89
|
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
|
@@ -84,7 +92,20 @@ function createSearchClient({
|
|
|
84
92
|
* @param version - The version of the agent.
|
|
85
93
|
*/
|
|
86
94
|
addAlgoliaAgent(segment, version) {
|
|
87
|
-
transporter.algoliaAgent.add({ segment, version });
|
|
95
|
+
this.transporter.algoliaAgent.add({ segment, version });
|
|
96
|
+
},
|
|
97
|
+
/**
|
|
98
|
+
* Helper method to switch the API key used to authenticate the requests.
|
|
99
|
+
*
|
|
100
|
+
* @param params - Method params.
|
|
101
|
+
* @param params.apiKey - The new API Key to use.
|
|
102
|
+
*/
|
|
103
|
+
setClientApiKey({ apiKey }) {
|
|
104
|
+
if (!authMode || authMode === "WithinHeaders") {
|
|
105
|
+
this.transporter.baseHeaders["x-algolia-api-key"] = apiKey;
|
|
106
|
+
} else {
|
|
107
|
+
this.transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
|
|
108
|
+
}
|
|
88
109
|
},
|
|
89
110
|
/**
|
|
90
111
|
* Helper: Wait for a task to be published (completed) for a given `indexName` and `taskID`.
|
|
@@ -448,6 +469,17 @@ function createSearchClient({
|
|
|
448
469
|
});
|
|
449
470
|
return { copyOperationResponse, batchResponses, moveOperationResponse };
|
|
450
471
|
},
|
|
472
|
+
async indexExists({ indexName }) {
|
|
473
|
+
try {
|
|
474
|
+
await this.getSettings({ indexName });
|
|
475
|
+
} catch (error) {
|
|
476
|
+
if (error instanceof ApiError && error.status === 404) {
|
|
477
|
+
return false;
|
|
478
|
+
}
|
|
479
|
+
throw error;
|
|
480
|
+
}
|
|
481
|
+
return true;
|
|
482
|
+
},
|
|
451
483
|
/**
|
|
452
484
|
* Helper: calls the `search` method but with certainty that we will only request Algolia records (hits) and not facets.
|
|
453
485
|
* 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.
|
|
@@ -496,7 +528,7 @@ function createSearchClient({
|
|
|
496
528
|
headers,
|
|
497
529
|
data: apiKey
|
|
498
530
|
};
|
|
499
|
-
return transporter.request(request, requestOptions);
|
|
531
|
+
return this.transporter.request(request, requestOptions);
|
|
500
532
|
},
|
|
501
533
|
/**
|
|
502
534
|
* 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).
|
|
@@ -530,7 +562,7 @@ function createSearchClient({
|
|
|
530
562
|
headers,
|
|
531
563
|
data: body
|
|
532
564
|
};
|
|
533
|
-
return transporter.request(request, requestOptions);
|
|
565
|
+
return this.transporter.request(request, requestOptions);
|
|
534
566
|
},
|
|
535
567
|
/**
|
|
536
568
|
* Adds a source to the list of allowed sources.
|
|
@@ -558,7 +590,7 @@ function createSearchClient({
|
|
|
558
590
|
headers,
|
|
559
591
|
data: source
|
|
560
592
|
};
|
|
561
|
-
return transporter.request(request, requestOptions);
|
|
593
|
+
return this.transporter.request(request, requestOptions);
|
|
562
594
|
},
|
|
563
595
|
/**
|
|
564
596
|
* 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.
|
|
@@ -594,7 +626,7 @@ function createSearchClient({
|
|
|
594
626
|
headers,
|
|
595
627
|
data: assignUserIdParams
|
|
596
628
|
};
|
|
597
|
-
return transporter.request(request, requestOptions);
|
|
629
|
+
return this.transporter.request(request, requestOptions);
|
|
598
630
|
},
|
|
599
631
|
/**
|
|
600
632
|
* 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.
|
|
@@ -624,7 +656,7 @@ function createSearchClient({
|
|
|
624
656
|
headers,
|
|
625
657
|
data: batchWriteParams
|
|
626
658
|
};
|
|
627
|
-
return transporter.request(request, requestOptions);
|
|
659
|
+
return this.transporter.request(request, requestOptions);
|
|
628
660
|
},
|
|
629
661
|
/**
|
|
630
662
|
* Assigns multiple user IDs to a cluster. **You can\'t move users with this operation**.
|
|
@@ -663,7 +695,7 @@ function createSearchClient({
|
|
|
663
695
|
headers,
|
|
664
696
|
data: batchAssignUserIdsParams
|
|
665
697
|
};
|
|
666
|
-
return transporter.request(request, requestOptions);
|
|
698
|
+
return this.transporter.request(request, requestOptions);
|
|
667
699
|
},
|
|
668
700
|
/**
|
|
669
701
|
* Adds or deletes multiple entries from your plurals, segmentation, or stop word dictionaries.
|
|
@@ -701,7 +733,7 @@ function createSearchClient({
|
|
|
701
733
|
headers,
|
|
702
734
|
data: batchDictionaryEntriesParams
|
|
703
735
|
};
|
|
704
|
-
return transporter.request(request, requestOptions);
|
|
736
|
+
return this.transporter.request(request, requestOptions);
|
|
705
737
|
},
|
|
706
738
|
/**
|
|
707
739
|
* 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.
|
|
@@ -728,7 +760,7 @@ function createSearchClient({
|
|
|
728
760
|
headers,
|
|
729
761
|
data: browseParams ? browseParams : {}
|
|
730
762
|
};
|
|
731
|
-
return transporter.request(request, requestOptions);
|
|
763
|
+
return this.transporter.request(request, requestOptions);
|
|
732
764
|
},
|
|
733
765
|
/**
|
|
734
766
|
* Deletes only the records from an index while keeping settings, synonyms, and rules.
|
|
@@ -753,7 +785,7 @@ function createSearchClient({
|
|
|
753
785
|
queryParameters,
|
|
754
786
|
headers
|
|
755
787
|
};
|
|
756
|
-
return transporter.request(request, requestOptions);
|
|
788
|
+
return this.transporter.request(request, requestOptions);
|
|
757
789
|
},
|
|
758
790
|
/**
|
|
759
791
|
* Deletes all rules from the index.
|
|
@@ -782,7 +814,7 @@ function createSearchClient({
|
|
|
782
814
|
queryParameters,
|
|
783
815
|
headers
|
|
784
816
|
};
|
|
785
|
-
return transporter.request(request, requestOptions);
|
|
817
|
+
return this.transporter.request(request, requestOptions);
|
|
786
818
|
},
|
|
787
819
|
/**
|
|
788
820
|
* Deletes all synonyms from the index.
|
|
@@ -811,7 +843,7 @@ function createSearchClient({
|
|
|
811
843
|
queryParameters,
|
|
812
844
|
headers
|
|
813
845
|
};
|
|
814
|
-
return transporter.request(request, requestOptions);
|
|
846
|
+
return this.transporter.request(request, requestOptions);
|
|
815
847
|
},
|
|
816
848
|
/**
|
|
817
849
|
* This method allow you to send requests to the Algolia REST API.
|
|
@@ -834,7 +866,7 @@ function createSearchClient({
|
|
|
834
866
|
queryParameters,
|
|
835
867
|
headers
|
|
836
868
|
};
|
|
837
|
-
return transporter.request(request, requestOptions);
|
|
869
|
+
return this.transporter.request(request, requestOptions);
|
|
838
870
|
},
|
|
839
871
|
/**
|
|
840
872
|
* This method allow you to send requests to the Algolia REST API.
|
|
@@ -857,7 +889,7 @@ function createSearchClient({
|
|
|
857
889
|
queryParameters,
|
|
858
890
|
headers
|
|
859
891
|
};
|
|
860
|
-
return transporter.request(request, requestOptions);
|
|
892
|
+
return this.transporter.request(request, requestOptions);
|
|
861
893
|
},
|
|
862
894
|
/**
|
|
863
895
|
* This method allow you to send requests to the Algolia REST API.
|
|
@@ -882,7 +914,7 @@ function createSearchClient({
|
|
|
882
914
|
headers,
|
|
883
915
|
data: body ? body : {}
|
|
884
916
|
};
|
|
885
|
-
return transporter.request(request, requestOptions);
|
|
917
|
+
return this.transporter.request(request, requestOptions);
|
|
886
918
|
},
|
|
887
919
|
/**
|
|
888
920
|
* This method allow you to send requests to the Algolia REST API.
|
|
@@ -907,7 +939,7 @@ function createSearchClient({
|
|
|
907
939
|
headers,
|
|
908
940
|
data: body ? body : {}
|
|
909
941
|
};
|
|
910
|
-
return transporter.request(request, requestOptions);
|
|
942
|
+
return this.transporter.request(request, requestOptions);
|
|
911
943
|
},
|
|
912
944
|
/**
|
|
913
945
|
* Deletes the API key.
|
|
@@ -932,7 +964,7 @@ function createSearchClient({
|
|
|
932
964
|
queryParameters,
|
|
933
965
|
headers
|
|
934
966
|
};
|
|
935
|
-
return transporter.request(request, requestOptions);
|
|
967
|
+
return this.transporter.request(request, requestOptions);
|
|
936
968
|
},
|
|
937
969
|
/**
|
|
938
970
|
* 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).
|
|
@@ -962,7 +994,7 @@ function createSearchClient({
|
|
|
962
994
|
headers,
|
|
963
995
|
data: deleteByParams
|
|
964
996
|
};
|
|
965
|
-
return transporter.request(request, requestOptions);
|
|
997
|
+
return this.transporter.request(request, requestOptions);
|
|
966
998
|
},
|
|
967
999
|
/**
|
|
968
1000
|
* 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/).
|
|
@@ -987,7 +1019,7 @@ function createSearchClient({
|
|
|
987
1019
|
queryParameters,
|
|
988
1020
|
headers
|
|
989
1021
|
};
|
|
990
|
-
return transporter.request(request, requestOptions);
|
|
1022
|
+
return this.transporter.request(request, requestOptions);
|
|
991
1023
|
},
|
|
992
1024
|
/**
|
|
993
1025
|
* 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).
|
|
@@ -1016,7 +1048,7 @@ function createSearchClient({
|
|
|
1016
1048
|
queryParameters,
|
|
1017
1049
|
headers
|
|
1018
1050
|
};
|
|
1019
|
-
return transporter.request(request, requestOptions);
|
|
1051
|
+
return this.transporter.request(request, requestOptions);
|
|
1020
1052
|
},
|
|
1021
1053
|
/**
|
|
1022
1054
|
* Deletes a rule by its ID. To find the object ID for rules, use the [`search` operation](#tag/Rules/operation/searchRules).
|
|
@@ -1049,7 +1081,7 @@ function createSearchClient({
|
|
|
1049
1081
|
queryParameters,
|
|
1050
1082
|
headers
|
|
1051
1083
|
};
|
|
1052
|
-
return transporter.request(request, requestOptions);
|
|
1084
|
+
return this.transporter.request(request, requestOptions);
|
|
1053
1085
|
},
|
|
1054
1086
|
/**
|
|
1055
1087
|
* Deletes a source from the list of allowed sources.
|
|
@@ -1074,7 +1106,7 @@ function createSearchClient({
|
|
|
1074
1106
|
queryParameters,
|
|
1075
1107
|
headers
|
|
1076
1108
|
};
|
|
1077
|
-
return transporter.request(request, requestOptions);
|
|
1109
|
+
return this.transporter.request(request, requestOptions);
|
|
1078
1110
|
},
|
|
1079
1111
|
/**
|
|
1080
1112
|
* Deletes a synonym by its ID. To find the object IDs of your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).
|
|
@@ -1107,7 +1139,7 @@ function createSearchClient({
|
|
|
1107
1139
|
queryParameters,
|
|
1108
1140
|
headers
|
|
1109
1141
|
};
|
|
1110
|
-
return transporter.request(request, requestOptions);
|
|
1142
|
+
return this.transporter.request(request, requestOptions);
|
|
1111
1143
|
},
|
|
1112
1144
|
/**
|
|
1113
1145
|
* 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.
|
|
@@ -1129,7 +1161,7 @@ function createSearchClient({
|
|
|
1129
1161
|
queryParameters,
|
|
1130
1162
|
headers
|
|
1131
1163
|
};
|
|
1132
|
-
return transporter.request(request, requestOptions);
|
|
1164
|
+
return this.transporter.request(request, requestOptions);
|
|
1133
1165
|
},
|
|
1134
1166
|
/**
|
|
1135
1167
|
* Checks the status of a given application task.
|
|
@@ -1154,7 +1186,7 @@ function createSearchClient({
|
|
|
1154
1186
|
queryParameters,
|
|
1155
1187
|
headers
|
|
1156
1188
|
};
|
|
1157
|
-
return transporter.request(request, requestOptions);
|
|
1189
|
+
return this.transporter.request(request, requestOptions);
|
|
1158
1190
|
},
|
|
1159
1191
|
/**
|
|
1160
1192
|
* Lists supported languages with their supported dictionary types and number of custom entries.
|
|
@@ -1174,7 +1206,7 @@ function createSearchClient({
|
|
|
1174
1206
|
queryParameters,
|
|
1175
1207
|
headers
|
|
1176
1208
|
};
|
|
1177
|
-
return transporter.request(request, requestOptions);
|
|
1209
|
+
return this.transporter.request(request, requestOptions);
|
|
1178
1210
|
},
|
|
1179
1211
|
/**
|
|
1180
1212
|
* Retrieves the languages for which standard dictionary entries are turned off.
|
|
@@ -1194,7 +1226,7 @@ function createSearchClient({
|
|
|
1194
1226
|
queryParameters,
|
|
1195
1227
|
headers
|
|
1196
1228
|
};
|
|
1197
|
-
return transporter.request(request, requestOptions);
|
|
1229
|
+
return this.transporter.request(request, requestOptions);
|
|
1198
1230
|
},
|
|
1199
1231
|
/**
|
|
1200
1232
|
* 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.
|
|
@@ -1231,7 +1263,7 @@ function createSearchClient({
|
|
|
1231
1263
|
queryParameters,
|
|
1232
1264
|
headers
|
|
1233
1265
|
};
|
|
1234
|
-
return transporter.request(request, requestOptions);
|
|
1266
|
+
return this.transporter.request(request, requestOptions);
|
|
1235
1267
|
},
|
|
1236
1268
|
/**
|
|
1237
1269
|
* Retrieves one record by its object ID. To retrieve more than one record, use the [`objects` operation](#tag/Records/operation/getObjects).
|
|
@@ -1264,7 +1296,7 @@ function createSearchClient({
|
|
|
1264
1296
|
queryParameters,
|
|
1265
1297
|
headers
|
|
1266
1298
|
};
|
|
1267
|
-
return transporter.request(request, requestOptions);
|
|
1299
|
+
return this.transporter.request(request, requestOptions);
|
|
1268
1300
|
},
|
|
1269
1301
|
/**
|
|
1270
1302
|
* Retrieves one or more records, potentially from different indices. Records are returned in the same order as the requests.
|
|
@@ -1294,7 +1326,7 @@ function createSearchClient({
|
|
|
1294
1326
|
useReadTransporter: true,
|
|
1295
1327
|
cacheable: true
|
|
1296
1328
|
};
|
|
1297
|
-
return transporter.request(request, requestOptions);
|
|
1329
|
+
return this.transporter.request(request, requestOptions);
|
|
1298
1330
|
},
|
|
1299
1331
|
/**
|
|
1300
1332
|
* Retrieves a rule by its ID. To find the object ID of rules, use the [`search` operation](#tag/Rules/operation/searchRules).
|
|
@@ -1323,7 +1355,7 @@ function createSearchClient({
|
|
|
1323
1355
|
queryParameters,
|
|
1324
1356
|
headers
|
|
1325
1357
|
};
|
|
1326
|
-
return transporter.request(request, requestOptions);
|
|
1358
|
+
return this.transporter.request(request, requestOptions);
|
|
1327
1359
|
},
|
|
1328
1360
|
/**
|
|
1329
1361
|
* Retrieves an object with non-null index settings.
|
|
@@ -1348,7 +1380,7 @@ function createSearchClient({
|
|
|
1348
1380
|
queryParameters,
|
|
1349
1381
|
headers
|
|
1350
1382
|
};
|
|
1351
|
-
return transporter.request(request, requestOptions);
|
|
1383
|
+
return this.transporter.request(request, requestOptions);
|
|
1352
1384
|
},
|
|
1353
1385
|
/**
|
|
1354
1386
|
* Retrieves all allowed IP addresses with access to your application.
|
|
@@ -1368,7 +1400,7 @@ function createSearchClient({
|
|
|
1368
1400
|
queryParameters,
|
|
1369
1401
|
headers
|
|
1370
1402
|
};
|
|
1371
|
-
return transporter.request(request, requestOptions);
|
|
1403
|
+
return this.transporter.request(request, requestOptions);
|
|
1372
1404
|
},
|
|
1373
1405
|
/**
|
|
1374
1406
|
* Retrieves a syonym by its ID. To find the object IDs for your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).
|
|
@@ -1397,7 +1429,7 @@ function createSearchClient({
|
|
|
1397
1429
|
queryParameters,
|
|
1398
1430
|
headers
|
|
1399
1431
|
};
|
|
1400
|
-
return transporter.request(request, requestOptions);
|
|
1432
|
+
return this.transporter.request(request, requestOptions);
|
|
1401
1433
|
},
|
|
1402
1434
|
/**
|
|
1403
1435
|
* 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.
|
|
@@ -1426,7 +1458,7 @@ function createSearchClient({
|
|
|
1426
1458
|
queryParameters,
|
|
1427
1459
|
headers
|
|
1428
1460
|
};
|
|
1429
|
-
return transporter.request(request, requestOptions);
|
|
1461
|
+
return this.transporter.request(request, requestOptions);
|
|
1430
1462
|
},
|
|
1431
1463
|
/**
|
|
1432
1464
|
* 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.
|
|
@@ -1446,7 +1478,7 @@ function createSearchClient({
|
|
|
1446
1478
|
queryParameters,
|
|
1447
1479
|
headers
|
|
1448
1480
|
};
|
|
1449
|
-
return transporter.request(request, requestOptions);
|
|
1481
|
+
return this.transporter.request(request, requestOptions);
|
|
1450
1482
|
},
|
|
1451
1483
|
/**
|
|
1452
1484
|
* 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.
|
|
@@ -1471,7 +1503,7 @@ function createSearchClient({
|
|
|
1471
1503
|
queryParameters,
|
|
1472
1504
|
headers
|
|
1473
1505
|
};
|
|
1474
|
-
return transporter.request(request, requestOptions);
|
|
1506
|
+
return this.transporter.request(request, requestOptions);
|
|
1475
1507
|
},
|
|
1476
1508
|
/**
|
|
1477
1509
|
* 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.
|
|
@@ -1496,7 +1528,7 @@ function createSearchClient({
|
|
|
1496
1528
|
queryParameters,
|
|
1497
1529
|
headers
|
|
1498
1530
|
};
|
|
1499
|
-
return transporter.request(request, requestOptions);
|
|
1531
|
+
return this.transporter.request(request, requestOptions);
|
|
1500
1532
|
},
|
|
1501
1533
|
/**
|
|
1502
1534
|
* Lists all API keys associated with your Algolia application, including their permissions and restrictions.
|
|
@@ -1516,7 +1548,7 @@ function createSearchClient({
|
|
|
1516
1548
|
queryParameters,
|
|
1517
1549
|
headers
|
|
1518
1550
|
};
|
|
1519
|
-
return transporter.request(request, requestOptions);
|
|
1551
|
+
return this.transporter.request(request, requestOptions);
|
|
1520
1552
|
},
|
|
1521
1553
|
/**
|
|
1522
1554
|
* Lists the available clusters in a multi-cluster setup.
|
|
@@ -1536,7 +1568,7 @@ function createSearchClient({
|
|
|
1536
1568
|
queryParameters,
|
|
1537
1569
|
headers
|
|
1538
1570
|
};
|
|
1539
|
-
return transporter.request(request, requestOptions);
|
|
1571
|
+
return this.transporter.request(request, requestOptions);
|
|
1540
1572
|
},
|
|
1541
1573
|
/**
|
|
1542
1574
|
* Lists all indices in the current Algolia application. The request follows any index restrictions of the API key you use to make the request.
|
|
@@ -1565,7 +1597,7 @@ function createSearchClient({
|
|
|
1565
1597
|
queryParameters,
|
|
1566
1598
|
headers
|
|
1567
1599
|
};
|
|
1568
|
-
return transporter.request(request, requestOptions);
|
|
1600
|
+
return this.transporter.request(request, requestOptions);
|
|
1569
1601
|
},
|
|
1570
1602
|
/**
|
|
1571
1603
|
* 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.
|
|
@@ -1594,7 +1626,7 @@ function createSearchClient({
|
|
|
1594
1626
|
queryParameters,
|
|
1595
1627
|
headers
|
|
1596
1628
|
};
|
|
1597
|
-
return transporter.request(request, requestOptions);
|
|
1629
|
+
return this.transporter.request(request, requestOptions);
|
|
1598
1630
|
},
|
|
1599
1631
|
/**
|
|
1600
1632
|
* 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.
|
|
@@ -1619,7 +1651,7 @@ function createSearchClient({
|
|
|
1619
1651
|
headers,
|
|
1620
1652
|
data: batchParams
|
|
1621
1653
|
};
|
|
1622
|
-
return transporter.request(request, requestOptions);
|
|
1654
|
+
return this.transporter.request(request, requestOptions);
|
|
1623
1655
|
},
|
|
1624
1656
|
/**
|
|
1625
1657
|
* 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/).
|
|
@@ -1655,7 +1687,7 @@ function createSearchClient({
|
|
|
1655
1687
|
headers,
|
|
1656
1688
|
data: operationIndexParams
|
|
1657
1689
|
};
|
|
1658
|
-
return transporter.request(request, requestOptions);
|
|
1690
|
+
return this.transporter.request(request, requestOptions);
|
|
1659
1691
|
},
|
|
1660
1692
|
/**
|
|
1661
1693
|
* 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.
|
|
@@ -1693,7 +1725,7 @@ function createSearchClient({
|
|
|
1693
1725
|
headers,
|
|
1694
1726
|
data: attributesToUpdate
|
|
1695
1727
|
};
|
|
1696
|
-
return transporter.request(request, requestOptions);
|
|
1728
|
+
return this.transporter.request(request, requestOptions);
|
|
1697
1729
|
},
|
|
1698
1730
|
/**
|
|
1699
1731
|
* Deletes a user ID and its associated data from the clusters.
|
|
@@ -1718,7 +1750,7 @@ function createSearchClient({
|
|
|
1718
1750
|
queryParameters,
|
|
1719
1751
|
headers
|
|
1720
1752
|
};
|
|
1721
|
-
return transporter.request(request, requestOptions);
|
|
1753
|
+
return this.transporter.request(request, requestOptions);
|
|
1722
1754
|
},
|
|
1723
1755
|
/**
|
|
1724
1756
|
* Replaces the list of allowed sources.
|
|
@@ -1744,7 +1776,7 @@ function createSearchClient({
|
|
|
1744
1776
|
headers,
|
|
1745
1777
|
data: source
|
|
1746
1778
|
};
|
|
1747
|
-
return transporter.request(request, requestOptions);
|
|
1779
|
+
return this.transporter.request(request, requestOptions);
|
|
1748
1780
|
},
|
|
1749
1781
|
/**
|
|
1750
1782
|
* 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.
|
|
@@ -1769,7 +1801,7 @@ function createSearchClient({
|
|
|
1769
1801
|
queryParameters,
|
|
1770
1802
|
headers
|
|
1771
1803
|
};
|
|
1772
|
-
return transporter.request(request, requestOptions);
|
|
1804
|
+
return this.transporter.request(request, requestOptions);
|
|
1773
1805
|
},
|
|
1774
1806
|
/**
|
|
1775
1807
|
* 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).
|
|
@@ -1799,7 +1831,7 @@ function createSearchClient({
|
|
|
1799
1831
|
headers,
|
|
1800
1832
|
data: body
|
|
1801
1833
|
};
|
|
1802
|
-
return transporter.request(request, requestOptions);
|
|
1834
|
+
return this.transporter.request(request, requestOptions);
|
|
1803
1835
|
},
|
|
1804
1836
|
/**
|
|
1805
1837
|
* 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).
|
|
@@ -1840,7 +1872,7 @@ function createSearchClient({
|
|
|
1840
1872
|
headers,
|
|
1841
1873
|
data: rule
|
|
1842
1874
|
};
|
|
1843
|
-
return transporter.request(request, requestOptions);
|
|
1875
|
+
return this.transporter.request(request, requestOptions);
|
|
1844
1876
|
},
|
|
1845
1877
|
/**
|
|
1846
1878
|
* 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.
|
|
@@ -1878,7 +1910,7 @@ function createSearchClient({
|
|
|
1878
1910
|
headers,
|
|
1879
1911
|
data: rules
|
|
1880
1912
|
};
|
|
1881
|
-
return transporter.request(request, requestOptions);
|
|
1913
|
+
return this.transporter.request(request, requestOptions);
|
|
1882
1914
|
},
|
|
1883
1915
|
/**
|
|
1884
1916
|
* 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).
|
|
@@ -1922,7 +1954,7 @@ function createSearchClient({
|
|
|
1922
1954
|
headers,
|
|
1923
1955
|
data: synonymHit
|
|
1924
1956
|
};
|
|
1925
|
-
return transporter.request(request, requestOptions);
|
|
1957
|
+
return this.transporter.request(request, requestOptions);
|
|
1926
1958
|
},
|
|
1927
1959
|
/**
|
|
1928
1960
|
* If a synonym with the `objectID` doesn\'t exist, Algolia adds a new one. Otherwise, existing synonyms are replaced.
|
|
@@ -1960,7 +1992,7 @@ function createSearchClient({
|
|
|
1960
1992
|
headers,
|
|
1961
1993
|
data: synonymHit
|
|
1962
1994
|
};
|
|
1963
|
-
return transporter.request(request, requestOptions);
|
|
1995
|
+
return this.transporter.request(request, requestOptions);
|
|
1964
1996
|
},
|
|
1965
1997
|
/**
|
|
1966
1998
|
* 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.
|
|
@@ -2011,7 +2043,7 @@ function createSearchClient({
|
|
|
2011
2043
|
useReadTransporter: true,
|
|
2012
2044
|
cacheable: true
|
|
2013
2045
|
};
|
|
2014
|
-
return transporter.request(request, requestOptions);
|
|
2046
|
+
return this.transporter.request(request, requestOptions);
|
|
2015
2047
|
},
|
|
2016
2048
|
/**
|
|
2017
2049
|
* Searches for standard and custom dictionary entries.
|
|
@@ -2053,7 +2085,7 @@ function createSearchClient({
|
|
|
2053
2085
|
useReadTransporter: true,
|
|
2054
2086
|
cacheable: true
|
|
2055
2087
|
};
|
|
2056
|
-
return transporter.request(request, requestOptions);
|
|
2088
|
+
return this.transporter.request(request, requestOptions);
|
|
2057
2089
|
},
|
|
2058
2090
|
/**
|
|
2059
2091
|
* 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**.
|
|
@@ -2086,7 +2118,7 @@ function createSearchClient({
|
|
|
2086
2118
|
useReadTransporter: true,
|
|
2087
2119
|
cacheable: true
|
|
2088
2120
|
};
|
|
2089
|
-
return transporter.request(request, requestOptions);
|
|
2121
|
+
return this.transporter.request(request, requestOptions);
|
|
2090
2122
|
},
|
|
2091
2123
|
/**
|
|
2092
2124
|
* Searches for rules in your index.
|
|
@@ -2115,7 +2147,7 @@ function createSearchClient({
|
|
|
2115
2147
|
useReadTransporter: true,
|
|
2116
2148
|
cacheable: true
|
|
2117
2149
|
};
|
|
2118
|
-
return transporter.request(request, requestOptions);
|
|
2150
|
+
return this.transporter.request(request, requestOptions);
|
|
2119
2151
|
},
|
|
2120
2152
|
/**
|
|
2121
2153
|
* 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.
|
|
@@ -2144,7 +2176,7 @@ function createSearchClient({
|
|
|
2144
2176
|
useReadTransporter: true,
|
|
2145
2177
|
cacheable: true
|
|
2146
2178
|
};
|
|
2147
|
-
return transporter.request(request, requestOptions);
|
|
2179
|
+
return this.transporter.request(request, requestOptions);
|
|
2148
2180
|
},
|
|
2149
2181
|
/**
|
|
2150
2182
|
* Searches for synonyms in your index.
|
|
@@ -2176,7 +2208,7 @@ function createSearchClient({
|
|
|
2176
2208
|
useReadTransporter: true,
|
|
2177
2209
|
cacheable: true
|
|
2178
2210
|
};
|
|
2179
|
-
return transporter.request(request, requestOptions);
|
|
2211
|
+
return this.transporter.request(request, requestOptions);
|
|
2180
2212
|
},
|
|
2181
2213
|
/**
|
|
2182
2214
|
* 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).
|
|
@@ -2206,7 +2238,7 @@ function createSearchClient({
|
|
|
2206
2238
|
useReadTransporter: true,
|
|
2207
2239
|
cacheable: true
|
|
2208
2240
|
};
|
|
2209
|
-
return transporter.request(request, requestOptions);
|
|
2241
|
+
return this.transporter.request(request, requestOptions);
|
|
2210
2242
|
},
|
|
2211
2243
|
/**
|
|
2212
2244
|
* Turns standard stop word dictionary entries on or off for a given language.
|
|
@@ -2236,7 +2268,7 @@ function createSearchClient({
|
|
|
2236
2268
|
headers,
|
|
2237
2269
|
data: dictionarySettingsParams
|
|
2238
2270
|
};
|
|
2239
|
-
return transporter.request(request, requestOptions);
|
|
2271
|
+
return this.transporter.request(request, requestOptions);
|
|
2240
2272
|
},
|
|
2241
2273
|
/**
|
|
2242
2274
|
* 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.
|
|
@@ -2270,7 +2302,7 @@ function createSearchClient({
|
|
|
2270
2302
|
headers,
|
|
2271
2303
|
data: indexSettings
|
|
2272
2304
|
};
|
|
2273
|
-
return transporter.request(request, requestOptions);
|
|
2305
|
+
return this.transporter.request(request, requestOptions);
|
|
2274
2306
|
},
|
|
2275
2307
|
/**
|
|
2276
2308
|
* Replaces the permissions of an existing API key. Any unspecified attribute resets that attribute to its default value.
|
|
@@ -2303,7 +2335,7 @@ function createSearchClient({
|
|
|
2303
2335
|
headers,
|
|
2304
2336
|
data: apiKey
|
|
2305
2337
|
};
|
|
2306
|
-
return transporter.request(request, requestOptions);
|
|
2338
|
+
return this.transporter.request(request, requestOptions);
|
|
2307
2339
|
}
|
|
2308
2340
|
};
|
|
2309
2341
|
}
|