@algolia/client-search 5.0.0-alpha.99 → 5.0.0-beta.2
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/builds/browser.d.ts +86 -3
- package/dist/builds/browser.d.ts.map +1 -1
- package/dist/builds/node.d.ts +104 -3
- package/dist/builds/node.d.ts.map +1 -1
- package/dist/client-search.cjs +419 -219
- package/dist/client-search.esm.browser.js +376 -212
- package/dist/client-search.esm.node.js +420 -220
- package/dist/client-search.umd.js +2 -2
- package/dist/model/acl.d.ts +1 -1
- package/dist/model/action.d.ts +1 -1
- package/dist/model/addApiKeyResponse.d.ts +1 -1
- package/dist/model/anchoring.d.ts +1 -1
- package/dist/model/apiKey.d.ts +8 -8
- package/dist/model/apiKeyOperation.d.ts +2 -0
- package/dist/model/apiKeyOperation.d.ts.map +1 -0
- package/dist/model/aroundPrecision.d.ts +1 -1
- package/dist/model/aroundPrecisionFromValueInner.d.ts +9 -0
- package/dist/model/aroundPrecisionFromValueInner.d.ts.map +1 -1
- package/dist/model/aroundRadius.d.ts +1 -1
- package/dist/model/aroundRadiusAll.d.ts +3 -0
- package/dist/model/aroundRadiusAll.d.ts.map +1 -1
- package/dist/model/automaticFacetFilter.d.ts +4 -4
- package/dist/model/automaticFacetFilters.d.ts +1 -1
- package/dist/model/baseGetApiKeyResponse.d.ts +1 -1
- package/dist/model/baseIndexSettings.d.ts +22 -17
- package/dist/model/baseIndexSettings.d.ts.map +1 -1
- package/dist/model/baseSearchParamsWithoutQuery.d.ts +26 -29
- package/dist/model/baseSearchParamsWithoutQuery.d.ts.map +1 -1
- package/dist/model/baseSearchResponse.d.ts +10 -6
- package/dist/model/baseSearchResponse.d.ts.map +1 -1
- package/dist/model/batchDictionaryEntriesParams.d.ts +3 -3
- package/dist/model/batchResponse.d.ts +2 -2
- package/dist/model/builtInOperation.d.ts +2 -2
- package/dist/model/builtInOperationType.d.ts +1 -1
- package/dist/model/clientMethodProps.d.ts +124 -65
- package/dist/model/clientMethodProps.d.ts.map +1 -1
- package/dist/model/condition.d.ts +7 -3
- package/dist/model/condition.d.ts.map +1 -1
- package/dist/model/consequence.d.ts +5 -5
- package/dist/model/consequenceHide.d.ts +2 -2
- package/dist/model/consequenceQuery.d.ts +1 -1
- package/dist/model/consequenceQueryObject.d.ts +2 -2
- package/dist/model/createdAtResponse.d.ts +1 -1
- package/dist/model/cursor.d.ts +1 -1
- package/dist/model/deleteApiKeyResponse.d.ts +1 -1
- package/dist/model/deleteByParams.d.ts +4 -4
- package/dist/model/deleteSourceResponse.d.ts +1 -1
- package/dist/model/deletedAtResponse.d.ts +2 -2
- package/dist/model/dictionaryEntry.d.ts +6 -8
- package/dist/model/dictionaryEntry.d.ts.map +1 -1
- package/dist/model/dictionaryEntryState.d.ts +1 -1
- package/dist/model/dictionaryLanguage.d.ts +2 -2
- package/dist/model/dictionarySettingsParams.d.ts +1 -1
- package/dist/model/distinct.d.ts +1 -1
- package/dist/model/edit.d.ts +1 -1
- package/dist/model/exactOnSingleWordQuery.d.ts +1 -1
- package/dist/model/facetFilters.d.ts +2 -3
- package/dist/model/facetFilters.d.ts.map +1 -1
- package/dist/model/facetHits.d.ts +2 -2
- package/dist/model/facetOrdering.d.ts +2 -2
- package/dist/model/facets.d.ts +2 -2
- package/dist/model/fetchedIndex.d.ts +1 -1
- package/dist/model/getObjectsRequest.d.ts +3 -3
- package/dist/model/getObjectsResponse.d.ts +1 -1
- package/dist/model/hasPendingMappingsResponse.d.ts +1 -1
- package/dist/model/highlightResult.d.ts +1 -1
- package/dist/model/highlightResult.d.ts.map +1 -1
- package/dist/model/highlightResultOption.d.ts +3 -3
- package/dist/model/hit.d.ts +4 -4
- package/dist/model/ignorePlurals.d.ts +3 -2
- package/dist/model/ignorePlurals.d.ts.map +1 -1
- package/dist/model/index.d.ts +4 -1
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/indexSettings.d.ts +1 -1
- package/dist/model/indexSettingsAsSearchParams.d.ts +32 -35
- package/dist/model/indexSettingsAsSearchParams.d.ts.map +1 -1
- package/dist/model/log.d.ts +11 -11
- package/dist/model/logQuery.d.ts +1 -1
- package/dist/model/matchLevel.d.ts +1 -1
- package/dist/model/mode.d.ts +1 -1
- package/dist/model/multipleBatchRequest.d.ts +1 -1
- package/dist/model/multipleBatchResponse.d.ts +2 -2
- package/dist/model/numericFilters.d.ts +2 -3
- package/dist/model/numericFilters.d.ts.map +1 -1
- package/dist/model/operationIndexParams.d.ts +2 -2
- package/dist/model/operationType.d.ts +1 -1
- package/dist/model/optionalFilters.d.ts +2 -3
- package/dist/model/optionalFilters.d.ts.map +1 -1
- package/dist/model/params.d.ts +1 -1
- package/dist/model/promoteObjectID.d.ts +2 -2
- package/dist/model/promoteObjectIDs.d.ts +2 -2
- package/dist/model/queryType.d.ts +1 -1
- package/dist/model/rankingInfo.d.ts +10 -7
- package/dist/model/rankingInfo.d.ts.map +1 -1
- package/dist/model/reRankingApplyFilter.d.ts +2 -3
- package/dist/model/reRankingApplyFilter.d.ts.map +1 -1
- package/dist/model/removeStopWords.d.ts +3 -2
- package/dist/model/removeStopWords.d.ts.map +1 -1
- package/dist/model/removeUserIdResponse.d.ts +1 -1
- package/dist/model/removeWordsIfNoResults.d.ts +1 -1
- package/dist/model/renderingContent.d.ts +1 -1
- package/dist/model/replaceSourceResponse.d.ts +1 -1
- package/dist/model/rule.d.ts +5 -5
- package/dist/model/saveObjectResponse.d.ts +3 -3
- package/dist/model/saveSynonymResponse.d.ts +2 -2
- package/dist/model/searchDictionaryEntriesParams.d.ts +5 -7
- package/dist/model/searchDictionaryEntriesParams.d.ts.map +1 -1
- package/dist/model/searchDictionaryEntriesResponse.d.ts +20 -0
- package/dist/model/searchDictionaryEntriesResponse.d.ts.map +1 -0
- package/dist/model/searchForFacetValuesRequest.d.ts +1 -1
- package/dist/model/searchForFacetValuesResponse.d.ts +4 -1
- package/dist/model/searchForFacetValuesResponse.d.ts.map +1 -1
- package/dist/model/searchForFacetsOptions.d.ts +2 -2
- package/dist/model/searchForHitsOptions.d.ts +1 -1
- package/dist/model/searchHits.d.ts +6 -3
- package/dist/model/searchHits.d.ts.map +1 -1
- package/dist/model/searchParamsObject.d.ts +3 -0
- package/dist/model/searchParamsObject.d.ts.map +1 -1
- package/dist/model/searchParamsQuery.d.ts +1 -1
- package/dist/model/searchRulesParams.d.ts +4 -8
- package/dist/model/searchRulesParams.d.ts.map +1 -1
- package/dist/model/searchRulesResponse.d.ts +2 -2
- package/dist/model/searchStrategy.d.ts +1 -1
- package/dist/model/searchSynonymsParams.d.ts +2 -2
- package/dist/model/searchSynonymsResponse.d.ts +2 -2
- package/dist/model/searchUserIdsParams.d.ts +1 -1
- package/dist/model/searchUserIdsResponse.d.ts +3 -3
- package/dist/model/securedAPIKeyRestrictions.d.ts +25 -0
- package/dist/model/securedAPIKeyRestrictions.d.ts.map +1 -0
- package/dist/model/semanticSearch.d.ts +2 -2
- package/dist/model/snippetResult.d.ts +1 -1
- package/dist/model/snippetResult.d.ts.map +1 -1
- package/dist/model/snippetResultOption.d.ts +2 -2
- package/dist/model/sortRemainingBy.d.ts +1 -1
- package/dist/model/supportedLanguage.d.ts +5 -0
- package/dist/model/supportedLanguage.d.ts.map +1 -0
- package/dist/model/tagFilters.d.ts +2 -3
- package/dist/model/tagFilters.d.ts.map +1 -1
- package/dist/model/taskStatus.d.ts +1 -1
- package/dist/model/timeRange.d.ts +2 -2
- package/dist/model/typoTolerance.d.ts +1 -1
- package/dist/model/typoToleranceEnum.d.ts +3 -0
- package/dist/model/typoToleranceEnum.d.ts.map +1 -1
- package/dist/model/updateApiKeyResponse.d.ts +1 -1
- package/dist/model/updatedAtResponse.d.ts +2 -2
- package/dist/model/updatedAtWithObjectIdResponse.d.ts +3 -3
- package/dist/model/updatedRuleResponse.d.ts +3 -3
- package/dist/model/userHit.d.ts +1 -1
- package/dist/model/userId.d.ts +1 -1
- package/dist/model/value.d.ts +1 -1
- package/dist/src/searchClient.d.ts +324 -202
- package/dist/src/searchClient.d.ts.map +1 -1
- package/model/acl.ts +1 -1
- package/model/action.ts +1 -1
- package/model/addApiKeyResponse.ts +1 -1
- package/model/anchoring.ts +1 -1
- package/model/apiKey.ts +8 -8
- package/model/{mixedSearchFilters.ts → apiKeyOperation.ts} +1 -1
- package/model/aroundPrecision.ts +1 -1
- package/model/aroundPrecisionFromValueInner.ts +9 -0
- package/model/aroundRadius.ts +1 -1
- package/model/aroundRadiusAll.ts +3 -0
- package/model/automaticFacetFilter.ts +4 -4
- package/model/automaticFacetFilters.ts +1 -1
- package/model/baseGetApiKeyResponse.ts +1 -1
- package/model/baseIndexSettings.ts +24 -17
- package/model/baseSearchParamsWithoutQuery.ts +26 -30
- package/model/baseSearchResponse.ts +11 -6
- package/model/batchDictionaryEntriesParams.ts +3 -3
- package/model/batchResponse.ts +2 -2
- package/model/builtInOperation.ts +2 -2
- package/model/builtInOperationType.ts +1 -1
- package/model/clientMethodProps.ts +135 -65
- package/model/condition.ts +8 -3
- package/model/consequence.ts +5 -5
- package/model/consequenceHide.ts +2 -2
- package/model/consequenceQuery.ts +1 -1
- package/model/consequenceQueryObject.ts +2 -2
- package/model/createdAtResponse.ts +1 -1
- package/model/cursor.ts +1 -1
- package/model/deleteApiKeyResponse.ts +1 -1
- package/model/deleteByParams.ts +4 -4
- package/model/deleteSourceResponse.ts +1 -1
- package/model/deletedAtResponse.ts +2 -2
- package/model/dictionaryEntry.ts +6 -8
- package/model/dictionaryEntryState.ts +1 -1
- package/model/dictionaryLanguage.ts +2 -2
- package/model/dictionarySettingsParams.ts +1 -1
- package/model/distinct.ts +1 -1
- package/model/edit.ts +1 -1
- package/model/exactOnSingleWordQuery.ts +1 -1
- package/model/facetFilters.ts +2 -4
- package/model/facetHits.ts +2 -2
- package/model/facetOrdering.ts +2 -2
- package/model/facets.ts +2 -2
- package/model/fetchedIndex.ts +1 -1
- package/model/getObjectsRequest.ts +3 -3
- package/model/getObjectsResponse.ts +1 -1
- package/model/hasPendingMappingsResponse.ts +1 -1
- package/model/highlightResult.ts +1 -0
- package/model/highlightResultOption.ts +3 -3
- package/model/hit.ts +4 -4
- package/model/ignorePlurals.ts +4 -2
- package/model/index.ts +4 -1
- package/model/indexSettings.ts +1 -1
- package/model/indexSettingsAsSearchParams.ts +32 -36
- package/model/log.ts +11 -11
- package/model/logQuery.ts +1 -1
- package/model/matchLevel.ts +1 -1
- package/model/mode.ts +1 -1
- package/model/multipleBatchRequest.ts +1 -1
- package/model/multipleBatchResponse.ts +2 -2
- package/model/numericFilters.ts +2 -4
- package/model/operationIndexParams.ts +2 -2
- package/model/operationType.ts +1 -1
- package/model/optionalFilters.ts +2 -4
- package/model/params.ts +1 -1
- package/model/promoteObjectID.ts +2 -2
- package/model/promoteObjectIDs.ts +2 -2
- package/model/queryType.ts +1 -1
- package/model/rankingInfo.ts +10 -7
- package/model/reRankingApplyFilter.ts +2 -4
- package/model/removeStopWords.ts +4 -2
- package/model/removeUserIdResponse.ts +1 -1
- package/model/removeWordsIfNoResults.ts +1 -1
- package/model/renderingContent.ts +1 -1
- package/model/replaceSourceResponse.ts +1 -1
- package/model/rule.ts +5 -5
- package/model/saveObjectResponse.ts +3 -3
- package/model/saveSynonymResponse.ts +2 -2
- package/model/searchDictionaryEntriesParams.ts +6 -7
- package/model/searchDictionaryEntriesResponse.ts +25 -0
- package/model/searchForFacetValuesRequest.ts +1 -1
- package/model/searchForFacetValuesResponse.ts +4 -1
- package/model/searchForFacetsOptions.ts +2 -2
- package/model/searchForHitsOptions.ts +1 -1
- package/model/searchHits.ts +6 -3
- package/model/searchParamsObject.ts +3 -0
- package/model/searchParamsQuery.ts +1 -1
- package/model/searchRulesParams.ts +4 -9
- package/model/searchRulesResponse.ts +2 -2
- package/model/searchStrategy.ts +1 -1
- package/model/searchSynonymsParams.ts +2 -2
- package/model/searchSynonymsResponse.ts +2 -2
- package/model/searchUserIdsParams.ts +1 -1
- package/model/searchUserIdsResponse.ts +3 -3
- package/model/securedAPIKeyRestrictions.ts +32 -0
- package/model/semanticSearch.ts +2 -2
- package/model/snippetResult.ts +2 -1
- package/model/snippetResultOption.ts +2 -2
- package/model/sortRemainingBy.ts +1 -1
- package/model/supportedLanguage.ts +74 -0
- package/model/tagFilters.ts +2 -4
- package/model/taskStatus.ts +1 -1
- package/model/timeRange.ts +2 -2
- package/model/typoTolerance.ts +1 -1
- package/model/typoToleranceEnum.ts +3 -0
- package/model/updateApiKeyResponse.ts +1 -1
- package/model/updatedAtResponse.ts +2 -2
- package/model/updatedAtWithObjectIdResponse.ts +3 -3
- package/model/updatedRuleResponse.ts +3 -3
- package/model/userHit.ts +1 -1
- package/model/userId.ts +1 -1
- package/model/value.ts +1 -1
- package/package.json +7 -7
- package/dist/model/mixedSearchFilters.d.ts +0 -2
- package/dist/model/mixedSearchFilters.d.ts.map +0 -1
package/dist/client-search.cjs
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var crypto = require('crypto');
|
|
3
4
|
var clientCommon = require('@algolia/client-common');
|
|
4
5
|
var requesterNodeHttp = require('@algolia/requester-node-http');
|
|
5
6
|
|
|
6
7
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
|
7
|
-
const apiClientVersion = '5.0.0-
|
|
8
|
+
const apiClientVersion = '5.0.0-beta.2';
|
|
8
9
|
function getDefaultHosts(appId) {
|
|
9
10
|
return [
|
|
10
11
|
{
|
|
@@ -90,7 +91,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
90
91
|
* Helper: Wait for a task to be published (completed) for a given `indexName` and `taskID`.
|
|
91
92
|
*
|
|
92
93
|
* @summary Helper method that waits for a task to be published (completed).
|
|
93
|
-
* @param waitForTaskOptions - The waitForTaskOptions object.
|
|
94
|
+
* @param waitForTaskOptions - The `waitForTaskOptions` object.
|
|
94
95
|
* @param waitForTaskOptions.indexName - The `indexName` where the operation was performed.
|
|
95
96
|
* @param waitForTaskOptions.taskID - The `taskID` returned in the method response.
|
|
96
97
|
* @param waitForTaskOptions.maxRetries - The maximum number of retries. 50 by default.
|
|
@@ -114,7 +115,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
114
115
|
* Helper: Wait for an API key to be added, updated or deleted based on a given `operation`.
|
|
115
116
|
*
|
|
116
117
|
* @summary Helper method that waits for an API key task to be processed.
|
|
117
|
-
* @param waitForApiKeyOptions - The waitForApiKeyOptions object.
|
|
118
|
+
* @param waitForApiKeyOptions - The `waitForApiKeyOptions` object.
|
|
118
119
|
* @param waitForApiKeyOptions.operation - The `operation` that was done on a `key`.
|
|
119
120
|
* @param waitForApiKeyOptions.key - The `key` that has been added, deleted or updated.
|
|
120
121
|
* @param waitForApiKeyOptions.apiKey - Necessary to know if an `update` operation has been processed, compare fields of the response with it.
|
|
@@ -167,7 +168,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
167
168
|
* Helper: Iterate on the `browse` method of the client to allow aggregating objects of an index.
|
|
168
169
|
*
|
|
169
170
|
* @summary Helper method that iterates on the `browse` method.
|
|
170
|
-
* @param browseObjects - The browseObjects object.
|
|
171
|
+
* @param browseObjects - The `browseObjects` object.
|
|
171
172
|
* @param browseObjects.indexName - The index in which to perform the request.
|
|
172
173
|
* @param browseObjects.browseParams - The `browse` parameters.
|
|
173
174
|
* @param browseObjects.validate - The validator function. It receive the resolved return of the API call. By default, stops when there is no `cursor` in the response.
|
|
@@ -193,11 +194,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
193
194
|
* Helper: Iterate on the `searchRules` method of the client to allow aggregating rules of an index.
|
|
194
195
|
*
|
|
195
196
|
* @summary Helper method that iterates on the `searchRules` method.
|
|
196
|
-
* @param
|
|
197
|
-
* @param
|
|
198
|
-
* @param
|
|
199
|
-
* @param
|
|
200
|
-
* @param
|
|
197
|
+
* @param browseRules - The `browseRules` object.
|
|
198
|
+
* @param browseRules.indexName - The index in which to perform the request.
|
|
199
|
+
* @param browseRules.searchRulesParams - The `searchRules` method parameters.
|
|
200
|
+
* @param browseRules.validate - The validator function. It receive the resolved return of the API call. By default, stops when there is less hits returned than the number of maximum hits (1000).
|
|
201
|
+
* @param browseRules.aggregator - The function that runs right after the API call has been resolved, allows you to do anything with the response before `validate`.
|
|
201
202
|
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `searchRules` method and merged with the transporter requestOptions.
|
|
202
203
|
*/
|
|
203
204
|
browseRules({ indexName, searchRulesParams, ...browseRulesOptions }, requestOptions) {
|
|
@@ -225,11 +226,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
225
226
|
* Helper: Iterate on the `searchSynonyms` method of the client to allow aggregating rules of an index.
|
|
226
227
|
*
|
|
227
228
|
* @summary Helper method that iterates on the `searchSynonyms` method.
|
|
228
|
-
* @param
|
|
229
|
-
* @param
|
|
230
|
-
* @param
|
|
231
|
-
* @param
|
|
232
|
-
* @param
|
|
229
|
+
* @param browseSynonyms - The `browseSynonyms` object.
|
|
230
|
+
* @param browseSynonyms.indexName - The index in which to perform the request.
|
|
231
|
+
* @param browseSynonyms.validate - The validator function. It receive the resolved return of the API call. By default, stops when there is less hits returned than the number of maximum hits (1000).
|
|
232
|
+
* @param browseSynonyms.aggregator - The function that runs right after the API call has been resolved, allows you to do anything with the response before `validate`.
|
|
233
|
+
* @param browseSynonyms.searchSynonymsParams - The `searchSynonyms` method parameters.
|
|
233
234
|
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `searchSynonyms` method and merged with the transporter requestOptions.
|
|
234
235
|
*/
|
|
235
236
|
browseSynonyms({ indexName, searchSynonymsParams, ...browseSynonymsOptions }, requestOptions) {
|
|
@@ -239,16 +240,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
239
240
|
hitsPerPage: 1000,
|
|
240
241
|
};
|
|
241
242
|
return clientCommon.createIterablePromise({
|
|
242
|
-
func: (
|
|
243
|
-
|
|
243
|
+
func: (_) => {
|
|
244
|
+
const resp = this.searchSynonyms({
|
|
244
245
|
indexName,
|
|
245
246
|
searchSynonymsParams: {
|
|
246
247
|
...params,
|
|
247
|
-
page:
|
|
248
|
-
? previousResponse.page + 1
|
|
249
|
-
: params.page,
|
|
248
|
+
page: params.page,
|
|
250
249
|
},
|
|
251
250
|
}, requestOptions);
|
|
251
|
+
params.page += 1;
|
|
252
|
+
return resp;
|
|
252
253
|
},
|
|
253
254
|
validate: (response) => response.nbHits < params.hitsPerPage,
|
|
254
255
|
...browseSynonymsOptions,
|
|
@@ -277,9 +278,76 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
277
278
|
return this.search(searchMethodParams, requestOptions);
|
|
278
279
|
},
|
|
279
280
|
/**
|
|
280
|
-
*
|
|
281
|
+
* Helper: Chunks the given `objects` list in subset of 1000 elements max in order to make it fit in `batch` requests.
|
|
282
|
+
*
|
|
283
|
+
* @summary Helper: Chunks the given `objects` list in subset of 1000 elements max in order to make it fit in `batch` requests.
|
|
284
|
+
* @param chunkedBatch - The `chunkedBatch` object.
|
|
285
|
+
* @param chunkedBatch.indexName - The `indexName` to replace `objects` in.
|
|
286
|
+
* @param chunkedBatch.objects - The array of `objects` to store in the given Algolia `indexName`.
|
|
287
|
+
* @param chunkedBatch.action - The `batch` `action` to perform on the given array of `objects`, defaults to `addObject`.
|
|
288
|
+
* @param chunkedBatch.waitForTasks - Whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable.
|
|
289
|
+
* @param chunkedBatch.batchSize - The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.
|
|
290
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
|
|
291
|
+
*/
|
|
292
|
+
async chunkedBatch({ indexName, objects, action = 'addObject', waitForTasks, batchSize = 1000, }, requestOptions) {
|
|
293
|
+
let requests = [];
|
|
294
|
+
const responses = [];
|
|
295
|
+
for (const [i, obj] of objects.entries()) {
|
|
296
|
+
requests.push({ action, body: obj });
|
|
297
|
+
if (i % batchSize === 0) {
|
|
298
|
+
responses.push(await this.batch({ indexName, batchWriteParams: { requests } }, requestOptions));
|
|
299
|
+
requests = [];
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
if (waitForTasks) {
|
|
303
|
+
for (const resp of responses) {
|
|
304
|
+
await this.waitForTask({ indexName, taskID: resp.taskID });
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
return responses;
|
|
308
|
+
},
|
|
309
|
+
/**
|
|
310
|
+
* Helper: Replaces all objects (records) in the given `index_name` with the given `objects`. A temporary index is created during this process in order to backup your data.
|
|
311
|
+
*
|
|
312
|
+
* @summary Helper: Replaces all objects (records) in the given `index_name` with the given `objects`. A temporary index is created during this process in order to backup your data.
|
|
313
|
+
* @param replaceAllObjects - The `replaceAllObjects` object.
|
|
314
|
+
* @param replaceAllObjects.indexName - The `indexName` to replace `objects` in.
|
|
315
|
+
* @param replaceAllObjects.objects - The array of `objects` to store in the given Algolia `indexName`.
|
|
316
|
+
* @param replaceAllObjects.batchSize - The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.
|
|
317
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
|
|
318
|
+
*/
|
|
319
|
+
async replaceAllObjects({ indexName, objects, batchSize }, requestOptions) {
|
|
320
|
+
const randomSuffix = Math.random().toString(36).substring(7);
|
|
321
|
+
const tmpIndexName = `${indexName}_tmp_${randomSuffix}`;
|
|
322
|
+
const copyOperationResponse = await this.operationIndex({
|
|
323
|
+
indexName,
|
|
324
|
+
operationIndexParams: {
|
|
325
|
+
operation: 'copy',
|
|
326
|
+
destination: tmpIndexName,
|
|
327
|
+
scope: ['settings', 'rules', 'synonyms'],
|
|
328
|
+
},
|
|
329
|
+
}, requestOptions);
|
|
330
|
+
await this.waitForTask({
|
|
331
|
+
indexName,
|
|
332
|
+
taskID: copyOperationResponse.taskID,
|
|
333
|
+
});
|
|
334
|
+
const batchResponses = await this.chunkedBatch({ indexName: tmpIndexName, objects, waitForTasks: true, batchSize }, requestOptions);
|
|
335
|
+
const moveOperationResponse = await this.operationIndex({
|
|
336
|
+
indexName: tmpIndexName,
|
|
337
|
+
operationIndexParams: { operation: 'move', destination: indexName },
|
|
338
|
+
}, requestOptions);
|
|
339
|
+
await this.waitForTask({
|
|
340
|
+
indexName,
|
|
341
|
+
taskID: moveOperationResponse.taskID,
|
|
342
|
+
});
|
|
343
|
+
return { copyOperationResponse, batchResponses, moveOperationResponse };
|
|
344
|
+
},
|
|
345
|
+
/**
|
|
346
|
+
* Creates a new API key with specific permissions and restrictions.
|
|
347
|
+
*
|
|
348
|
+
* Required API Key ACLs:
|
|
349
|
+
* - admin.
|
|
281
350
|
*
|
|
282
|
-
* @summary Add API key.
|
|
283
351
|
* @param apiKey - The apiKey object.
|
|
284
352
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
285
353
|
*/
|
|
@@ -303,13 +371,15 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
303
371
|
return transporter.request(request, requestOptions);
|
|
304
372
|
},
|
|
305
373
|
/**
|
|
306
|
-
* If
|
|
374
|
+
* 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).
|
|
375
|
+
*
|
|
376
|
+
* Required API Key ACLs:
|
|
377
|
+
* - addObject.
|
|
307
378
|
*
|
|
308
|
-
* @summary Add or update a record (using objectID).
|
|
309
379
|
* @param addOrUpdateObject - The addOrUpdateObject object.
|
|
310
|
-
* @param addOrUpdateObject.indexName -
|
|
311
|
-
* @param addOrUpdateObject.objectID - Unique record
|
|
312
|
-
* @param addOrUpdateObject.body -
|
|
380
|
+
* @param addOrUpdateObject.indexName - Name of the index on which to perform the operation.
|
|
381
|
+
* @param addOrUpdateObject.objectID - Unique record identifier.
|
|
382
|
+
* @param addOrUpdateObject.body - The record, a schemaless object with attributes that are useful in the context of search and discovery.
|
|
313
383
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
314
384
|
*/
|
|
315
385
|
addOrUpdateObject({ indexName, objectID, body }, requestOptions) {
|
|
@@ -337,9 +407,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
337
407
|
return transporter.request(request, requestOptions);
|
|
338
408
|
},
|
|
339
409
|
/**
|
|
340
|
-
*
|
|
410
|
+
* Adds a source to the list of allowed sources.
|
|
411
|
+
*
|
|
412
|
+
* Required API Key ACLs:
|
|
413
|
+
* - admin.
|
|
341
414
|
*
|
|
342
|
-
* @summary Add a source.
|
|
343
415
|
* @param source - Source to add.
|
|
344
416
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
345
417
|
*/
|
|
@@ -363,11 +435,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
363
435
|
return transporter.request(request, requestOptions);
|
|
364
436
|
},
|
|
365
437
|
/**
|
|
366
|
-
*
|
|
438
|
+
* 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.
|
|
439
|
+
*
|
|
440
|
+
* Required API Key ACLs:
|
|
441
|
+
* - admin.
|
|
367
442
|
*
|
|
368
|
-
* @summary Assign or move a user ID.
|
|
369
443
|
* @param assignUserId - The assignUserId object.
|
|
370
|
-
* @param assignUserId.xAlgoliaUserID -
|
|
444
|
+
* @param assignUserId.xAlgoliaUserID - Unique identifier of the user who makes the search request.
|
|
371
445
|
* @param assignUserId.assignUserIdParams - The assignUserIdParams object.
|
|
372
446
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
373
447
|
*/
|
|
@@ -397,11 +471,10 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
397
471
|
return transporter.request(request, requestOptions);
|
|
398
472
|
},
|
|
399
473
|
/**
|
|
400
|
-
*
|
|
474
|
+
* 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.
|
|
401
475
|
*
|
|
402
|
-
* @summary Batch write operations on one index.
|
|
403
476
|
* @param batch - The batch object.
|
|
404
|
-
* @param batch.indexName -
|
|
477
|
+
* @param batch.indexName - Name of the index on which to perform the operation.
|
|
405
478
|
* @param batch.batchWriteParams - The batchWriteParams object.
|
|
406
479
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
407
480
|
*/
|
|
@@ -428,11 +501,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
428
501
|
return transporter.request(request, requestOptions);
|
|
429
502
|
},
|
|
430
503
|
/**
|
|
431
|
-
*
|
|
504
|
+
* Assigns multiple user IDs to a cluster. **You can\'t move users with this operation**.
|
|
505
|
+
*
|
|
506
|
+
* Required API Key ACLs:
|
|
507
|
+
* - admin.
|
|
432
508
|
*
|
|
433
|
-
* @summary Batch assign userIDs.
|
|
434
509
|
* @param batchAssignUserIds - The batchAssignUserIds object.
|
|
435
|
-
* @param batchAssignUserIds.xAlgoliaUserID -
|
|
510
|
+
* @param batchAssignUserIds.xAlgoliaUserID - Unique identifier of the user who makes the search request.
|
|
436
511
|
* @param batchAssignUserIds.batchAssignUserIdsParams - The batchAssignUserIdsParams object.
|
|
437
512
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
438
513
|
*/
|
|
@@ -465,11 +540,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
465
540
|
return transporter.request(request, requestOptions);
|
|
466
541
|
},
|
|
467
542
|
/**
|
|
468
|
-
*
|
|
543
|
+
* Adds or deletes multiple entries from your plurals, segmentation, or stop word dictionaries.
|
|
544
|
+
*
|
|
545
|
+
* Required API Key ACLs:
|
|
546
|
+
* - editSettings.
|
|
469
547
|
*
|
|
470
|
-
* @summary Batch dictionary entries.
|
|
471
548
|
* @param batchDictionaryEntries - The batchDictionaryEntries object.
|
|
472
|
-
* @param batchDictionaryEntries.dictionaryName - Dictionary to search
|
|
549
|
+
* @param batchDictionaryEntries.dictionaryName - Dictionary type in which to search.
|
|
473
550
|
* @param batchDictionaryEntries.batchDictionaryEntriesParams - The batchDictionaryEntriesParams object.
|
|
474
551
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
475
552
|
*/
|
|
@@ -496,11 +573,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
496
573
|
return transporter.request(request, requestOptions);
|
|
497
574
|
},
|
|
498
575
|
/**
|
|
499
|
-
*
|
|
576
|
+
* 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. - Deduplication (`distinct`) is turned off. - There\'s no ranking for: typo-tolerance, number of matched words, proximity, geo distance.
|
|
577
|
+
*
|
|
578
|
+
* Required API Key ACLs:
|
|
579
|
+
* - browse.
|
|
500
580
|
*
|
|
501
|
-
* @summary Get all records from an index.
|
|
502
581
|
* @param browse - The browse object.
|
|
503
|
-
* @param browse.indexName -
|
|
582
|
+
* @param browse.indexName - Name of the index on which to perform the operation.
|
|
504
583
|
* @param browse.browseParams - The browseParams object.
|
|
505
584
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
506
585
|
*/
|
|
@@ -521,11 +600,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
521
600
|
return transporter.request(request, requestOptions);
|
|
522
601
|
},
|
|
523
602
|
/**
|
|
524
|
-
*
|
|
603
|
+
* Deletes only the records from an index while keeping settings, synonyms, and rules.
|
|
604
|
+
*
|
|
605
|
+
* Required API Key ACLs:
|
|
606
|
+
* - deleteIndex.
|
|
525
607
|
*
|
|
526
|
-
* @summary Delete all records from an index.
|
|
527
608
|
* @param clearObjects - The clearObjects object.
|
|
528
|
-
* @param clearObjects.indexName -
|
|
609
|
+
* @param clearObjects.indexName - Name of the index on which to perform the operation.
|
|
529
610
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
530
611
|
*/
|
|
531
612
|
clearObjects({ indexName }, requestOptions) {
|
|
@@ -544,12 +625,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
544
625
|
return transporter.request(request, requestOptions);
|
|
545
626
|
},
|
|
546
627
|
/**
|
|
547
|
-
*
|
|
628
|
+
* Deletes all rules from the index.
|
|
629
|
+
*
|
|
630
|
+
* Required API Key ACLs:
|
|
631
|
+
* - editSettings.
|
|
548
632
|
*
|
|
549
|
-
* @summary Delete all rules.
|
|
550
633
|
* @param clearRules - The clearRules object.
|
|
551
|
-
* @param clearRules.indexName -
|
|
552
|
-
* @param clearRules.forwardToReplicas -
|
|
634
|
+
* @param clearRules.indexName - Name of the index on which to perform the operation.
|
|
635
|
+
* @param clearRules.forwardToReplicas - Whether changes are applied to replica indices.
|
|
553
636
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
554
637
|
*/
|
|
555
638
|
clearRules({ indexName, forwardToReplicas }, requestOptions) {
|
|
@@ -571,12 +654,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
571
654
|
return transporter.request(request, requestOptions);
|
|
572
655
|
},
|
|
573
656
|
/**
|
|
574
|
-
*
|
|
657
|
+
* Deletes all synonyms from the index.
|
|
658
|
+
*
|
|
659
|
+
* Required API Key ACLs:
|
|
660
|
+
* - editSettings.
|
|
575
661
|
*
|
|
576
|
-
* @summary Delete all synonyms.
|
|
577
662
|
* @param clearSynonyms - The clearSynonyms object.
|
|
578
|
-
* @param clearSynonyms.indexName -
|
|
579
|
-
* @param clearSynonyms.forwardToReplicas -
|
|
663
|
+
* @param clearSynonyms.indexName - Name of the index on which to perform the operation.
|
|
664
|
+
* @param clearSynonyms.forwardToReplicas - Whether changes are applied to replica indices.
|
|
580
665
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
581
666
|
*/
|
|
582
667
|
clearSynonyms({ indexName, forwardToReplicas }, requestOptions) {
|
|
@@ -600,7 +685,6 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
600
685
|
/**
|
|
601
686
|
* This method allow you to send requests to the Algolia REST API.
|
|
602
687
|
*
|
|
603
|
-
* @summary Send requests to the Algolia REST API.
|
|
604
688
|
* @param customDelete - The customDelete object.
|
|
605
689
|
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
606
690
|
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
@@ -610,7 +694,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
610
694
|
if (!path) {
|
|
611
695
|
throw new Error('Parameter `path` is required when calling `customDelete`.');
|
|
612
696
|
}
|
|
613
|
-
const requestPath = '/
|
|
697
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
614
698
|
const headers = {};
|
|
615
699
|
const queryParameters = parameters ? parameters : {};
|
|
616
700
|
const request = {
|
|
@@ -624,7 +708,6 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
624
708
|
/**
|
|
625
709
|
* This method allow you to send requests to the Algolia REST API.
|
|
626
710
|
*
|
|
627
|
-
* @summary Send requests to the Algolia REST API.
|
|
628
711
|
* @param customGet - The customGet object.
|
|
629
712
|
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
630
713
|
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
@@ -634,7 +717,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
634
717
|
if (!path) {
|
|
635
718
|
throw new Error('Parameter `path` is required when calling `customGet`.');
|
|
636
719
|
}
|
|
637
|
-
const requestPath = '/
|
|
720
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
638
721
|
const headers = {};
|
|
639
722
|
const queryParameters = parameters ? parameters : {};
|
|
640
723
|
const request = {
|
|
@@ -648,7 +731,6 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
648
731
|
/**
|
|
649
732
|
* This method allow you to send requests to the Algolia REST API.
|
|
650
733
|
*
|
|
651
|
-
* @summary Send requests to the Algolia REST API.
|
|
652
734
|
* @param customPost - The customPost object.
|
|
653
735
|
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
654
736
|
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
@@ -659,7 +741,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
659
741
|
if (!path) {
|
|
660
742
|
throw new Error('Parameter `path` is required when calling `customPost`.');
|
|
661
743
|
}
|
|
662
|
-
const requestPath = '/
|
|
744
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
663
745
|
const headers = {};
|
|
664
746
|
const queryParameters = parameters ? parameters : {};
|
|
665
747
|
const request = {
|
|
@@ -674,7 +756,6 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
674
756
|
/**
|
|
675
757
|
* This method allow you to send requests to the Algolia REST API.
|
|
676
758
|
*
|
|
677
|
-
* @summary Send requests to the Algolia REST API.
|
|
678
759
|
* @param customPut - The customPut object.
|
|
679
760
|
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
680
761
|
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
@@ -685,7 +766,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
685
766
|
if (!path) {
|
|
686
767
|
throw new Error('Parameter `path` is required when calling `customPut`.');
|
|
687
768
|
}
|
|
688
|
-
const requestPath = '/
|
|
769
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
689
770
|
const headers = {};
|
|
690
771
|
const queryParameters = parameters ? parameters : {};
|
|
691
772
|
const request = {
|
|
@@ -698,9 +779,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
698
779
|
return transporter.request(request, requestOptions);
|
|
699
780
|
},
|
|
700
781
|
/**
|
|
701
|
-
*
|
|
782
|
+
* Deletes the API key.
|
|
783
|
+
*
|
|
784
|
+
* Required API Key ACLs:
|
|
785
|
+
* - admin.
|
|
702
786
|
*
|
|
703
|
-
* @summary Delete API key.
|
|
704
787
|
* @param deleteApiKey - The deleteApiKey object.
|
|
705
788
|
* @param deleteApiKey.key - API key.
|
|
706
789
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -721,11 +804,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
721
804
|
return transporter.request(request, requestOptions);
|
|
722
805
|
},
|
|
723
806
|
/**
|
|
724
|
-
* This operation doesn\'t
|
|
807
|
+
* 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).
|
|
808
|
+
*
|
|
809
|
+
* Required API Key ACLs:
|
|
810
|
+
* - deleteIndex.
|
|
725
811
|
*
|
|
726
|
-
* @summary Delete all records matching a query.
|
|
727
812
|
* @param deleteBy - The deleteBy object.
|
|
728
|
-
* @param deleteBy.indexName -
|
|
813
|
+
* @param deleteBy.indexName - Name of the index on which to perform the operation.
|
|
729
814
|
* @param deleteBy.deleteByParams - The deleteByParams object.
|
|
730
815
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
731
816
|
*/
|
|
@@ -749,11 +834,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
749
834
|
return transporter.request(request, requestOptions);
|
|
750
835
|
},
|
|
751
836
|
/**
|
|
752
|
-
*
|
|
837
|
+
* 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/).
|
|
838
|
+
*
|
|
839
|
+
* Required API Key ACLs:
|
|
840
|
+
* - deleteIndex.
|
|
753
841
|
*
|
|
754
|
-
* @summary Delete index.
|
|
755
842
|
* @param deleteIndex - The deleteIndex object.
|
|
756
|
-
* @param deleteIndex.indexName -
|
|
843
|
+
* @param deleteIndex.indexName - Name of the index on which to perform the operation.
|
|
757
844
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
758
845
|
*/
|
|
759
846
|
deleteIndex({ indexName }, requestOptions) {
|
|
@@ -772,12 +859,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
772
859
|
return transporter.request(request, requestOptions);
|
|
773
860
|
},
|
|
774
861
|
/**
|
|
775
|
-
* To delete
|
|
862
|
+
* 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).
|
|
863
|
+
*
|
|
864
|
+
* Required API Key ACLs:
|
|
865
|
+
* - deleteObject.
|
|
776
866
|
*
|
|
777
|
-
* @summary Delete a record.
|
|
778
867
|
* @param deleteObject - The deleteObject object.
|
|
779
|
-
* @param deleteObject.indexName -
|
|
780
|
-
* @param deleteObject.objectID - Unique record
|
|
868
|
+
* @param deleteObject.indexName - Name of the index on which to perform the operation.
|
|
869
|
+
* @param deleteObject.objectID - Unique record identifier.
|
|
781
870
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
782
871
|
*/
|
|
783
872
|
deleteObject({ indexName, objectID }, requestOptions) {
|
|
@@ -801,13 +890,15 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
801
890
|
return transporter.request(request, requestOptions);
|
|
802
891
|
},
|
|
803
892
|
/**
|
|
804
|
-
*
|
|
893
|
+
* Deletes a rule by its ID. To find the object ID for rules, use the [`search` operation](#tag/Rules/operation/searchRules).
|
|
894
|
+
*
|
|
895
|
+
* Required API Key ACLs:
|
|
896
|
+
* - editSettings.
|
|
805
897
|
*
|
|
806
|
-
* @summary Delete a rule.
|
|
807
898
|
* @param deleteRule - The deleteRule object.
|
|
808
|
-
* @param deleteRule.indexName -
|
|
899
|
+
* @param deleteRule.indexName - Name of the index on which to perform the operation.
|
|
809
900
|
* @param deleteRule.objectID - Unique identifier of a rule object.
|
|
810
|
-
* @param deleteRule.forwardToReplicas -
|
|
901
|
+
* @param deleteRule.forwardToReplicas - Whether changes are applied to replica indices.
|
|
811
902
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
812
903
|
*/
|
|
813
904
|
deleteRule({ indexName, objectID, forwardToReplicas }, requestOptions) {
|
|
@@ -834,9 +925,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
834
925
|
return transporter.request(request, requestOptions);
|
|
835
926
|
},
|
|
836
927
|
/**
|
|
837
|
-
*
|
|
928
|
+
* Deletes a source from the list of allowed sources.
|
|
929
|
+
*
|
|
930
|
+
* Required API Key ACLs:
|
|
931
|
+
* - admin.
|
|
838
932
|
*
|
|
839
|
-
* @summary Remove a source.
|
|
840
933
|
* @param deleteSource - The deleteSource object.
|
|
841
934
|
* @param deleteSource.source - IP address range of the source.
|
|
842
935
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -857,13 +950,15 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
857
950
|
return transporter.request(request, requestOptions);
|
|
858
951
|
},
|
|
859
952
|
/**
|
|
860
|
-
*
|
|
953
|
+
* Deletes a synonym by its ID. To find the object IDs of your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).
|
|
954
|
+
*
|
|
955
|
+
* Required API Key ACLs:
|
|
956
|
+
* - editSettings.
|
|
861
957
|
*
|
|
862
|
-
* @summary Delete a synonym.
|
|
863
958
|
* @param deleteSynonym - The deleteSynonym object.
|
|
864
|
-
* @param deleteSynonym.indexName -
|
|
959
|
+
* @param deleteSynonym.indexName - Name of the index on which to perform the operation.
|
|
865
960
|
* @param deleteSynonym.objectID - Unique identifier of a synonym object.
|
|
866
|
-
* @param deleteSynonym.forwardToReplicas -
|
|
961
|
+
* @param deleteSynonym.forwardToReplicas - Whether changes are applied to replica indices.
|
|
867
962
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
868
963
|
*/
|
|
869
964
|
deleteSynonym({ indexName, objectID, forwardToReplicas }, requestOptions) {
|
|
@@ -890,9 +985,8 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
890
985
|
return transporter.request(request, requestOptions);
|
|
891
986
|
},
|
|
892
987
|
/**
|
|
893
|
-
*
|
|
988
|
+
* 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.
|
|
894
989
|
*
|
|
895
|
-
* @summary Get API key permissions.
|
|
896
990
|
* @param getApiKey - The getApiKey object.
|
|
897
991
|
* @param getApiKey.key - API key.
|
|
898
992
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -913,9 +1007,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
913
1007
|
return transporter.request(request, requestOptions);
|
|
914
1008
|
},
|
|
915
1009
|
/**
|
|
916
|
-
* Lists
|
|
1010
|
+
* Lists supported languages with their supported dictionary types and number of custom entries.
|
|
1011
|
+
*
|
|
1012
|
+
* Required API Key ACLs:
|
|
1013
|
+
* - settings.
|
|
917
1014
|
*
|
|
918
|
-
* @summary List available languages.
|
|
919
1015
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
920
1016
|
*/
|
|
921
1017
|
getDictionaryLanguages(requestOptions) {
|
|
@@ -931,9 +1027,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
931
1027
|
return transporter.request(request, requestOptions);
|
|
932
1028
|
},
|
|
933
1029
|
/**
|
|
934
|
-
*
|
|
1030
|
+
* Retrieves the languages for which standard dictionary entries are turned off.
|
|
1031
|
+
*
|
|
1032
|
+
* Required API Key ACLs:
|
|
1033
|
+
* - settings.
|
|
935
1034
|
*
|
|
936
|
-
* @summary Get stop word settings.
|
|
937
1035
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
938
1036
|
*/
|
|
939
1037
|
getDictionarySettings(requestOptions) {
|
|
@@ -949,14 +1047,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
949
1047
|
return transporter.request(request, requestOptions);
|
|
950
1048
|
},
|
|
951
1049
|
/**
|
|
952
|
-
* 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.
|
|
1050
|
+
* 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.
|
|
1051
|
+
*
|
|
1052
|
+
* Required API Key ACLs:
|
|
1053
|
+
* - logs.
|
|
953
1054
|
*
|
|
954
|
-
* @summary Return the latest log entries.
|
|
955
1055
|
* @param getLogs - The getLogs object.
|
|
956
|
-
* @param getLogs.offset - First log entry to retrieve.
|
|
1056
|
+
* @param getLogs.offset - First log entry to retrieve. The most recent entries are listed first.
|
|
957
1057
|
* @param getLogs.length - Maximum number of entries to retrieve.
|
|
958
|
-
* @param getLogs.indexName - Index for which log entries
|
|
959
|
-
* @param getLogs.type - Type of log entries to retrieve.
|
|
1058
|
+
* @param getLogs.indexName - Index for which to retrieve log entries. By default, log entries are retrieved for all indices.
|
|
1059
|
+
* @param getLogs.type - Type of log entries to retrieve. By default, all log entries are retrieved.
|
|
960
1060
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
961
1061
|
*/
|
|
962
1062
|
getLogs({ offset, length, indexName, type } = {}, requestOptions = undefined) {
|
|
@@ -984,13 +1084,15 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
984
1084
|
return transporter.request(request, requestOptions);
|
|
985
1085
|
},
|
|
986
1086
|
/**
|
|
987
|
-
* To
|
|
1087
|
+
* Retrieves one record by its object ID. To retrieve more than one record, use the [`objects` operation](#tag/Records/operation/getObjects).
|
|
1088
|
+
*
|
|
1089
|
+
* Required API Key ACLs:
|
|
1090
|
+
* - search.
|
|
988
1091
|
*
|
|
989
|
-
* @summary Get a record.
|
|
990
1092
|
* @param getObject - The getObject object.
|
|
991
|
-
* @param getObject.indexName -
|
|
992
|
-
* @param getObject.objectID - Unique record
|
|
993
|
-
* @param getObject.attributesToRetrieve - Attributes to include with the records in the response. This is useful to reduce the size of the API response. By default, all retrievable attributes are returned.
|
|
1093
|
+
* @param getObject.indexName - Name of the index on which to perform the operation.
|
|
1094
|
+
* @param getObject.objectID - Unique record identifier.
|
|
1095
|
+
* @param getObject.attributesToRetrieve - Attributes to include with the records in the response. This is useful to reduce the size of the API response. By default, all retrievable attributes are returned. `objectID` is always retrieved. Attributes included in `unretrievableAttributes` won\'t be retrieved unless the request is authenticated with the admin API key.
|
|
994
1096
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
995
1097
|
*/
|
|
996
1098
|
getObject({ indexName, objectID, attributesToRetrieve }, requestOptions) {
|
|
@@ -1017,9 +1119,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1017
1119
|
return transporter.request(request, requestOptions);
|
|
1018
1120
|
},
|
|
1019
1121
|
/**
|
|
1020
|
-
*
|
|
1122
|
+
* Retrieves one or more records, potentially from different indices. Records are returned in the same order as the requests.
|
|
1123
|
+
*
|
|
1124
|
+
* Required API Key ACLs:
|
|
1125
|
+
* - search.
|
|
1021
1126
|
*
|
|
1022
|
-
* @summary Get multiple records.
|
|
1023
1127
|
* @param getObjectsParams - Request object.
|
|
1024
1128
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1025
1129
|
*/
|
|
@@ -1045,11 +1149,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1045
1149
|
return transporter.request(request, requestOptions);
|
|
1046
1150
|
},
|
|
1047
1151
|
/**
|
|
1048
|
-
*
|
|
1152
|
+
* Retrieves a rule by its ID. To find the object ID of rules, use the [`search` operation](#tag/Rules/operation/searchRules).
|
|
1153
|
+
*
|
|
1154
|
+
* Required API Key ACLs:
|
|
1155
|
+
* - settings.
|
|
1049
1156
|
*
|
|
1050
|
-
* @summary Get a rule.
|
|
1051
1157
|
* @param getRule - The getRule object.
|
|
1052
|
-
* @param getRule.indexName -
|
|
1158
|
+
* @param getRule.indexName - Name of the index on which to perform the operation.
|
|
1053
1159
|
* @param getRule.objectID - Unique identifier of a rule object.
|
|
1054
1160
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1055
1161
|
*/
|
|
@@ -1074,11 +1180,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1074
1180
|
return transporter.request(request, requestOptions);
|
|
1075
1181
|
},
|
|
1076
1182
|
/**
|
|
1077
|
-
*
|
|
1183
|
+
* Retrieves an object with non-null index settings.
|
|
1184
|
+
*
|
|
1185
|
+
* Required API Key ACLs:
|
|
1186
|
+
* - search.
|
|
1078
1187
|
*
|
|
1079
|
-
* @summary Get index settings.
|
|
1080
1188
|
* @param getSettings - The getSettings object.
|
|
1081
|
-
* @param getSettings.indexName -
|
|
1189
|
+
* @param getSettings.indexName - Name of the index on which to perform the operation.
|
|
1082
1190
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1083
1191
|
*/
|
|
1084
1192
|
getSettings({ indexName }, requestOptions) {
|
|
@@ -1097,9 +1205,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1097
1205
|
return transporter.request(request, requestOptions);
|
|
1098
1206
|
},
|
|
1099
1207
|
/**
|
|
1100
|
-
*
|
|
1208
|
+
* Retrieves all allowed IP addresses with access to your application.
|
|
1209
|
+
*
|
|
1210
|
+
* Required API Key ACLs:
|
|
1211
|
+
* - admin.
|
|
1101
1212
|
*
|
|
1102
|
-
* @summary Get all allowed IP addresses.
|
|
1103
1213
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1104
1214
|
*/
|
|
1105
1215
|
getSources(requestOptions) {
|
|
@@ -1115,11 +1225,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1115
1225
|
return transporter.request(request, requestOptions);
|
|
1116
1226
|
},
|
|
1117
1227
|
/**
|
|
1118
|
-
*
|
|
1228
|
+
* Retrieves a syonym by its ID. To find the object IDs for your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).
|
|
1229
|
+
*
|
|
1230
|
+
* Required API Key ACLs:
|
|
1231
|
+
* - settings.
|
|
1119
1232
|
*
|
|
1120
|
-
* @summary Get a synonym object.
|
|
1121
1233
|
* @param getSynonym - The getSynonym object.
|
|
1122
|
-
* @param getSynonym.indexName -
|
|
1234
|
+
* @param getSynonym.indexName - Name of the index on which to perform the operation.
|
|
1123
1235
|
* @param getSynonym.objectID - Unique identifier of a synonym object.
|
|
1124
1236
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1125
1237
|
*/
|
|
@@ -1144,11 +1256,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1144
1256
|
return transporter.request(request, requestOptions);
|
|
1145
1257
|
},
|
|
1146
1258
|
/**
|
|
1147
|
-
*
|
|
1259
|
+
* 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.
|
|
1260
|
+
*
|
|
1261
|
+
* Required API Key ACLs:
|
|
1262
|
+
* - addObject.
|
|
1148
1263
|
*
|
|
1149
|
-
* @summary Check a task\'s status.
|
|
1150
1264
|
* @param getTask - The getTask object.
|
|
1151
|
-
* @param getTask.indexName -
|
|
1265
|
+
* @param getTask.indexName - Name of the index on which to perform the operation.
|
|
1152
1266
|
* @param getTask.taskID - Unique task identifier.
|
|
1153
1267
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1154
1268
|
*/
|
|
@@ -1173,9 +1287,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1173
1287
|
return transporter.request(request, requestOptions);
|
|
1174
1288
|
},
|
|
1175
1289
|
/**
|
|
1176
|
-
* Get the IDs of the 10 users with the highest number of records per cluster.
|
|
1290
|
+
* 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.
|
|
1291
|
+
*
|
|
1292
|
+
* Required API Key ACLs:
|
|
1293
|
+
* - admin.
|
|
1177
1294
|
*
|
|
1178
|
-
* @summary Get top userID.
|
|
1179
1295
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1180
1296
|
*/
|
|
1181
1297
|
getTopUserIds(requestOptions) {
|
|
@@ -1191,11 +1307,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1191
1307
|
return transporter.request(request, requestOptions);
|
|
1192
1308
|
},
|
|
1193
1309
|
/**
|
|
1194
|
-
* Returns the
|
|
1310
|
+
* 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.
|
|
1311
|
+
*
|
|
1312
|
+
* Required API Key ACLs:
|
|
1313
|
+
* - admin.
|
|
1195
1314
|
*
|
|
1196
|
-
* @summary Get userID.
|
|
1197
1315
|
* @param getUserId - The getUserId object.
|
|
1198
|
-
* @param getUserId.userID -
|
|
1316
|
+
* @param getUserId.userID - Unique identifier of the user who makes the search request.
|
|
1199
1317
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1200
1318
|
*/
|
|
1201
1319
|
getUserId({ userID }, requestOptions) {
|
|
@@ -1216,9 +1334,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1216
1334
|
/**
|
|
1217
1335
|
* 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.
|
|
1218
1336
|
*
|
|
1219
|
-
*
|
|
1337
|
+
* Required API Key ACLs:
|
|
1338
|
+
* - admin.
|
|
1339
|
+
*
|
|
1220
1340
|
* @param hasPendingMappings - The hasPendingMappings object.
|
|
1221
|
-
* @param hasPendingMappings.getClusters -
|
|
1341
|
+
* @param hasPendingMappings.getClusters - Whether to include the cluster\'s pending mapping state in the response.
|
|
1222
1342
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1223
1343
|
*/
|
|
1224
1344
|
hasPendingMappings({ getClusters } = {}, requestOptions = undefined) {
|
|
@@ -1237,9 +1357,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1237
1357
|
return transporter.request(request, requestOptions);
|
|
1238
1358
|
},
|
|
1239
1359
|
/**
|
|
1240
|
-
*
|
|
1360
|
+
* Lists all API keys associated with your Algolia application, including their permissions and restrictions.
|
|
1361
|
+
*
|
|
1362
|
+
* Required API Key ACLs:
|
|
1363
|
+
* - admin.
|
|
1241
1364
|
*
|
|
1242
|
-
* @summary List API keys.
|
|
1243
1365
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1244
1366
|
*/
|
|
1245
1367
|
listApiKeys(requestOptions) {
|
|
@@ -1255,9 +1377,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1255
1377
|
return transporter.request(request, requestOptions);
|
|
1256
1378
|
},
|
|
1257
1379
|
/**
|
|
1258
|
-
*
|
|
1380
|
+
* Lists the available clusters in a multi-cluster setup.
|
|
1381
|
+
*
|
|
1382
|
+
* Required API Key ACLs:
|
|
1383
|
+
* - admin.
|
|
1259
1384
|
*
|
|
1260
|
-
* @summary List clusters.
|
|
1261
1385
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1262
1386
|
*/
|
|
1263
1387
|
listClusters(requestOptions) {
|
|
@@ -1273,12 +1397,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1273
1397
|
return transporter.request(request, requestOptions);
|
|
1274
1398
|
},
|
|
1275
1399
|
/**
|
|
1276
|
-
*
|
|
1400
|
+
* Lists all indices in the current Algolia application. The request follows any index restrictions of the API key you use to make the request.
|
|
1401
|
+
*
|
|
1402
|
+
* Required API Key ACLs:
|
|
1403
|
+
* - listIndexes.
|
|
1277
1404
|
*
|
|
1278
|
-
* @summary List indices.
|
|
1279
1405
|
* @param listIndices - The listIndices object.
|
|
1280
|
-
* @param listIndices.page -
|
|
1281
|
-
* @param listIndices.hitsPerPage -
|
|
1406
|
+
* @param listIndices.page - Requested page of the API response. If `null`, the API response is not paginated.
|
|
1407
|
+
* @param listIndices.hitsPerPage - Number of hits per page.
|
|
1282
1408
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1283
1409
|
*/
|
|
1284
1410
|
listIndices({ page, hitsPerPage } = {}, requestOptions = undefined) {
|
|
@@ -1300,12 +1426,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1300
1426
|
return transporter.request(request, requestOptions);
|
|
1301
1427
|
},
|
|
1302
1428
|
/**
|
|
1303
|
-
*
|
|
1429
|
+
* 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.
|
|
1430
|
+
*
|
|
1431
|
+
* Required API Key ACLs:
|
|
1432
|
+
* - admin.
|
|
1304
1433
|
*
|
|
1305
|
-
* @summary List userIDs.
|
|
1306
1434
|
* @param listUserIds - The listUserIds object.
|
|
1307
|
-
* @param listUserIds.page -
|
|
1308
|
-
* @param listUserIds.hitsPerPage -
|
|
1435
|
+
* @param listUserIds.page - Requested page of the API response. If `null`, the API response is not paginated.
|
|
1436
|
+
* @param listUserIds.hitsPerPage - Number of hits per page.
|
|
1309
1437
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1310
1438
|
*/
|
|
1311
1439
|
listUserIds({ page, hitsPerPage } = {}, requestOptions = undefined) {
|
|
@@ -1327,9 +1455,8 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1327
1455
|
return transporter.request(request, requestOptions);
|
|
1328
1456
|
},
|
|
1329
1457
|
/**
|
|
1330
|
-
*
|
|
1458
|
+
* 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.
|
|
1331
1459
|
*
|
|
1332
|
-
* @summary Batch write operations on multiple indices.
|
|
1333
1460
|
* @param batchParams - The batchParams object.
|
|
1334
1461
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1335
1462
|
*/
|
|
@@ -1353,11 +1480,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1353
1480
|
return transporter.request(request, requestOptions);
|
|
1354
1481
|
},
|
|
1355
1482
|
/**
|
|
1356
|
-
*
|
|
1483
|
+
* Copies or moves (renames) an index within the same Algolia application. - Existing destination indices are overwritten, except for index-specific API keys and 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/).
|
|
1484
|
+
*
|
|
1485
|
+
* Required API Key ACLs:
|
|
1486
|
+
* - addObject.
|
|
1357
1487
|
*
|
|
1358
|
-
* @summary Copy, move, or rename an index.
|
|
1359
1488
|
* @param operationIndex - The operationIndex object.
|
|
1360
|
-
* @param operationIndex.indexName -
|
|
1489
|
+
* @param operationIndex.indexName - Name of the index on which to perform the operation.
|
|
1361
1490
|
* @param operationIndex.operationIndexParams - The operationIndexParams object.
|
|
1362
1491
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1363
1492
|
*/
|
|
@@ -1387,14 +1516,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1387
1516
|
return transporter.request(request, requestOptions);
|
|
1388
1517
|
},
|
|
1389
1518
|
/**
|
|
1390
|
-
*
|
|
1519
|
+
* 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.
|
|
1520
|
+
*
|
|
1521
|
+
* Required API Key ACLs:
|
|
1522
|
+
* - addObject.
|
|
1391
1523
|
*
|
|
1392
|
-
* @summary Update record attributes.
|
|
1393
1524
|
* @param partialUpdateObject - The partialUpdateObject object.
|
|
1394
|
-
* @param partialUpdateObject.indexName -
|
|
1395
|
-
* @param partialUpdateObject.objectID - Unique record
|
|
1396
|
-
* @param partialUpdateObject.attributesToUpdate -
|
|
1397
|
-
* @param partialUpdateObject.createIfNotExists -
|
|
1525
|
+
* @param partialUpdateObject.indexName - Name of the index on which to perform the operation.
|
|
1526
|
+
* @param partialUpdateObject.objectID - Unique record identifier.
|
|
1527
|
+
* @param partialUpdateObject.attributesToUpdate - Attributes with their values.
|
|
1528
|
+
* @param partialUpdateObject.createIfNotExists - Whether to create a new record if it doesn\'t exist.
|
|
1398
1529
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1399
1530
|
*/
|
|
1400
1531
|
partialUpdateObject({ indexName, objectID, attributesToUpdate, createIfNotExists, }, requestOptions) {
|
|
@@ -1425,11 +1556,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1425
1556
|
return transporter.request(request, requestOptions);
|
|
1426
1557
|
},
|
|
1427
1558
|
/**
|
|
1428
|
-
*
|
|
1559
|
+
* Deletes a user ID and its associated data from the clusters.
|
|
1560
|
+
*
|
|
1561
|
+
* Required API Key ACLs:
|
|
1562
|
+
* - admin.
|
|
1429
1563
|
*
|
|
1430
|
-
* @summary Remove userID.
|
|
1431
1564
|
* @param removeUserId - The removeUserId object.
|
|
1432
|
-
* @param removeUserId.userID -
|
|
1565
|
+
* @param removeUserId.userID - Unique identifier of the user who makes the search request.
|
|
1433
1566
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1434
1567
|
*/
|
|
1435
1568
|
removeUserId({ userID }, requestOptions) {
|
|
@@ -1448,9 +1581,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1448
1581
|
return transporter.request(request, requestOptions);
|
|
1449
1582
|
},
|
|
1450
1583
|
/**
|
|
1451
|
-
*
|
|
1584
|
+
* Replaces the list of allowed sources.
|
|
1585
|
+
*
|
|
1586
|
+
* Required API Key ACLs:
|
|
1587
|
+
* - admin.
|
|
1452
1588
|
*
|
|
1453
|
-
* @summary Replace all sources.
|
|
1454
1589
|
* @param replaceSources - The replaceSources object.
|
|
1455
1590
|
* @param replaceSources.source - Allowed sources.
|
|
1456
1591
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -1472,9 +1607,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1472
1607
|
return transporter.request(request, requestOptions);
|
|
1473
1608
|
},
|
|
1474
1609
|
/**
|
|
1475
|
-
*
|
|
1610
|
+
* 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.
|
|
1611
|
+
*
|
|
1612
|
+
* Required API Key ACLs:
|
|
1613
|
+
* - admin.
|
|
1476
1614
|
*
|
|
1477
|
-
* @summary Restore API key.
|
|
1478
1615
|
* @param restoreApiKey - The restoreApiKey object.
|
|
1479
1616
|
* @param restoreApiKey.key - API key.
|
|
1480
1617
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -1495,12 +1632,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1495
1632
|
return transporter.request(request, requestOptions);
|
|
1496
1633
|
},
|
|
1497
1634
|
/**
|
|
1498
|
-
*
|
|
1635
|
+
* 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/partial). To add, update, or replace multiple records, use the [`batch` operation](#tag/Records/operation/batch).
|
|
1636
|
+
*
|
|
1637
|
+
* Required API Key ACLs:
|
|
1638
|
+
* - addObject.
|
|
1499
1639
|
*
|
|
1500
|
-
* @summary Add or update a record.
|
|
1501
1640
|
* @param saveObject - The saveObject object.
|
|
1502
|
-
* @param saveObject.indexName -
|
|
1503
|
-
* @param saveObject.body - The
|
|
1641
|
+
* @param saveObject.indexName - Name of the index on which to perform the operation.
|
|
1642
|
+
* @param saveObject.body - The record, a schemaless object with attributes that are useful in the context of search and discovery.
|
|
1504
1643
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1505
1644
|
*/
|
|
1506
1645
|
saveObject({ indexName, body }, requestOptions) {
|
|
@@ -1523,14 +1662,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1523
1662
|
return transporter.request(request, requestOptions);
|
|
1524
1663
|
},
|
|
1525
1664
|
/**
|
|
1526
|
-
* To create or update more than one rule, use the [`batch` operation](#tag/Rules/operation/saveRules).
|
|
1665
|
+
* 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).
|
|
1666
|
+
*
|
|
1667
|
+
* Required API Key ACLs:
|
|
1668
|
+
* - editSettings.
|
|
1527
1669
|
*
|
|
1528
|
-
* @summary Create or update a rule.
|
|
1529
1670
|
* @param saveRule - The saveRule object.
|
|
1530
|
-
* @param saveRule.indexName -
|
|
1671
|
+
* @param saveRule.indexName - Name of the index on which to perform the operation.
|
|
1531
1672
|
* @param saveRule.objectID - Unique identifier of a rule object.
|
|
1532
1673
|
* @param saveRule.rule - The rule object.
|
|
1533
|
-
* @param saveRule.forwardToReplicas -
|
|
1674
|
+
* @param saveRule.forwardToReplicas - Whether changes are applied to replica indices.
|
|
1534
1675
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1535
1676
|
*/
|
|
1536
1677
|
saveRule({ indexName, objectID, rule, forwardToReplicas }, requestOptions) {
|
|
@@ -1564,14 +1705,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1564
1705
|
return transporter.request(request, requestOptions);
|
|
1565
1706
|
},
|
|
1566
1707
|
/**
|
|
1567
|
-
* Create or update multiple rules.
|
|
1708
|
+
* 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.
|
|
1709
|
+
*
|
|
1710
|
+
* Required API Key ACLs:
|
|
1711
|
+
* - editSettings.
|
|
1568
1712
|
*
|
|
1569
|
-
* @summary Save a batch of rules.
|
|
1570
1713
|
* @param saveRules - The saveRules object.
|
|
1571
|
-
* @param saveRules.indexName -
|
|
1714
|
+
* @param saveRules.indexName - Name of the index on which to perform the operation.
|
|
1572
1715
|
* @param saveRules.rules - The rules object.
|
|
1573
|
-
* @param saveRules.forwardToReplicas -
|
|
1574
|
-
* @param saveRules.clearExistingRules -
|
|
1716
|
+
* @param saveRules.forwardToReplicas - Whether changes are applied to replica indices.
|
|
1717
|
+
* @param saveRules.clearExistingRules - Whether existing rules should be deleted before adding this batch.
|
|
1575
1718
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1576
1719
|
*/
|
|
1577
1720
|
saveRules({ indexName, rules, forwardToReplicas, clearExistingRules, }, requestOptions) {
|
|
@@ -1600,14 +1743,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1600
1743
|
return transporter.request(request, requestOptions);
|
|
1601
1744
|
},
|
|
1602
1745
|
/**
|
|
1603
|
-
*
|
|
1746
|
+
* 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).
|
|
1747
|
+
*
|
|
1748
|
+
* Required API Key ACLs:
|
|
1749
|
+
* - editSettings.
|
|
1604
1750
|
*
|
|
1605
|
-
* @summary Save a synonym.
|
|
1606
1751
|
* @param saveSynonym - The saveSynonym object.
|
|
1607
|
-
* @param saveSynonym.indexName -
|
|
1752
|
+
* @param saveSynonym.indexName - Name of the index on which to perform the operation.
|
|
1608
1753
|
* @param saveSynonym.objectID - Unique identifier of a synonym object.
|
|
1609
1754
|
* @param saveSynonym.synonymHit - The synonymHit object.
|
|
1610
|
-
* @param saveSynonym.forwardToReplicas -
|
|
1755
|
+
* @param saveSynonym.forwardToReplicas - Whether changes are applied to replica indices.
|
|
1611
1756
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1612
1757
|
*/
|
|
1613
1758
|
saveSynonym({ indexName, objectID, synonymHit, forwardToReplicas }, requestOptions) {
|
|
@@ -1644,14 +1789,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1644
1789
|
return transporter.request(request, requestOptions);
|
|
1645
1790
|
},
|
|
1646
1791
|
/**
|
|
1647
|
-
*
|
|
1792
|
+
* If a synonym with the `objectID` doesn\'t exist, Algolia adds a new one. Otherwise, existing synonyms are replaced.
|
|
1793
|
+
*
|
|
1794
|
+
* Required API Key ACLs:
|
|
1795
|
+
* - editSettings.
|
|
1648
1796
|
*
|
|
1649
|
-
* @summary Save a batch of synonyms.
|
|
1650
1797
|
* @param saveSynonyms - The saveSynonyms object.
|
|
1651
|
-
* @param saveSynonyms.indexName -
|
|
1798
|
+
* @param saveSynonyms.indexName - Name of the index on which to perform the operation.
|
|
1652
1799
|
* @param saveSynonyms.synonymHit - The synonymHit object.
|
|
1653
|
-
* @param saveSynonyms.forwardToReplicas -
|
|
1654
|
-
* @param saveSynonyms.replaceExistingSynonyms -
|
|
1800
|
+
* @param saveSynonyms.forwardToReplicas - Whether changes are applied to replica indices.
|
|
1801
|
+
* @param saveSynonyms.replaceExistingSynonyms - Whether to replace all synonyms in the index with the ones sent with this request.
|
|
1655
1802
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1656
1803
|
*/
|
|
1657
1804
|
saveSynonyms({ indexName, synonymHit, forwardToReplicas, replaceExistingSynonyms, }, requestOptions) {
|
|
@@ -1681,10 +1828,12 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1681
1828
|
return transporter.request(request, requestOptions);
|
|
1682
1829
|
},
|
|
1683
1830
|
/**
|
|
1684
|
-
*
|
|
1831
|
+
* 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.
|
|
1685
1832
|
*
|
|
1686
|
-
*
|
|
1687
|
-
*
|
|
1833
|
+
* Required API Key ACLs:
|
|
1834
|
+
* - search.
|
|
1835
|
+
*
|
|
1836
|
+
* @param searchMethodParams - Muli-search request body. Results are returned in the same order as the requests.
|
|
1688
1837
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1689
1838
|
*/
|
|
1690
1839
|
search(searchMethodParams, requestOptions) {
|
|
@@ -1731,11 +1880,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1731
1880
|
return transporter.request(request, requestOptions);
|
|
1732
1881
|
},
|
|
1733
1882
|
/**
|
|
1734
|
-
*
|
|
1883
|
+
* Searches for standard and custom dictionary entries.
|
|
1884
|
+
*
|
|
1885
|
+
* Required API Key ACLs:
|
|
1886
|
+
* - settings.
|
|
1735
1887
|
*
|
|
1736
|
-
* @summary Search dictionary entries.
|
|
1737
1888
|
* @param searchDictionaryEntries - The searchDictionaryEntries object.
|
|
1738
|
-
* @param searchDictionaryEntries.dictionaryName - Dictionary to search
|
|
1889
|
+
* @param searchDictionaryEntries.dictionaryName - Dictionary type in which to search.
|
|
1739
1890
|
* @param searchDictionaryEntries.searchDictionaryEntriesParams - The searchDictionaryEntriesParams object.
|
|
1740
1891
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1741
1892
|
*/
|
|
@@ -1764,12 +1915,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1764
1915
|
return transporter.request(request, requestOptions);
|
|
1765
1916
|
},
|
|
1766
1917
|
/**
|
|
1767
|
-
*
|
|
1918
|
+
* 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**.
|
|
1919
|
+
*
|
|
1920
|
+
* Required API Key ACLs:
|
|
1921
|
+
* - search.
|
|
1768
1922
|
*
|
|
1769
|
-
* @summary Search for facet values.
|
|
1770
1923
|
* @param searchForFacetValues - The searchForFacetValues object.
|
|
1771
|
-
* @param searchForFacetValues.indexName -
|
|
1772
|
-
* @param searchForFacetValues.facetName - Facet
|
|
1924
|
+
* @param searchForFacetValues.indexName - Name of the index on which to perform the operation.
|
|
1925
|
+
* @param searchForFacetValues.facetName - Facet attribute in which to search for values. This attribute must be included in the `attributesForFaceting` index setting with the `searchable()` modifier.
|
|
1773
1926
|
* @param searchForFacetValues.searchForFacetValuesRequest - The searchForFacetValuesRequest object.
|
|
1774
1927
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1775
1928
|
*/
|
|
@@ -1797,11 +1950,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1797
1950
|
return transporter.request(request, requestOptions);
|
|
1798
1951
|
},
|
|
1799
1952
|
/**
|
|
1800
|
-
*
|
|
1953
|
+
* Searches for rules in your index.
|
|
1954
|
+
*
|
|
1955
|
+
* Required API Key ACLs:
|
|
1956
|
+
* - settings.
|
|
1801
1957
|
*
|
|
1802
|
-
* @summary Search for rules.
|
|
1803
1958
|
* @param searchRules - The searchRules object.
|
|
1804
|
-
* @param searchRules.indexName -
|
|
1959
|
+
* @param searchRules.indexName - Name of the index on which to perform the operation.
|
|
1805
1960
|
* @param searchRules.searchRulesParams - The searchRulesParams object.
|
|
1806
1961
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1807
1962
|
*/
|
|
@@ -1824,11 +1979,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1824
1979
|
return transporter.request(request, requestOptions);
|
|
1825
1980
|
},
|
|
1826
1981
|
/**
|
|
1827
|
-
*
|
|
1982
|
+
* 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.
|
|
1983
|
+
*
|
|
1984
|
+
* Required API Key ACLs:
|
|
1985
|
+
* - search.
|
|
1828
1986
|
*
|
|
1829
|
-
* @summary Search an index.
|
|
1830
1987
|
* @param searchSingleIndex - The searchSingleIndex object.
|
|
1831
|
-
* @param searchSingleIndex.indexName -
|
|
1988
|
+
* @param searchSingleIndex.indexName - Name of the index on which to perform the operation.
|
|
1832
1989
|
* @param searchSingleIndex.searchParams - The searchParams object.
|
|
1833
1990
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1834
1991
|
*/
|
|
@@ -1851,11 +2008,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1851
2008
|
return transporter.request(request, requestOptions);
|
|
1852
2009
|
},
|
|
1853
2010
|
/**
|
|
1854
|
-
*
|
|
2011
|
+
* Searches for synonyms in your index.
|
|
2012
|
+
*
|
|
2013
|
+
* Required API Key ACLs:
|
|
2014
|
+
* - settings.
|
|
1855
2015
|
*
|
|
1856
|
-
* @summary Search for synonyms.
|
|
1857
2016
|
* @param searchSynonyms - The searchSynonyms object.
|
|
1858
|
-
* @param searchSynonyms.indexName -
|
|
2017
|
+
* @param searchSynonyms.indexName - Name of the index on which to perform the operation.
|
|
1859
2018
|
* @param searchSynonyms.searchSynonymsParams - Body of the `searchSynonyms` operation.
|
|
1860
2019
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1861
2020
|
*/
|
|
@@ -1878,9 +2037,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1878
2037
|
return transporter.request(request, requestOptions);
|
|
1879
2038
|
},
|
|
1880
2039
|
/**
|
|
1881
|
-
* Since it can take
|
|
2040
|
+
* 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).
|
|
2041
|
+
*
|
|
2042
|
+
* Required API Key ACLs:
|
|
2043
|
+
* - admin.
|
|
1882
2044
|
*
|
|
1883
|
-
* @summary Search for a user ID.
|
|
1884
2045
|
* @param searchUserIdsParams - The searchUserIdsParams object.
|
|
1885
2046
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1886
2047
|
*/
|
|
@@ -1906,9 +2067,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1906
2067
|
return transporter.request(request, requestOptions);
|
|
1907
2068
|
},
|
|
1908
2069
|
/**
|
|
1909
|
-
*
|
|
2070
|
+
* Turns standard stop word dictionary entries on or off for a given language.
|
|
2071
|
+
*
|
|
2072
|
+
* Required API Key ACLs:
|
|
2073
|
+
* - editSettings.
|
|
1910
2074
|
*
|
|
1911
|
-
* @summary Set stop word settings.
|
|
1912
2075
|
* @param dictionarySettingsParams - The dictionarySettingsParams object.
|
|
1913
2076
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1914
2077
|
*/
|
|
@@ -1932,13 +2095,15 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1932
2095
|
return transporter.request(request, requestOptions);
|
|
1933
2096
|
},
|
|
1934
2097
|
/**
|
|
1935
|
-
* Update the specified
|
|
2098
|
+
* 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.
|
|
2099
|
+
*
|
|
2100
|
+
* Required API Key ACLs:
|
|
2101
|
+
* - editSettings.
|
|
1936
2102
|
*
|
|
1937
|
-
* @summary Update index settings.
|
|
1938
2103
|
* @param setSettings - The setSettings object.
|
|
1939
|
-
* @param setSettings.indexName -
|
|
2104
|
+
* @param setSettings.indexName - Name of the index on which to perform the operation.
|
|
1940
2105
|
* @param setSettings.indexSettings - The indexSettings object.
|
|
1941
|
-
* @param setSettings.forwardToReplicas -
|
|
2106
|
+
* @param setSettings.forwardToReplicas - Whether changes are applied to replica indices.
|
|
1942
2107
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1943
2108
|
*/
|
|
1944
2109
|
setSettings({ indexName, indexSettings, forwardToReplicas }, requestOptions) {
|
|
@@ -1964,9 +2129,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1964
2129
|
return transporter.request(request, requestOptions);
|
|
1965
2130
|
},
|
|
1966
2131
|
/**
|
|
1967
|
-
*
|
|
2132
|
+
* Replaces the permissions of an existing API key. Any unspecified attribute resets that attribute to its default value.
|
|
2133
|
+
*
|
|
2134
|
+
* Required API Key ACLs:
|
|
2135
|
+
* - admin.
|
|
1968
2136
|
*
|
|
1969
|
-
* @summary Update an API key.
|
|
1970
2137
|
* @param updateApiKey - The updateApiKey object.
|
|
1971
2138
|
* @param updateApiKey.key - API key.
|
|
1972
2139
|
* @param updateApiKey.apiKey - The apiKey object.
|
|
@@ -1998,6 +2165,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1998
2165
|
}
|
|
1999
2166
|
|
|
2000
2167
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
|
2168
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
2001
2169
|
function searchClient(appId, apiKey, options) {
|
|
2002
2170
|
if (!appId || typeof appId !== 'string') {
|
|
2003
2171
|
throw new Error('`appId` is missing.');
|
|
@@ -2005,21 +2173,53 @@ function searchClient(appId, apiKey, options) {
|
|
|
2005
2173
|
if (!apiKey || typeof apiKey !== 'string') {
|
|
2006
2174
|
throw new Error('`apiKey` is missing.');
|
|
2007
2175
|
}
|
|
2008
|
-
return
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2176
|
+
return {
|
|
2177
|
+
...createSearchClient({
|
|
2178
|
+
appId,
|
|
2179
|
+
apiKey,
|
|
2180
|
+
timeouts: {
|
|
2181
|
+
connect: clientCommon.DEFAULT_CONNECT_TIMEOUT_NODE,
|
|
2182
|
+
read: clientCommon.DEFAULT_READ_TIMEOUT_NODE,
|
|
2183
|
+
write: clientCommon.DEFAULT_WRITE_TIMEOUT_NODE,
|
|
2184
|
+
},
|
|
2185
|
+
requester: requesterNodeHttp.createHttpRequester(),
|
|
2186
|
+
algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
|
|
2187
|
+
responsesCache: clientCommon.createNullCache(),
|
|
2188
|
+
requestsCache: clientCommon.createNullCache(),
|
|
2189
|
+
hostsCache: clientCommon.createMemoryCache(),
|
|
2190
|
+
...options,
|
|
2191
|
+
}),
|
|
2192
|
+
/**
|
|
2193
|
+
* Helper: Generates a secured API key based on the given `parentApiKey` and given `restrictions`.
|
|
2194
|
+
*
|
|
2195
|
+
* @summary Helper: Generates a secured API key based on the given `parentApiKey` and given `restrictions`.
|
|
2196
|
+
* @param generateSecuredApiKey - The `generateSecuredApiKey` object.
|
|
2197
|
+
* @param generateSecuredApiKey.parentApiKey - The base API key from which to generate the new secured one.
|
|
2198
|
+
* @param generateSecuredApiKey.restrictions - A set of properties defining the restrictions of the secured API key.
|
|
2199
|
+
*/
|
|
2200
|
+
generateSecuredApiKey({ parentApiKey, restrictions = {}, }) {
|
|
2201
|
+
const queryParameters = clientCommon.serializeQueryParameters(restrictions);
|
|
2202
|
+
return Buffer.from(crypto.createHmac('sha256', parentApiKey)
|
|
2203
|
+
.update(queryParameters)
|
|
2204
|
+
.digest('hex') + queryParameters).toString('base64');
|
|
2205
|
+
},
|
|
2206
|
+
/**
|
|
2207
|
+
* Helper: Retrieves the remaining validity of the previous generated `securedApiKey`, the `ValidUntil` parameter must have been provided.
|
|
2208
|
+
*
|
|
2209
|
+
* @summary Helper: Retrieves the remaining validity of the previous generated `secured_api_key`, the `ValidUntil` parameter must have been provided.
|
|
2210
|
+
* @param getSecuredApiKeyRemainingValidity - The `getSecuredApiKeyRemainingValidity` object.
|
|
2211
|
+
* @param getSecuredApiKeyRemainingValidity.securedApiKey - The secured API key generated with the `generateSecuredApiKey` method.
|
|
2212
|
+
*/
|
|
2213
|
+
getSecuredApiKeyRemainingValidity({ securedApiKey, }) {
|
|
2214
|
+
const decodedString = Buffer.from(securedApiKey, 'base64').toString('ascii');
|
|
2215
|
+
const regex = /validUntil=(\d+)/;
|
|
2216
|
+
const match = decodedString.match(regex);
|
|
2217
|
+
if (match === null) {
|
|
2218
|
+
throw new Error('validUntil not found in given secured api key.');
|
|
2219
|
+
}
|
|
2220
|
+
return parseInt(match[1], 10) - Math.round(new Date().getTime() / 1000);
|
|
2221
|
+
},
|
|
2222
|
+
};
|
|
2023
2223
|
}
|
|
2024
2224
|
|
|
2025
2225
|
exports.apiClientVersion = apiClientVersion;
|