@algolia/client-search 5.0.0-alpha.99 → 5.0.0-beta.10
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/LICENSE +21 -0
- package/dist/builds/browser.d.ts +91 -3
- package/dist/builds/browser.d.ts.map +1 -1
- package/dist/builds/node.d.ts +109 -3
- package/dist/builds/node.d.ts.map +1 -1
- package/dist/client-search.cjs +544 -219
- package/dist/client-search.esm.browser.js +494 -228
- package/dist/client-search.esm.node.js +545 -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 +23 -18
- 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 +8 -20
- 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/browsePagination.d.ts +19 -0
- package/dist/model/browsePagination.d.ts.map +1 -0
- package/dist/model/browseResponse.d.ts +2 -1
- package/dist/model/browseResponse.d.ts.map +1 -1
- package/dist/model/builtInOperation.d.ts +2 -2
- package/dist/model/builtInOperationType.d.ts +1 -1
- package/dist/model/clientMethodProps.d.ts +137 -70
- 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 +5 -1
- package/dist/model/fetchedIndex.d.ts.map +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 +8 -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 +13 -10
- 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/redirect.d.ts +1 -1
- package/dist/model/redirectURL.d.ts +7 -0
- package/dist/model/redirectURL.d.ts.map +1 -0
- 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 +3 -1
- package/dist/model/renderingContent.d.ts.map +1 -1
- package/dist/model/replaceAllObjectsResponse.d.ts +11 -0
- package/dist/model/replaceAllObjectsResponse.d.ts.map +1 -0
- 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/searchPagination.d.ts +19 -0
- package/dist/model/searchPagination.d.ts.map +1 -0
- 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/searchResponse.d.ts +2 -1
- package/dist/model/searchResponse.d.ts.map +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 +5 -1
- package/dist/model/value.d.ts.map +1 -1
- package/dist/src/searchClient.d.ts +385 -208
- 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 +25 -18
- package/model/baseSearchParamsWithoutQuery.ts +26 -30
- package/model/baseSearchResponse.ts +9 -24
- package/model/batchDictionaryEntriesParams.ts +3 -3
- package/model/batchResponse.ts +2 -2
- package/model/browsePagination.ts +23 -0
- package/model/browseResponse.ts +2 -0
- package/model/builtInOperation.ts +2 -2
- package/model/builtInOperationType.ts +1 -1
- package/model/clientMethodProps.ts +156 -70
- 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 +6 -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 +8 -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 +13 -10
- package/model/reRankingApplyFilter.ts +2 -4
- package/model/redirect.ts +1 -1
- package/model/redirectURL.ts +8 -0
- package/model/removeStopWords.ts +4 -2
- package/model/removeUserIdResponse.ts +1 -1
- package/model/removeWordsIfNoResults.ts +1 -1
- package/model/renderingContent.ts +4 -1
- package/model/replaceAllObjectsResponse.ts +15 -0
- 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/searchPagination.ts +23 -0
- package/model/searchParamsObject.ts +3 -0
- package/model/searchParamsQuery.ts +1 -1
- package/model/searchResponse.ts +3 -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 +6 -1
- package/package.json +11 -8
- package/dist/model/mixedSearchFilters.d.ts +0 -2
- package/dist/model/mixedSearchFilters.d.ts.map +0 -1
|
@@ -235,6 +235,14 @@ function createStatefulHost(host, status = 'up') {
|
|
|
235
235
|
};
|
|
236
236
|
}
|
|
237
237
|
|
|
238
|
+
function _defineProperty(e, r, t) {
|
|
239
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
240
|
+
value: t,
|
|
241
|
+
enumerable: !0,
|
|
242
|
+
configurable: !0,
|
|
243
|
+
writable: !0
|
|
244
|
+
}) : e[r] = t, e;
|
|
245
|
+
}
|
|
238
246
|
function _toPrimitive(t, r) {
|
|
239
247
|
if ("object" != typeof t || !t) return t;
|
|
240
248
|
var e = t[Symbol.toPrimitive];
|
|
@@ -247,21 +255,7 @@ function _toPrimitive(t, r) {
|
|
|
247
255
|
}
|
|
248
256
|
function _toPropertyKey(t) {
|
|
249
257
|
var i = _toPrimitive(t, "string");
|
|
250
|
-
return "symbol" == typeof i ? i :
|
|
251
|
-
}
|
|
252
|
-
function _defineProperty(obj, key, value) {
|
|
253
|
-
key = _toPropertyKey(key);
|
|
254
|
-
if (key in obj) {
|
|
255
|
-
Object.defineProperty(obj, key, {
|
|
256
|
-
value: value,
|
|
257
|
-
enumerable: true,
|
|
258
|
-
configurable: true,
|
|
259
|
-
writable: true
|
|
260
|
-
});
|
|
261
|
-
} else {
|
|
262
|
-
obj[key] = value;
|
|
263
|
-
}
|
|
264
|
-
return obj;
|
|
258
|
+
return "symbol" == typeof i ? i : i + "";
|
|
265
259
|
}
|
|
266
260
|
|
|
267
261
|
class AlgoliaError extends Error {
|
|
@@ -283,7 +277,7 @@ class ErrorWithStackTrace extends AlgoliaError {
|
|
|
283
277
|
}
|
|
284
278
|
class RetryError extends ErrorWithStackTrace {
|
|
285
279
|
constructor(stackTrace) {
|
|
286
|
-
super('Unreachable hosts - your application id may be incorrect. If the error persists, please
|
|
280
|
+
super('Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.', stackTrace, 'RetryError');
|
|
287
281
|
}
|
|
288
282
|
}
|
|
289
283
|
class ApiError extends ErrorWithStackTrace {
|
|
@@ -321,15 +315,14 @@ function shuffle(array) {
|
|
|
321
315
|
}
|
|
322
316
|
function serializeUrl(host, path, queryParameters) {
|
|
323
317
|
const queryParametersAsString = serializeQueryParameters(queryParameters);
|
|
324
|
-
let url = `${host.protocol}://${host.url}/${path.charAt(0) === '/' ? path.
|
|
318
|
+
let url = `${host.protocol}://${host.url}${host.port ? `:${host.port}` : ''}/${path.charAt(0) === '/' ? path.substring(1) : path}`;
|
|
325
319
|
if (queryParametersAsString.length) {
|
|
326
320
|
url += `?${queryParametersAsString}`;
|
|
327
321
|
}
|
|
328
322
|
return url;
|
|
329
323
|
}
|
|
330
324
|
function serializeQueryParameters(parameters) {
|
|
331
|
-
|
|
332
|
-
return Object.keys(parameters).map(key => `${key}=${encodeURIComponent(isObjectOrArray(parameters[key]) ? JSON.stringify(parameters[key]) : parameters[key])}`).join('&');
|
|
325
|
+
return Object.keys(parameters).filter(key => parameters[key] !== undefined).sort().map(key => `${key}=${encodeURIComponent(Object.prototype.toString.call(parameters[key]) === '[object Array]' ? parameters[key].join(',') : parameters[key]).replaceAll('+', '%20')}`).join('&');
|
|
333
326
|
}
|
|
334
327
|
function serializeData(request, requestOptions) {
|
|
335
328
|
if (request.method === 'GET' || request.data === undefined && requestOptions.data === undefined) {
|
|
@@ -500,16 +493,13 @@ function createTransporter({
|
|
|
500
493
|
if (host === undefined) {
|
|
501
494
|
throw new RetryError(stackTraceWithoutCredentials(stackTrace));
|
|
502
495
|
}
|
|
503
|
-
let responseTimeout = requestOptions.
|
|
504
|
-
if (responseTimeout === undefined) {
|
|
505
|
-
responseTimeout = isRead ? timeouts.read : timeouts.write;
|
|
506
|
-
}
|
|
496
|
+
let responseTimeout = isRead ? requestOptions.timeouts?.read || timeouts.read : requestOptions.timeouts?.write || timeouts.write;
|
|
507
497
|
const payload = {
|
|
508
498
|
data,
|
|
509
499
|
headers,
|
|
510
500
|
method: request.method,
|
|
511
501
|
url: serializeUrl(host, request.path, queryParameters),
|
|
512
|
-
connectTimeout: getTimeout(timeoutsCount, timeouts.connect),
|
|
502
|
+
connectTimeout: getTimeout(timeoutsCount, requestOptions.timeouts?.connect || timeouts.connect),
|
|
513
503
|
responseTimeout: getTimeout(timeoutsCount, responseTimeout)
|
|
514
504
|
};
|
|
515
505
|
/**
|
|
@@ -737,7 +727,7 @@ function createXhrRequester() {
|
|
|
737
727
|
}
|
|
738
728
|
|
|
739
729
|
// 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.
|
|
740
|
-
const apiClientVersion = '5.0.0-
|
|
730
|
+
const apiClientVersion = '5.0.0-beta.10';
|
|
741
731
|
function getDefaultHosts(appId) {
|
|
742
732
|
return [
|
|
743
733
|
{
|
|
@@ -823,7 +813,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
823
813
|
* Helper: Wait for a task to be published (completed) for a given `indexName` and `taskID`.
|
|
824
814
|
*
|
|
825
815
|
* @summary Helper method that waits for a task to be published (completed).
|
|
826
|
-
* @param waitForTaskOptions - The waitForTaskOptions object.
|
|
816
|
+
* @param waitForTaskOptions - The `waitForTaskOptions` object.
|
|
827
817
|
* @param waitForTaskOptions.indexName - The `indexName` where the operation was performed.
|
|
828
818
|
* @param waitForTaskOptions.taskID - The `taskID` returned in the method response.
|
|
829
819
|
* @param waitForTaskOptions.maxRetries - The maximum number of retries. 50 by default.
|
|
@@ -843,11 +833,34 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
843
833
|
timeout: () => timeout(retryCount),
|
|
844
834
|
});
|
|
845
835
|
},
|
|
836
|
+
/**
|
|
837
|
+
* Helper: Wait for an application-level task to complete for a given `taskID`.
|
|
838
|
+
*
|
|
839
|
+
* @summary Helper method that waits for a task to be published (completed).
|
|
840
|
+
* @param waitForAppTaskOptions - The `waitForTaskOptions` object.
|
|
841
|
+
* @param waitForAppTaskOptions.taskID - The `taskID` returned in the method response.
|
|
842
|
+
* @param waitForAppTaskOptions.maxRetries - The maximum number of retries. 50 by default.
|
|
843
|
+
* @param waitForAppTaskOptions.timeout - The function to decide how long to wait between retries.
|
|
844
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
|
|
845
|
+
*/
|
|
846
|
+
waitForAppTask({ taskID, maxRetries = 50, timeout = (retryCount) => Math.min(retryCount * 200, 5000), }, requestOptions) {
|
|
847
|
+
let retryCount = 0;
|
|
848
|
+
return createIterablePromise({
|
|
849
|
+
func: () => this.getAppTask({ taskID }, requestOptions),
|
|
850
|
+
validate: (response) => response.status === 'published',
|
|
851
|
+
aggregator: () => (retryCount += 1),
|
|
852
|
+
error: {
|
|
853
|
+
validate: () => retryCount >= maxRetries,
|
|
854
|
+
message: () => `The maximum number of retries exceeded. (${retryCount}/${maxRetries})`,
|
|
855
|
+
},
|
|
856
|
+
timeout: () => timeout(retryCount),
|
|
857
|
+
});
|
|
858
|
+
},
|
|
846
859
|
/**
|
|
847
860
|
* Helper: Wait for an API key to be added, updated or deleted based on a given `operation`.
|
|
848
861
|
*
|
|
849
862
|
* @summary Helper method that waits for an API key task to be processed.
|
|
850
|
-
* @param waitForApiKeyOptions - The waitForApiKeyOptions object.
|
|
863
|
+
* @param waitForApiKeyOptions - The `waitForApiKeyOptions` object.
|
|
851
864
|
* @param waitForApiKeyOptions.operation - The `operation` that was done on a `key`.
|
|
852
865
|
* @param waitForApiKeyOptions.key - The `key` that has been added, deleted or updated.
|
|
853
866
|
* @param waitForApiKeyOptions.apiKey - Necessary to know if an `update` operation has been processed, compare fields of the response with it.
|
|
@@ -900,7 +913,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
900
913
|
* Helper: Iterate on the `browse` method of the client to allow aggregating objects of an index.
|
|
901
914
|
*
|
|
902
915
|
* @summary Helper method that iterates on the `browse` method.
|
|
903
|
-
* @param browseObjects - The browseObjects object.
|
|
916
|
+
* @param browseObjects - The `browseObjects` object.
|
|
904
917
|
* @param browseObjects.indexName - The index in which to perform the request.
|
|
905
918
|
* @param browseObjects.browseParams - The `browse` parameters.
|
|
906
919
|
* @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.
|
|
@@ -926,11 +939,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
926
939
|
* Helper: Iterate on the `searchRules` method of the client to allow aggregating rules of an index.
|
|
927
940
|
*
|
|
928
941
|
* @summary Helper method that iterates on the `searchRules` method.
|
|
929
|
-
* @param
|
|
930
|
-
* @param
|
|
931
|
-
* @param
|
|
932
|
-
* @param
|
|
933
|
-
* @param
|
|
942
|
+
* @param browseRules - The `browseRules` object.
|
|
943
|
+
* @param browseRules.indexName - The index in which to perform the request.
|
|
944
|
+
* @param browseRules.searchRulesParams - The `searchRules` method parameters.
|
|
945
|
+
* @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).
|
|
946
|
+
* @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`.
|
|
934
947
|
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `searchRules` method and merged with the transporter requestOptions.
|
|
935
948
|
*/
|
|
936
949
|
browseRules({ indexName, searchRulesParams, ...browseRulesOptions }, requestOptions) {
|
|
@@ -958,11 +971,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
958
971
|
* Helper: Iterate on the `searchSynonyms` method of the client to allow aggregating rules of an index.
|
|
959
972
|
*
|
|
960
973
|
* @summary Helper method that iterates on the `searchSynonyms` method.
|
|
961
|
-
* @param
|
|
962
|
-
* @param
|
|
963
|
-
* @param
|
|
964
|
-
* @param
|
|
965
|
-
* @param
|
|
974
|
+
* @param browseSynonyms - The `browseSynonyms` object.
|
|
975
|
+
* @param browseSynonyms.indexName - The index in which to perform the request.
|
|
976
|
+
* @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).
|
|
977
|
+
* @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`.
|
|
978
|
+
* @param browseSynonyms.searchSynonymsParams - The `searchSynonyms` method parameters.
|
|
966
979
|
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `searchSynonyms` method and merged with the transporter requestOptions.
|
|
967
980
|
*/
|
|
968
981
|
browseSynonyms({ indexName, searchSynonymsParams, ...browseSynonymsOptions }, requestOptions) {
|
|
@@ -972,16 +985,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
972
985
|
hitsPerPage: 1000,
|
|
973
986
|
};
|
|
974
987
|
return createIterablePromise({
|
|
975
|
-
func: (
|
|
976
|
-
|
|
988
|
+
func: (_) => {
|
|
989
|
+
const resp = this.searchSynonyms({
|
|
977
990
|
indexName,
|
|
978
991
|
searchSynonymsParams: {
|
|
979
992
|
...params,
|
|
980
|
-
page:
|
|
981
|
-
? previousResponse.page + 1
|
|
982
|
-
: params.page,
|
|
993
|
+
page: params.page,
|
|
983
994
|
},
|
|
984
995
|
}, requestOptions);
|
|
996
|
+
params.page += 1;
|
|
997
|
+
return resp;
|
|
985
998
|
},
|
|
986
999
|
validate: (response) => response.nbHits < params.hitsPerPage,
|
|
987
1000
|
...browseSynonymsOptions,
|
|
@@ -1010,9 +1023,137 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1010
1023
|
return this.search(searchMethodParams, requestOptions);
|
|
1011
1024
|
},
|
|
1012
1025
|
/**
|
|
1013
|
-
*
|
|
1026
|
+
* Helper: Chunks the given `objects` list in subset of 1000 elements max in order to make it fit in `batch` requests.
|
|
1027
|
+
*
|
|
1028
|
+
* @summary Helper: Chunks the given `objects` list in subset of 1000 elements max in order to make it fit in `batch` requests.
|
|
1029
|
+
* @param chunkedBatch - The `chunkedBatch` object.
|
|
1030
|
+
* @param chunkedBatch.indexName - The `indexName` to replace `objects` in.
|
|
1031
|
+
* @param chunkedBatch.objects - The array of `objects` to store in the given Algolia `indexName`.
|
|
1032
|
+
* @param chunkedBatch.action - The `batch` `action` to perform on the given array of `objects`, defaults to `addObject`.
|
|
1033
|
+
* @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.
|
|
1034
|
+
* @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.
|
|
1035
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
|
|
1036
|
+
*/
|
|
1037
|
+
async chunkedBatch({ indexName, objects, action = 'addObject', waitForTasks, batchSize = 1000, }, requestOptions) {
|
|
1038
|
+
let requests = [];
|
|
1039
|
+
const responses = [];
|
|
1040
|
+
const objectEntries = objects.entries();
|
|
1041
|
+
for (const [i, obj] of objectEntries) {
|
|
1042
|
+
requests.push({ action, body: obj });
|
|
1043
|
+
if (requests.length === batchSize || i === objects.length - 1) {
|
|
1044
|
+
responses.push(await this.batch({ indexName, batchWriteParams: { requests } }, requestOptions));
|
|
1045
|
+
requests = [];
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
if (waitForTasks) {
|
|
1049
|
+
for (const resp of responses) {
|
|
1050
|
+
await this.waitForTask({ indexName, taskID: resp.taskID });
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
return responses;
|
|
1054
|
+
},
|
|
1055
|
+
/**
|
|
1056
|
+
* Helper: Saves the given array of objects in the given index. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objects in it.
|
|
1057
|
+
*
|
|
1058
|
+
* @summary Helper: Saves the given array of objects in the given index. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objects in it.
|
|
1059
|
+
* @param saveObjects - The `saveObjects` object.
|
|
1060
|
+
* @param saveObjects.indexName - The `indexName` to save `objects` in.
|
|
1061
|
+
* @param saveObjects.objects - The array of `objects` to store in the given Algolia `indexName`.
|
|
1062
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `batch` method and merged with the transporter requestOptions.
|
|
1063
|
+
*/
|
|
1064
|
+
async saveObjects({ indexName, objects }, requestOptions) {
|
|
1065
|
+
return await this.chunkedBatch({ indexName, objects, action: 'addObject' }, requestOptions);
|
|
1066
|
+
},
|
|
1067
|
+
/**
|
|
1068
|
+
* Helper: Deletes every records for the given objectIDs. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objectIDs in it.
|
|
1069
|
+
*
|
|
1070
|
+
* @summary Helper: Deletes every records for the given objectIDs. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objectIDs in it.
|
|
1071
|
+
* @param deleteObjects - The `deleteObjects` object.
|
|
1072
|
+
* @param deleteObjects.indexName - The `indexName` to delete `objectIDs` from.
|
|
1073
|
+
* @param deleteObjects.objectIDs - The objectIDs to delete.
|
|
1074
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `batch` method and merged with the transporter requestOptions.
|
|
1075
|
+
*/
|
|
1076
|
+
async deleteObjects({ indexName, objectIDs }, requestOptions) {
|
|
1077
|
+
return await this.chunkedBatch({
|
|
1078
|
+
indexName,
|
|
1079
|
+
objects: objectIDs.map((objectID) => ({ objectID })),
|
|
1080
|
+
action: 'deleteObject',
|
|
1081
|
+
}, requestOptions);
|
|
1082
|
+
},
|
|
1083
|
+
/**
|
|
1084
|
+
* Helper: Replaces object content of all the given objects according to their respective `objectID` field. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objects in it.
|
|
1085
|
+
*
|
|
1086
|
+
* @summary Helper: Replaces object content of all the given objects according to their respective `objectID` field. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objects in it.
|
|
1087
|
+
* @param partialUpdateObjects - The `partialUpdateObjects` object.
|
|
1088
|
+
* @param partialUpdateObjects.indexName - The `indexName` to update `objects` in.
|
|
1089
|
+
* @param partialUpdateObjects.objects - The array of `objects` to update in the given Algolia `indexName`.
|
|
1090
|
+
* @param partialUpdateObjects.createIfNotExists - To be provided if non-existing objects are passed, otherwise, the call will fail..
|
|
1091
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
|
|
1092
|
+
*/
|
|
1093
|
+
async partialUpdateObjects({ indexName, objects, createIfNotExists }, requestOptions) {
|
|
1094
|
+
return await this.chunkedBatch({
|
|
1095
|
+
indexName,
|
|
1096
|
+
objects,
|
|
1097
|
+
action: createIfNotExists
|
|
1098
|
+
? 'partialUpdateObject'
|
|
1099
|
+
: 'partialUpdateObjectNoCreate',
|
|
1100
|
+
}, requestOptions);
|
|
1101
|
+
},
|
|
1102
|
+
/**
|
|
1103
|
+
* 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.
|
|
1104
|
+
* See https://api-clients-automation.netlify.app/docs/contributing/add-new-api-client#5-helpers for implementation details.
|
|
1105
|
+
*
|
|
1106
|
+
* @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.
|
|
1107
|
+
* @param replaceAllObjects - The `replaceAllObjects` object.
|
|
1108
|
+
* @param replaceAllObjects.indexName - The `indexName` to replace `objects` in.
|
|
1109
|
+
* @param replaceAllObjects.objects - The array of `objects` to store in the given Algolia `indexName`.
|
|
1110
|
+
* @param replaceAllObjects.batchSize - The size of the chunk of `objects`. The number of `batch` calls will be equal to `objects.length / batchSize`. Defaults to 1000.
|
|
1111
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `batch`, `operationIndex` and `getTask` method and merged with the transporter requestOptions.
|
|
1112
|
+
*/
|
|
1113
|
+
async replaceAllObjects({ indexName, objects, batchSize }, requestOptions) {
|
|
1114
|
+
const randomSuffix = Math.floor(Math.random() * 1000000) + 100000;
|
|
1115
|
+
const tmpIndexName = `${indexName}_tmp_${randomSuffix}`;
|
|
1116
|
+
let copyOperationResponse = await this.operationIndex({
|
|
1117
|
+
indexName,
|
|
1118
|
+
operationIndexParams: {
|
|
1119
|
+
operation: 'copy',
|
|
1120
|
+
destination: tmpIndexName,
|
|
1121
|
+
scope: ['settings', 'rules', 'synonyms'],
|
|
1122
|
+
},
|
|
1123
|
+
}, requestOptions);
|
|
1124
|
+
const batchResponses = await this.chunkedBatch({ indexName: tmpIndexName, objects, waitForTasks: true, batchSize }, requestOptions);
|
|
1125
|
+
await this.waitForTask({
|
|
1126
|
+
indexName: tmpIndexName,
|
|
1127
|
+
taskID: copyOperationResponse.taskID,
|
|
1128
|
+
});
|
|
1129
|
+
copyOperationResponse = await this.operationIndex({
|
|
1130
|
+
indexName,
|
|
1131
|
+
operationIndexParams: {
|
|
1132
|
+
operation: 'copy',
|
|
1133
|
+
destination: tmpIndexName,
|
|
1134
|
+
scope: ['settings', 'rules', 'synonyms'],
|
|
1135
|
+
},
|
|
1136
|
+
}, requestOptions);
|
|
1137
|
+
await this.waitForTask({
|
|
1138
|
+
indexName: tmpIndexName,
|
|
1139
|
+
taskID: copyOperationResponse.taskID,
|
|
1140
|
+
});
|
|
1141
|
+
const moveOperationResponse = await this.operationIndex({
|
|
1142
|
+
indexName: tmpIndexName,
|
|
1143
|
+
operationIndexParams: { operation: 'move', destination: indexName },
|
|
1144
|
+
}, requestOptions);
|
|
1145
|
+
await this.waitForTask({
|
|
1146
|
+
indexName: tmpIndexName,
|
|
1147
|
+
taskID: moveOperationResponse.taskID,
|
|
1148
|
+
});
|
|
1149
|
+
return { copyOperationResponse, batchResponses, moveOperationResponse };
|
|
1150
|
+
},
|
|
1151
|
+
/**
|
|
1152
|
+
* Creates a new API key with specific permissions and restrictions.
|
|
1153
|
+
*
|
|
1154
|
+
* Required API Key ACLs:
|
|
1155
|
+
* - admin.
|
|
1014
1156
|
*
|
|
1015
|
-
* @summary Add API key.
|
|
1016
1157
|
* @param apiKey - The apiKey object.
|
|
1017
1158
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1018
1159
|
*/
|
|
@@ -1036,13 +1177,15 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1036
1177
|
return transporter.request(request, requestOptions);
|
|
1037
1178
|
},
|
|
1038
1179
|
/**
|
|
1039
|
-
* If
|
|
1180
|
+
* 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).
|
|
1181
|
+
*
|
|
1182
|
+
* Required API Key ACLs:
|
|
1183
|
+
* - addObject.
|
|
1040
1184
|
*
|
|
1041
|
-
* @summary Add or update a record (using objectID).
|
|
1042
1185
|
* @param addOrUpdateObject - The addOrUpdateObject object.
|
|
1043
|
-
* @param addOrUpdateObject.indexName -
|
|
1044
|
-
* @param addOrUpdateObject.objectID - Unique record
|
|
1045
|
-
* @param addOrUpdateObject.body -
|
|
1186
|
+
* @param addOrUpdateObject.indexName - Name of the index on which to perform the operation.
|
|
1187
|
+
* @param addOrUpdateObject.objectID - Unique record identifier.
|
|
1188
|
+
* @param addOrUpdateObject.body - The record, a schemaless object with attributes that are useful in the context of search and discovery.
|
|
1046
1189
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1047
1190
|
*/
|
|
1048
1191
|
addOrUpdateObject({ indexName, objectID, body }, requestOptions) {
|
|
@@ -1070,9 +1213,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1070
1213
|
return transporter.request(request, requestOptions);
|
|
1071
1214
|
},
|
|
1072
1215
|
/**
|
|
1073
|
-
*
|
|
1216
|
+
* Adds a source to the list of allowed sources.
|
|
1217
|
+
*
|
|
1218
|
+
* Required API Key ACLs:
|
|
1219
|
+
* - admin.
|
|
1074
1220
|
*
|
|
1075
|
-
* @summary Add a source.
|
|
1076
1221
|
* @param source - Source to add.
|
|
1077
1222
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1078
1223
|
*/
|
|
@@ -1096,11 +1241,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1096
1241
|
return transporter.request(request, requestOptions);
|
|
1097
1242
|
},
|
|
1098
1243
|
/**
|
|
1099
|
-
*
|
|
1244
|
+
* 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.
|
|
1245
|
+
*
|
|
1246
|
+
* Required API Key ACLs:
|
|
1247
|
+
* - admin.
|
|
1100
1248
|
*
|
|
1101
|
-
* @summary Assign or move a user ID.
|
|
1102
1249
|
* @param assignUserId - The assignUserId object.
|
|
1103
|
-
* @param assignUserId.xAlgoliaUserID -
|
|
1250
|
+
* @param assignUserId.xAlgoliaUserID - Unique identifier of the user who makes the search request.
|
|
1104
1251
|
* @param assignUserId.assignUserIdParams - The assignUserIdParams object.
|
|
1105
1252
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1106
1253
|
*/
|
|
@@ -1130,11 +1277,10 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1130
1277
|
return transporter.request(request, requestOptions);
|
|
1131
1278
|
},
|
|
1132
1279
|
/**
|
|
1133
|
-
*
|
|
1280
|
+
* 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.
|
|
1134
1281
|
*
|
|
1135
|
-
* @summary Batch write operations on one index.
|
|
1136
1282
|
* @param batch - The batch object.
|
|
1137
|
-
* @param batch.indexName -
|
|
1283
|
+
* @param batch.indexName - Name of the index on which to perform the operation.
|
|
1138
1284
|
* @param batch.batchWriteParams - The batchWriteParams object.
|
|
1139
1285
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1140
1286
|
*/
|
|
@@ -1161,11 +1307,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1161
1307
|
return transporter.request(request, requestOptions);
|
|
1162
1308
|
},
|
|
1163
1309
|
/**
|
|
1164
|
-
*
|
|
1310
|
+
* Assigns multiple user IDs to a cluster. **You can\'t move users with this operation**.
|
|
1311
|
+
*
|
|
1312
|
+
* Required API Key ACLs:
|
|
1313
|
+
* - admin.
|
|
1165
1314
|
*
|
|
1166
|
-
* @summary Batch assign userIDs.
|
|
1167
1315
|
* @param batchAssignUserIds - The batchAssignUserIds object.
|
|
1168
|
-
* @param batchAssignUserIds.xAlgoliaUserID -
|
|
1316
|
+
* @param batchAssignUserIds.xAlgoliaUserID - Unique identifier of the user who makes the search request.
|
|
1169
1317
|
* @param batchAssignUserIds.batchAssignUserIdsParams - The batchAssignUserIdsParams object.
|
|
1170
1318
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1171
1319
|
*/
|
|
@@ -1198,11 +1346,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1198
1346
|
return transporter.request(request, requestOptions);
|
|
1199
1347
|
},
|
|
1200
1348
|
/**
|
|
1201
|
-
*
|
|
1349
|
+
* Adds or deletes multiple entries from your plurals, segmentation, or stop word dictionaries.
|
|
1350
|
+
*
|
|
1351
|
+
* Required API Key ACLs:
|
|
1352
|
+
* - editSettings.
|
|
1202
1353
|
*
|
|
1203
|
-
* @summary Batch dictionary entries.
|
|
1204
1354
|
* @param batchDictionaryEntries - The batchDictionaryEntries object.
|
|
1205
|
-
* @param batchDictionaryEntries.dictionaryName - Dictionary to search
|
|
1355
|
+
* @param batchDictionaryEntries.dictionaryName - Dictionary type in which to search.
|
|
1206
1356
|
* @param batchDictionaryEntries.batchDictionaryEntriesParams - The batchDictionaryEntriesParams object.
|
|
1207
1357
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1208
1358
|
*/
|
|
@@ -1229,11 +1379,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1229
1379
|
return transporter.request(request, requestOptions);
|
|
1230
1380
|
},
|
|
1231
1381
|
/**
|
|
1232
|
-
*
|
|
1382
|
+
* Retrieves records from an index, up to 1,000 per request. While searching retrieves _hits_ (records augmented with attributes for highlighting and ranking details), browsing _just_ returns matching records. This can be useful if you want to export your indices. - The Analytics API doesn\'t collect data when using `browse`. - Records are ranked by attributes and custom ranking. - There\'s no ranking for: typo-tolerance, number of matched words, proximity, geo distance. Browse requests automatically apply these settings: - `advancedSyntax`: `false` - `attributesToHighlight`: `[]` - `attributesToSnippet`: `[]` - `distinct`: `false` - `enablePersonalization`: `false` - `enableRules`: `false` - `facets`: `[]` - `getRankingInfo`: `false` - `ignorePlurals`: `false` - `optionalFilters`: `[]` - `typoTolerance`: `true` or `false` (`min` and `strict` is evaluated to `true`) If you send these parameters with your browse requests, they\'ll be ignored.
|
|
1383
|
+
*
|
|
1384
|
+
* Required API Key ACLs:
|
|
1385
|
+
* - browse.
|
|
1233
1386
|
*
|
|
1234
|
-
* @summary Get all records from an index.
|
|
1235
1387
|
* @param browse - The browse object.
|
|
1236
|
-
* @param browse.indexName -
|
|
1388
|
+
* @param browse.indexName - Name of the index on which to perform the operation.
|
|
1237
1389
|
* @param browse.browseParams - The browseParams object.
|
|
1238
1390
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1239
1391
|
*/
|
|
@@ -1254,11 +1406,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1254
1406
|
return transporter.request(request, requestOptions);
|
|
1255
1407
|
},
|
|
1256
1408
|
/**
|
|
1257
|
-
*
|
|
1409
|
+
* Deletes only the records from an index while keeping settings, synonyms, and rules.
|
|
1410
|
+
*
|
|
1411
|
+
* Required API Key ACLs:
|
|
1412
|
+
* - deleteIndex.
|
|
1258
1413
|
*
|
|
1259
|
-
* @summary Delete all records from an index.
|
|
1260
1414
|
* @param clearObjects - The clearObjects object.
|
|
1261
|
-
* @param clearObjects.indexName -
|
|
1415
|
+
* @param clearObjects.indexName - Name of the index on which to perform the operation.
|
|
1262
1416
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1263
1417
|
*/
|
|
1264
1418
|
clearObjects({ indexName }, requestOptions) {
|
|
@@ -1277,12 +1431,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1277
1431
|
return transporter.request(request, requestOptions);
|
|
1278
1432
|
},
|
|
1279
1433
|
/**
|
|
1280
|
-
*
|
|
1434
|
+
* Deletes all rules from the index.
|
|
1435
|
+
*
|
|
1436
|
+
* Required API Key ACLs:
|
|
1437
|
+
* - editSettings.
|
|
1281
1438
|
*
|
|
1282
|
-
* @summary Delete all rules.
|
|
1283
1439
|
* @param clearRules - The clearRules object.
|
|
1284
|
-
* @param clearRules.indexName -
|
|
1285
|
-
* @param clearRules.forwardToReplicas -
|
|
1440
|
+
* @param clearRules.indexName - Name of the index on which to perform the operation.
|
|
1441
|
+
* @param clearRules.forwardToReplicas - Whether changes are applied to replica indices.
|
|
1286
1442
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1287
1443
|
*/
|
|
1288
1444
|
clearRules({ indexName, forwardToReplicas }, requestOptions) {
|
|
@@ -1304,12 +1460,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1304
1460
|
return transporter.request(request, requestOptions);
|
|
1305
1461
|
},
|
|
1306
1462
|
/**
|
|
1307
|
-
*
|
|
1463
|
+
* Deletes all synonyms from the index.
|
|
1464
|
+
*
|
|
1465
|
+
* Required API Key ACLs:
|
|
1466
|
+
* - editSettings.
|
|
1308
1467
|
*
|
|
1309
|
-
* @summary Delete all synonyms.
|
|
1310
1468
|
* @param clearSynonyms - The clearSynonyms object.
|
|
1311
|
-
* @param clearSynonyms.indexName -
|
|
1312
|
-
* @param clearSynonyms.forwardToReplicas -
|
|
1469
|
+
* @param clearSynonyms.indexName - Name of the index on which to perform the operation.
|
|
1470
|
+
* @param clearSynonyms.forwardToReplicas - Whether changes are applied to replica indices.
|
|
1313
1471
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1314
1472
|
*/
|
|
1315
1473
|
clearSynonyms({ indexName, forwardToReplicas }, requestOptions) {
|
|
@@ -1333,7 +1491,6 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1333
1491
|
/**
|
|
1334
1492
|
* This method allow you to send requests to the Algolia REST API.
|
|
1335
1493
|
*
|
|
1336
|
-
* @summary Send requests to the Algolia REST API.
|
|
1337
1494
|
* @param customDelete - The customDelete object.
|
|
1338
1495
|
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
1339
1496
|
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
@@ -1343,7 +1500,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1343
1500
|
if (!path) {
|
|
1344
1501
|
throw new Error('Parameter `path` is required when calling `customDelete`.');
|
|
1345
1502
|
}
|
|
1346
|
-
const requestPath = '/
|
|
1503
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
1347
1504
|
const headers = {};
|
|
1348
1505
|
const queryParameters = parameters ? parameters : {};
|
|
1349
1506
|
const request = {
|
|
@@ -1357,7 +1514,6 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1357
1514
|
/**
|
|
1358
1515
|
* This method allow you to send requests to the Algolia REST API.
|
|
1359
1516
|
*
|
|
1360
|
-
* @summary Send requests to the Algolia REST API.
|
|
1361
1517
|
* @param customGet - The customGet object.
|
|
1362
1518
|
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
1363
1519
|
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
@@ -1367,7 +1523,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1367
1523
|
if (!path) {
|
|
1368
1524
|
throw new Error('Parameter `path` is required when calling `customGet`.');
|
|
1369
1525
|
}
|
|
1370
|
-
const requestPath = '/
|
|
1526
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
1371
1527
|
const headers = {};
|
|
1372
1528
|
const queryParameters = parameters ? parameters : {};
|
|
1373
1529
|
const request = {
|
|
@@ -1381,7 +1537,6 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1381
1537
|
/**
|
|
1382
1538
|
* This method allow you to send requests to the Algolia REST API.
|
|
1383
1539
|
*
|
|
1384
|
-
* @summary Send requests to the Algolia REST API.
|
|
1385
1540
|
* @param customPost - The customPost object.
|
|
1386
1541
|
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
1387
1542
|
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
@@ -1392,7 +1547,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1392
1547
|
if (!path) {
|
|
1393
1548
|
throw new Error('Parameter `path` is required when calling `customPost`.');
|
|
1394
1549
|
}
|
|
1395
|
-
const requestPath = '/
|
|
1550
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
1396
1551
|
const headers = {};
|
|
1397
1552
|
const queryParameters = parameters ? parameters : {};
|
|
1398
1553
|
const request = {
|
|
@@ -1407,7 +1562,6 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1407
1562
|
/**
|
|
1408
1563
|
* This method allow you to send requests to the Algolia REST API.
|
|
1409
1564
|
*
|
|
1410
|
-
* @summary Send requests to the Algolia REST API.
|
|
1411
1565
|
* @param customPut - The customPut object.
|
|
1412
1566
|
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
1413
1567
|
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
@@ -1418,7 +1572,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1418
1572
|
if (!path) {
|
|
1419
1573
|
throw new Error('Parameter `path` is required when calling `customPut`.');
|
|
1420
1574
|
}
|
|
1421
|
-
const requestPath = '/
|
|
1575
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
1422
1576
|
const headers = {};
|
|
1423
1577
|
const queryParameters = parameters ? parameters : {};
|
|
1424
1578
|
const request = {
|
|
@@ -1431,9 +1585,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1431
1585
|
return transporter.request(request, requestOptions);
|
|
1432
1586
|
},
|
|
1433
1587
|
/**
|
|
1434
|
-
*
|
|
1588
|
+
* Deletes the API key.
|
|
1589
|
+
*
|
|
1590
|
+
* Required API Key ACLs:
|
|
1591
|
+
* - admin.
|
|
1435
1592
|
*
|
|
1436
|
-
* @summary Delete API key.
|
|
1437
1593
|
* @param deleteApiKey - The deleteApiKey object.
|
|
1438
1594
|
* @param deleteApiKey.key - API key.
|
|
1439
1595
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -1454,11 +1610,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1454
1610
|
return transporter.request(request, requestOptions);
|
|
1455
1611
|
},
|
|
1456
1612
|
/**
|
|
1457
|
-
* This operation doesn\'t
|
|
1613
|
+
* 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).
|
|
1614
|
+
*
|
|
1615
|
+
* Required API Key ACLs:
|
|
1616
|
+
* - deleteIndex.
|
|
1458
1617
|
*
|
|
1459
|
-
* @summary Delete all records matching a query.
|
|
1460
1618
|
* @param deleteBy - The deleteBy object.
|
|
1461
|
-
* @param deleteBy.indexName -
|
|
1619
|
+
* @param deleteBy.indexName - Name of the index on which to perform the operation.
|
|
1462
1620
|
* @param deleteBy.deleteByParams - The deleteByParams object.
|
|
1463
1621
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1464
1622
|
*/
|
|
@@ -1482,11 +1640,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1482
1640
|
return transporter.request(request, requestOptions);
|
|
1483
1641
|
},
|
|
1484
1642
|
/**
|
|
1485
|
-
*
|
|
1643
|
+
* 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/).
|
|
1644
|
+
*
|
|
1645
|
+
* Required API Key ACLs:
|
|
1646
|
+
* - deleteIndex.
|
|
1486
1647
|
*
|
|
1487
|
-
* @summary Delete index.
|
|
1488
1648
|
* @param deleteIndex - The deleteIndex object.
|
|
1489
|
-
* @param deleteIndex.indexName -
|
|
1649
|
+
* @param deleteIndex.indexName - Name of the index on which to perform the operation.
|
|
1490
1650
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1491
1651
|
*/
|
|
1492
1652
|
deleteIndex({ indexName }, requestOptions) {
|
|
@@ -1505,12 +1665,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1505
1665
|
return transporter.request(request, requestOptions);
|
|
1506
1666
|
},
|
|
1507
1667
|
/**
|
|
1508
|
-
* To delete
|
|
1668
|
+
* 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).
|
|
1669
|
+
*
|
|
1670
|
+
* Required API Key ACLs:
|
|
1671
|
+
* - deleteObject.
|
|
1509
1672
|
*
|
|
1510
|
-
* @summary Delete a record.
|
|
1511
1673
|
* @param deleteObject - The deleteObject object.
|
|
1512
|
-
* @param deleteObject.indexName -
|
|
1513
|
-
* @param deleteObject.objectID - Unique record
|
|
1674
|
+
* @param deleteObject.indexName - Name of the index on which to perform the operation.
|
|
1675
|
+
* @param deleteObject.objectID - Unique record identifier.
|
|
1514
1676
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1515
1677
|
*/
|
|
1516
1678
|
deleteObject({ indexName, objectID }, requestOptions) {
|
|
@@ -1534,13 +1696,15 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1534
1696
|
return transporter.request(request, requestOptions);
|
|
1535
1697
|
},
|
|
1536
1698
|
/**
|
|
1537
|
-
*
|
|
1699
|
+
* Deletes a rule by its ID. To find the object ID for rules, use the [`search` operation](#tag/Rules/operation/searchRules).
|
|
1700
|
+
*
|
|
1701
|
+
* Required API Key ACLs:
|
|
1702
|
+
* - editSettings.
|
|
1538
1703
|
*
|
|
1539
|
-
* @summary Delete a rule.
|
|
1540
1704
|
* @param deleteRule - The deleteRule object.
|
|
1541
|
-
* @param deleteRule.indexName -
|
|
1705
|
+
* @param deleteRule.indexName - Name of the index on which to perform the operation.
|
|
1542
1706
|
* @param deleteRule.objectID - Unique identifier of a rule object.
|
|
1543
|
-
* @param deleteRule.forwardToReplicas -
|
|
1707
|
+
* @param deleteRule.forwardToReplicas - Whether changes are applied to replica indices.
|
|
1544
1708
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1545
1709
|
*/
|
|
1546
1710
|
deleteRule({ indexName, objectID, forwardToReplicas }, requestOptions) {
|
|
@@ -1567,9 +1731,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1567
1731
|
return transporter.request(request, requestOptions);
|
|
1568
1732
|
},
|
|
1569
1733
|
/**
|
|
1570
|
-
*
|
|
1734
|
+
* Deletes a source from the list of allowed sources.
|
|
1735
|
+
*
|
|
1736
|
+
* Required API Key ACLs:
|
|
1737
|
+
* - admin.
|
|
1571
1738
|
*
|
|
1572
|
-
* @summary Remove a source.
|
|
1573
1739
|
* @param deleteSource - The deleteSource object.
|
|
1574
1740
|
* @param deleteSource.source - IP address range of the source.
|
|
1575
1741
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -1590,13 +1756,15 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1590
1756
|
return transporter.request(request, requestOptions);
|
|
1591
1757
|
},
|
|
1592
1758
|
/**
|
|
1593
|
-
*
|
|
1759
|
+
* Deletes a synonym by its ID. To find the object IDs of your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).
|
|
1760
|
+
*
|
|
1761
|
+
* Required API Key ACLs:
|
|
1762
|
+
* - editSettings.
|
|
1594
1763
|
*
|
|
1595
|
-
* @summary Delete a synonym.
|
|
1596
1764
|
* @param deleteSynonym - The deleteSynonym object.
|
|
1597
|
-
* @param deleteSynonym.indexName -
|
|
1765
|
+
* @param deleteSynonym.indexName - Name of the index on which to perform the operation.
|
|
1598
1766
|
* @param deleteSynonym.objectID - Unique identifier of a synonym object.
|
|
1599
|
-
* @param deleteSynonym.forwardToReplicas -
|
|
1767
|
+
* @param deleteSynonym.forwardToReplicas - Whether changes are applied to replica indices.
|
|
1600
1768
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1601
1769
|
*/
|
|
1602
1770
|
deleteSynonym({ indexName, objectID, forwardToReplicas }, requestOptions) {
|
|
@@ -1623,9 +1791,8 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1623
1791
|
return transporter.request(request, requestOptions);
|
|
1624
1792
|
},
|
|
1625
1793
|
/**
|
|
1626
|
-
*
|
|
1794
|
+
* 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.
|
|
1627
1795
|
*
|
|
1628
|
-
* @summary Get API key permissions.
|
|
1629
1796
|
* @param getApiKey - The getApiKey object.
|
|
1630
1797
|
* @param getApiKey.key - API key.
|
|
1631
1798
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -1646,9 +1813,36 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1646
1813
|
return transporter.request(request, requestOptions);
|
|
1647
1814
|
},
|
|
1648
1815
|
/**
|
|
1649
|
-
*
|
|
1816
|
+
* Checks the status of a given application task.
|
|
1817
|
+
*
|
|
1818
|
+
* Required API Key ACLs:
|
|
1819
|
+
* - editSettings.
|
|
1820
|
+
*
|
|
1821
|
+
* @param getAppTask - The getAppTask object.
|
|
1822
|
+
* @param getAppTask.taskID - Unique task identifier.
|
|
1823
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1824
|
+
*/
|
|
1825
|
+
getAppTask({ taskID }, requestOptions) {
|
|
1826
|
+
if (!taskID) {
|
|
1827
|
+
throw new Error('Parameter `taskID` is required when calling `getAppTask`.');
|
|
1828
|
+
}
|
|
1829
|
+
const requestPath = '/1/task/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));
|
|
1830
|
+
const headers = {};
|
|
1831
|
+
const queryParameters = {};
|
|
1832
|
+
const request = {
|
|
1833
|
+
method: 'GET',
|
|
1834
|
+
path: requestPath,
|
|
1835
|
+
queryParameters,
|
|
1836
|
+
headers,
|
|
1837
|
+
};
|
|
1838
|
+
return transporter.request(request, requestOptions);
|
|
1839
|
+
},
|
|
1840
|
+
/**
|
|
1841
|
+
* Lists supported languages with their supported dictionary types and number of custom entries.
|
|
1842
|
+
*
|
|
1843
|
+
* Required API Key ACLs:
|
|
1844
|
+
* - settings.
|
|
1650
1845
|
*
|
|
1651
|
-
* @summary List available languages.
|
|
1652
1846
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1653
1847
|
*/
|
|
1654
1848
|
getDictionaryLanguages(requestOptions) {
|
|
@@ -1664,9 +1858,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1664
1858
|
return transporter.request(request, requestOptions);
|
|
1665
1859
|
},
|
|
1666
1860
|
/**
|
|
1667
|
-
*
|
|
1861
|
+
* Retrieves the languages for which standard dictionary entries are turned off.
|
|
1862
|
+
*
|
|
1863
|
+
* Required API Key ACLs:
|
|
1864
|
+
* - settings.
|
|
1668
1865
|
*
|
|
1669
|
-
* @summary Get stop word settings.
|
|
1670
1866
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1671
1867
|
*/
|
|
1672
1868
|
getDictionarySettings(requestOptions) {
|
|
@@ -1682,14 +1878,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1682
1878
|
return transporter.request(request, requestOptions);
|
|
1683
1879
|
},
|
|
1684
1880
|
/**
|
|
1685
|
-
* 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.
|
|
1881
|
+
* 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.
|
|
1882
|
+
*
|
|
1883
|
+
* Required API Key ACLs:
|
|
1884
|
+
* - logs.
|
|
1686
1885
|
*
|
|
1687
|
-
* @summary Return the latest log entries.
|
|
1688
1886
|
* @param getLogs - The getLogs object.
|
|
1689
|
-
* @param getLogs.offset - First log entry to retrieve.
|
|
1887
|
+
* @param getLogs.offset - First log entry to retrieve. The most recent entries are listed first.
|
|
1690
1888
|
* @param getLogs.length - Maximum number of entries to retrieve.
|
|
1691
|
-
* @param getLogs.indexName - Index for which log entries
|
|
1692
|
-
* @param getLogs.type - Type of log entries to retrieve.
|
|
1889
|
+
* @param getLogs.indexName - Index for which to retrieve log entries. By default, log entries are retrieved for all indices.
|
|
1890
|
+
* @param getLogs.type - Type of log entries to retrieve. By default, all log entries are retrieved.
|
|
1693
1891
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1694
1892
|
*/
|
|
1695
1893
|
getLogs({ offset, length, indexName, type } = {}, requestOptions = undefined) {
|
|
@@ -1717,13 +1915,15 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1717
1915
|
return transporter.request(request, requestOptions);
|
|
1718
1916
|
},
|
|
1719
1917
|
/**
|
|
1720
|
-
* To
|
|
1918
|
+
* Retrieves one record by its object ID. To retrieve more than one record, use the [`objects` operation](#tag/Records/operation/getObjects).
|
|
1919
|
+
*
|
|
1920
|
+
* Required API Key ACLs:
|
|
1921
|
+
* - search.
|
|
1721
1922
|
*
|
|
1722
|
-
* @summary Get a record.
|
|
1723
1923
|
* @param getObject - The getObject object.
|
|
1724
|
-
* @param getObject.indexName -
|
|
1725
|
-
* @param getObject.objectID - Unique record
|
|
1726
|
-
* @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.
|
|
1924
|
+
* @param getObject.indexName - Name of the index on which to perform the operation.
|
|
1925
|
+
* @param getObject.objectID - Unique record identifier.
|
|
1926
|
+
* @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.
|
|
1727
1927
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1728
1928
|
*/
|
|
1729
1929
|
getObject({ indexName, objectID, attributesToRetrieve }, requestOptions) {
|
|
@@ -1750,9 +1950,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1750
1950
|
return transporter.request(request, requestOptions);
|
|
1751
1951
|
},
|
|
1752
1952
|
/**
|
|
1753
|
-
*
|
|
1953
|
+
* Retrieves one or more records, potentially from different indices. Records are returned in the same order as the requests.
|
|
1954
|
+
*
|
|
1955
|
+
* Required API Key ACLs:
|
|
1956
|
+
* - search.
|
|
1754
1957
|
*
|
|
1755
|
-
* @summary Get multiple records.
|
|
1756
1958
|
* @param getObjectsParams - Request object.
|
|
1757
1959
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1758
1960
|
*/
|
|
@@ -1778,11 +1980,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1778
1980
|
return transporter.request(request, requestOptions);
|
|
1779
1981
|
},
|
|
1780
1982
|
/**
|
|
1781
|
-
*
|
|
1983
|
+
* Retrieves a rule by its ID. To find the object ID of rules, use the [`search` operation](#tag/Rules/operation/searchRules).
|
|
1984
|
+
*
|
|
1985
|
+
* Required API Key ACLs:
|
|
1986
|
+
* - settings.
|
|
1782
1987
|
*
|
|
1783
|
-
* @summary Get a rule.
|
|
1784
1988
|
* @param getRule - The getRule object.
|
|
1785
|
-
* @param getRule.indexName -
|
|
1989
|
+
* @param getRule.indexName - Name of the index on which to perform the operation.
|
|
1786
1990
|
* @param getRule.objectID - Unique identifier of a rule object.
|
|
1787
1991
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1788
1992
|
*/
|
|
@@ -1807,11 +2011,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1807
2011
|
return transporter.request(request, requestOptions);
|
|
1808
2012
|
},
|
|
1809
2013
|
/**
|
|
1810
|
-
*
|
|
2014
|
+
* Retrieves an object with non-null index settings.
|
|
2015
|
+
*
|
|
2016
|
+
* Required API Key ACLs:
|
|
2017
|
+
* - search.
|
|
1811
2018
|
*
|
|
1812
|
-
* @summary Get index settings.
|
|
1813
2019
|
* @param getSettings - The getSettings object.
|
|
1814
|
-
* @param getSettings.indexName -
|
|
2020
|
+
* @param getSettings.indexName - Name of the index on which to perform the operation.
|
|
1815
2021
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1816
2022
|
*/
|
|
1817
2023
|
getSettings({ indexName }, requestOptions) {
|
|
@@ -1830,9 +2036,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1830
2036
|
return transporter.request(request, requestOptions);
|
|
1831
2037
|
},
|
|
1832
2038
|
/**
|
|
1833
|
-
*
|
|
2039
|
+
* Retrieves all allowed IP addresses with access to your application.
|
|
2040
|
+
*
|
|
2041
|
+
* Required API Key ACLs:
|
|
2042
|
+
* - admin.
|
|
1834
2043
|
*
|
|
1835
|
-
* @summary Get all allowed IP addresses.
|
|
1836
2044
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1837
2045
|
*/
|
|
1838
2046
|
getSources(requestOptions) {
|
|
@@ -1848,11 +2056,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1848
2056
|
return transporter.request(request, requestOptions);
|
|
1849
2057
|
},
|
|
1850
2058
|
/**
|
|
1851
|
-
*
|
|
2059
|
+
* Retrieves a syonym by its ID. To find the object IDs for your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).
|
|
2060
|
+
*
|
|
2061
|
+
* Required API Key ACLs:
|
|
2062
|
+
* - settings.
|
|
1852
2063
|
*
|
|
1853
|
-
* @summary Get a synonym object.
|
|
1854
2064
|
* @param getSynonym - The getSynonym object.
|
|
1855
|
-
* @param getSynonym.indexName -
|
|
2065
|
+
* @param getSynonym.indexName - Name of the index on which to perform the operation.
|
|
1856
2066
|
* @param getSynonym.objectID - Unique identifier of a synonym object.
|
|
1857
2067
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1858
2068
|
*/
|
|
@@ -1877,11 +2087,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1877
2087
|
return transporter.request(request, requestOptions);
|
|
1878
2088
|
},
|
|
1879
2089
|
/**
|
|
1880
|
-
*
|
|
2090
|
+
* 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.
|
|
2091
|
+
*
|
|
2092
|
+
* Required API Key ACLs:
|
|
2093
|
+
* - addObject.
|
|
1881
2094
|
*
|
|
1882
|
-
* @summary Check a task\'s status.
|
|
1883
2095
|
* @param getTask - The getTask object.
|
|
1884
|
-
* @param getTask.indexName -
|
|
2096
|
+
* @param getTask.indexName - Name of the index on which to perform the operation.
|
|
1885
2097
|
* @param getTask.taskID - Unique task identifier.
|
|
1886
2098
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1887
2099
|
*/
|
|
@@ -1906,9 +2118,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1906
2118
|
return transporter.request(request, requestOptions);
|
|
1907
2119
|
},
|
|
1908
2120
|
/**
|
|
1909
|
-
* Get the IDs of the 10 users with the highest number of records per cluster.
|
|
2121
|
+
* 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.
|
|
2122
|
+
*
|
|
2123
|
+
* Required API Key ACLs:
|
|
2124
|
+
* - admin.
|
|
1910
2125
|
*
|
|
1911
|
-
* @summary Get top userID.
|
|
1912
2126
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1913
2127
|
*/
|
|
1914
2128
|
getTopUserIds(requestOptions) {
|
|
@@ -1924,11 +2138,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1924
2138
|
return transporter.request(request, requestOptions);
|
|
1925
2139
|
},
|
|
1926
2140
|
/**
|
|
1927
|
-
* Returns the
|
|
2141
|
+
* 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.
|
|
2142
|
+
*
|
|
2143
|
+
* Required API Key ACLs:
|
|
2144
|
+
* - admin.
|
|
1928
2145
|
*
|
|
1929
|
-
* @summary Get userID.
|
|
1930
2146
|
* @param getUserId - The getUserId object.
|
|
1931
|
-
* @param getUserId.userID -
|
|
2147
|
+
* @param getUserId.userID - Unique identifier of the user who makes the search request.
|
|
1932
2148
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1933
2149
|
*/
|
|
1934
2150
|
getUserId({ userID }, requestOptions) {
|
|
@@ -1949,9 +2165,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1949
2165
|
/**
|
|
1950
2166
|
* 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.
|
|
1951
2167
|
*
|
|
1952
|
-
*
|
|
2168
|
+
* Required API Key ACLs:
|
|
2169
|
+
* - admin.
|
|
2170
|
+
*
|
|
1953
2171
|
* @param hasPendingMappings - The hasPendingMappings object.
|
|
1954
|
-
* @param hasPendingMappings.getClusters -
|
|
2172
|
+
* @param hasPendingMappings.getClusters - Whether to include the cluster\'s pending mapping state in the response.
|
|
1955
2173
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1956
2174
|
*/
|
|
1957
2175
|
hasPendingMappings({ getClusters } = {}, requestOptions = undefined) {
|
|
@@ -1970,9 +2188,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1970
2188
|
return transporter.request(request, requestOptions);
|
|
1971
2189
|
},
|
|
1972
2190
|
/**
|
|
1973
|
-
*
|
|
2191
|
+
* Lists all API keys associated with your Algolia application, including their permissions and restrictions.
|
|
2192
|
+
*
|
|
2193
|
+
* Required API Key ACLs:
|
|
2194
|
+
* - admin.
|
|
1974
2195
|
*
|
|
1975
|
-
* @summary List API keys.
|
|
1976
2196
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1977
2197
|
*/
|
|
1978
2198
|
listApiKeys(requestOptions) {
|
|
@@ -1988,9 +2208,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1988
2208
|
return transporter.request(request, requestOptions);
|
|
1989
2209
|
},
|
|
1990
2210
|
/**
|
|
1991
|
-
*
|
|
2211
|
+
* Lists the available clusters in a multi-cluster setup.
|
|
2212
|
+
*
|
|
2213
|
+
* Required API Key ACLs:
|
|
2214
|
+
* - admin.
|
|
1992
2215
|
*
|
|
1993
|
-
* @summary List clusters.
|
|
1994
2216
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1995
2217
|
*/
|
|
1996
2218
|
listClusters(requestOptions) {
|
|
@@ -2006,12 +2228,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2006
2228
|
return transporter.request(request, requestOptions);
|
|
2007
2229
|
},
|
|
2008
2230
|
/**
|
|
2009
|
-
*
|
|
2231
|
+
* Lists all indices in the current Algolia application. The request follows any index restrictions of the API key you use to make the request.
|
|
2232
|
+
*
|
|
2233
|
+
* Required API Key ACLs:
|
|
2234
|
+
* - listIndexes.
|
|
2010
2235
|
*
|
|
2011
|
-
* @summary List indices.
|
|
2012
2236
|
* @param listIndices - The listIndices object.
|
|
2013
|
-
* @param listIndices.page -
|
|
2014
|
-
* @param listIndices.hitsPerPage -
|
|
2237
|
+
* @param listIndices.page - Requested page of the API response. If `null`, the API response is not paginated.
|
|
2238
|
+
* @param listIndices.hitsPerPage - Number of hits per page.
|
|
2015
2239
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2016
2240
|
*/
|
|
2017
2241
|
listIndices({ page, hitsPerPage } = {}, requestOptions = undefined) {
|
|
@@ -2033,12 +2257,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2033
2257
|
return transporter.request(request, requestOptions);
|
|
2034
2258
|
},
|
|
2035
2259
|
/**
|
|
2036
|
-
*
|
|
2260
|
+
* 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.
|
|
2261
|
+
*
|
|
2262
|
+
* Required API Key ACLs:
|
|
2263
|
+
* - admin.
|
|
2037
2264
|
*
|
|
2038
|
-
* @summary List userIDs.
|
|
2039
2265
|
* @param listUserIds - The listUserIds object.
|
|
2040
|
-
* @param listUserIds.page -
|
|
2041
|
-
* @param listUserIds.hitsPerPage -
|
|
2266
|
+
* @param listUserIds.page - Requested page of the API response. If `null`, the API response is not paginated.
|
|
2267
|
+
* @param listUserIds.hitsPerPage - Number of hits per page.
|
|
2042
2268
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2043
2269
|
*/
|
|
2044
2270
|
listUserIds({ page, hitsPerPage } = {}, requestOptions = undefined) {
|
|
@@ -2060,9 +2286,8 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2060
2286
|
return transporter.request(request, requestOptions);
|
|
2061
2287
|
},
|
|
2062
2288
|
/**
|
|
2063
|
-
*
|
|
2289
|
+
* 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.
|
|
2064
2290
|
*
|
|
2065
|
-
* @summary Batch write operations on multiple indices.
|
|
2066
2291
|
* @param batchParams - The batchParams object.
|
|
2067
2292
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2068
2293
|
*/
|
|
@@ -2086,11 +2311,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2086
2311
|
return transporter.request(request, requestOptions);
|
|
2087
2312
|
},
|
|
2088
2313
|
/**
|
|
2089
|
-
*
|
|
2314
|
+
* Copies or moves (renames) an index within the same Algolia application. - Existing destination indices are overwritten, except for their analytics data. - If the destination index doesn\'t exist yet, it\'ll be created. **Copy** - Copying a source index that doesn\'t exist creates a new index with 0 records and default settings. - The API keys of the source index are merged with the existing keys in the destination index. - You can\'t copy the `enableReRanking`, `mode`, and `replicas` settings. - You can\'t copy to a destination index that already has replicas. - Be aware of the [size limits](https://www.algolia.com/doc/guides/scaling/algolia-service-limits/#application-record-and-index-limits). - Related guide: [Copy indices](https://www.algolia.com/doc/guides/sending-and-managing-data/manage-indices-and-apps/manage-indices/how-to/copy-indices/) **Move** - Moving a source index that doesn\'t exist is ignored without returning an error. - When moving an index, the analytics data keep their original name and a new set of analytics data is started for the new name. To access the original analytics in the dashboard, create an index with the original name. - If the destination index has replicas, moving will overwrite the existing index and copy the data to the replica indices. - Related guide: [Move indices](https://www.algolia.com/doc/guides/sending-and-managing-data/manage-indices-and-apps/manage-indices/how-to/move-indices/).
|
|
2315
|
+
*
|
|
2316
|
+
* Required API Key ACLs:
|
|
2317
|
+
* - addObject.
|
|
2090
2318
|
*
|
|
2091
|
-
* @summary Copy, move, or rename an index.
|
|
2092
2319
|
* @param operationIndex - The operationIndex object.
|
|
2093
|
-
* @param operationIndex.indexName -
|
|
2320
|
+
* @param operationIndex.indexName - Name of the index on which to perform the operation.
|
|
2094
2321
|
* @param operationIndex.operationIndexParams - The operationIndexParams object.
|
|
2095
2322
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2096
2323
|
*/
|
|
@@ -2120,14 +2347,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2120
2347
|
return transporter.request(request, requestOptions);
|
|
2121
2348
|
},
|
|
2122
2349
|
/**
|
|
2123
|
-
*
|
|
2350
|
+
* 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.
|
|
2351
|
+
*
|
|
2352
|
+
* Required API Key ACLs:
|
|
2353
|
+
* - addObject.
|
|
2124
2354
|
*
|
|
2125
|
-
* @summary Update record attributes.
|
|
2126
2355
|
* @param partialUpdateObject - The partialUpdateObject object.
|
|
2127
|
-
* @param partialUpdateObject.indexName -
|
|
2128
|
-
* @param partialUpdateObject.objectID - Unique record
|
|
2129
|
-
* @param partialUpdateObject.attributesToUpdate -
|
|
2130
|
-
* @param partialUpdateObject.createIfNotExists -
|
|
2356
|
+
* @param partialUpdateObject.indexName - Name of the index on which to perform the operation.
|
|
2357
|
+
* @param partialUpdateObject.objectID - Unique record identifier.
|
|
2358
|
+
* @param partialUpdateObject.attributesToUpdate - Attributes with their values.
|
|
2359
|
+
* @param partialUpdateObject.createIfNotExists - Whether to create a new record if it doesn\'t exist.
|
|
2131
2360
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2132
2361
|
*/
|
|
2133
2362
|
partialUpdateObject({ indexName, objectID, attributesToUpdate, createIfNotExists, }, requestOptions) {
|
|
@@ -2158,11 +2387,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2158
2387
|
return transporter.request(request, requestOptions);
|
|
2159
2388
|
},
|
|
2160
2389
|
/**
|
|
2161
|
-
*
|
|
2390
|
+
* Deletes a user ID and its associated data from the clusters.
|
|
2391
|
+
*
|
|
2392
|
+
* Required API Key ACLs:
|
|
2393
|
+
* - admin.
|
|
2162
2394
|
*
|
|
2163
|
-
* @summary Remove userID.
|
|
2164
2395
|
* @param removeUserId - The removeUserId object.
|
|
2165
|
-
* @param removeUserId.userID -
|
|
2396
|
+
* @param removeUserId.userID - Unique identifier of the user who makes the search request.
|
|
2166
2397
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2167
2398
|
*/
|
|
2168
2399
|
removeUserId({ userID }, requestOptions) {
|
|
@@ -2181,9 +2412,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2181
2412
|
return transporter.request(request, requestOptions);
|
|
2182
2413
|
},
|
|
2183
2414
|
/**
|
|
2184
|
-
*
|
|
2415
|
+
* Replaces the list of allowed sources.
|
|
2416
|
+
*
|
|
2417
|
+
* Required API Key ACLs:
|
|
2418
|
+
* - admin.
|
|
2185
2419
|
*
|
|
2186
|
-
* @summary Replace all sources.
|
|
2187
2420
|
* @param replaceSources - The replaceSources object.
|
|
2188
2421
|
* @param replaceSources.source - Allowed sources.
|
|
2189
2422
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -2205,9 +2438,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2205
2438
|
return transporter.request(request, requestOptions);
|
|
2206
2439
|
},
|
|
2207
2440
|
/**
|
|
2208
|
-
*
|
|
2441
|
+
* 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.
|
|
2442
|
+
*
|
|
2443
|
+
* Required API Key ACLs:
|
|
2444
|
+
* - admin.
|
|
2209
2445
|
*
|
|
2210
|
-
* @summary Restore API key.
|
|
2211
2446
|
* @param restoreApiKey - The restoreApiKey object.
|
|
2212
2447
|
* @param restoreApiKey.key - API key.
|
|
2213
2448
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -2228,12 +2463,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2228
2463
|
return transporter.request(request, requestOptions);
|
|
2229
2464
|
},
|
|
2230
2465
|
/**
|
|
2231
|
-
*
|
|
2466
|
+
* 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).
|
|
2467
|
+
*
|
|
2468
|
+
* Required API Key ACLs:
|
|
2469
|
+
* - addObject.
|
|
2232
2470
|
*
|
|
2233
|
-
* @summary Add or update a record.
|
|
2234
2471
|
* @param saveObject - The saveObject object.
|
|
2235
|
-
* @param saveObject.indexName -
|
|
2236
|
-
* @param saveObject.body - The
|
|
2472
|
+
* @param saveObject.indexName - Name of the index on which to perform the operation.
|
|
2473
|
+
* @param saveObject.body - The record, a schemaless object with attributes that are useful in the context of search and discovery.
|
|
2237
2474
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2238
2475
|
*/
|
|
2239
2476
|
saveObject({ indexName, body }, requestOptions) {
|
|
@@ -2256,14 +2493,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2256
2493
|
return transporter.request(request, requestOptions);
|
|
2257
2494
|
},
|
|
2258
2495
|
/**
|
|
2259
|
-
* To create or update more than one rule, use the [`batch` operation](#tag/Rules/operation/saveRules).
|
|
2496
|
+
* 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).
|
|
2497
|
+
*
|
|
2498
|
+
* Required API Key ACLs:
|
|
2499
|
+
* - editSettings.
|
|
2260
2500
|
*
|
|
2261
|
-
* @summary Create or update a rule.
|
|
2262
2501
|
* @param saveRule - The saveRule object.
|
|
2263
|
-
* @param saveRule.indexName -
|
|
2502
|
+
* @param saveRule.indexName - Name of the index on which to perform the operation.
|
|
2264
2503
|
* @param saveRule.objectID - Unique identifier of a rule object.
|
|
2265
2504
|
* @param saveRule.rule - The rule object.
|
|
2266
|
-
* @param saveRule.forwardToReplicas -
|
|
2505
|
+
* @param saveRule.forwardToReplicas - Whether changes are applied to replica indices.
|
|
2267
2506
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2268
2507
|
*/
|
|
2269
2508
|
saveRule({ indexName, objectID, rule, forwardToReplicas }, requestOptions) {
|
|
@@ -2297,14 +2536,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2297
2536
|
return transporter.request(request, requestOptions);
|
|
2298
2537
|
},
|
|
2299
2538
|
/**
|
|
2300
|
-
* Create or update multiple rules.
|
|
2539
|
+
* 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.
|
|
2540
|
+
*
|
|
2541
|
+
* Required API Key ACLs:
|
|
2542
|
+
* - editSettings.
|
|
2301
2543
|
*
|
|
2302
|
-
* @summary Save a batch of rules.
|
|
2303
2544
|
* @param saveRules - The saveRules object.
|
|
2304
|
-
* @param saveRules.indexName -
|
|
2545
|
+
* @param saveRules.indexName - Name of the index on which to perform the operation.
|
|
2305
2546
|
* @param saveRules.rules - The rules object.
|
|
2306
|
-
* @param saveRules.forwardToReplicas -
|
|
2307
|
-
* @param saveRules.clearExistingRules -
|
|
2547
|
+
* @param saveRules.forwardToReplicas - Whether changes are applied to replica indices.
|
|
2548
|
+
* @param saveRules.clearExistingRules - Whether existing rules should be deleted before adding this batch.
|
|
2308
2549
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2309
2550
|
*/
|
|
2310
2551
|
saveRules({ indexName, rules, forwardToReplicas, clearExistingRules, }, requestOptions) {
|
|
@@ -2333,14 +2574,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2333
2574
|
return transporter.request(request, requestOptions);
|
|
2334
2575
|
},
|
|
2335
2576
|
/**
|
|
2336
|
-
*
|
|
2577
|
+
* 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).
|
|
2578
|
+
*
|
|
2579
|
+
* Required API Key ACLs:
|
|
2580
|
+
* - editSettings.
|
|
2337
2581
|
*
|
|
2338
|
-
* @summary Save a synonym.
|
|
2339
2582
|
* @param saveSynonym - The saveSynonym object.
|
|
2340
|
-
* @param saveSynonym.indexName -
|
|
2583
|
+
* @param saveSynonym.indexName - Name of the index on which to perform the operation.
|
|
2341
2584
|
* @param saveSynonym.objectID - Unique identifier of a synonym object.
|
|
2342
2585
|
* @param saveSynonym.synonymHit - The synonymHit object.
|
|
2343
|
-
* @param saveSynonym.forwardToReplicas -
|
|
2586
|
+
* @param saveSynonym.forwardToReplicas - Whether changes are applied to replica indices.
|
|
2344
2587
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2345
2588
|
*/
|
|
2346
2589
|
saveSynonym({ indexName, objectID, synonymHit, forwardToReplicas }, requestOptions) {
|
|
@@ -2377,14 +2620,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2377
2620
|
return transporter.request(request, requestOptions);
|
|
2378
2621
|
},
|
|
2379
2622
|
/**
|
|
2380
|
-
*
|
|
2623
|
+
* If a synonym with the `objectID` doesn\'t exist, Algolia adds a new one. Otherwise, existing synonyms are replaced.
|
|
2624
|
+
*
|
|
2625
|
+
* Required API Key ACLs:
|
|
2626
|
+
* - editSettings.
|
|
2381
2627
|
*
|
|
2382
|
-
* @summary Save a batch of synonyms.
|
|
2383
2628
|
* @param saveSynonyms - The saveSynonyms object.
|
|
2384
|
-
* @param saveSynonyms.indexName -
|
|
2629
|
+
* @param saveSynonyms.indexName - Name of the index on which to perform the operation.
|
|
2385
2630
|
* @param saveSynonyms.synonymHit - The synonymHit object.
|
|
2386
|
-
* @param saveSynonyms.forwardToReplicas -
|
|
2387
|
-
* @param saveSynonyms.replaceExistingSynonyms -
|
|
2631
|
+
* @param saveSynonyms.forwardToReplicas - Whether changes are applied to replica indices.
|
|
2632
|
+
* @param saveSynonyms.replaceExistingSynonyms - Whether to replace all synonyms in the index with the ones sent with this request.
|
|
2388
2633
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2389
2634
|
*/
|
|
2390
2635
|
saveSynonyms({ indexName, synonymHit, forwardToReplicas, replaceExistingSynonyms, }, requestOptions) {
|
|
@@ -2414,10 +2659,12 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2414
2659
|
return transporter.request(request, requestOptions);
|
|
2415
2660
|
},
|
|
2416
2661
|
/**
|
|
2417
|
-
*
|
|
2662
|
+
* 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.
|
|
2418
2663
|
*
|
|
2419
|
-
*
|
|
2420
|
-
*
|
|
2664
|
+
* Required API Key ACLs:
|
|
2665
|
+
* - search.
|
|
2666
|
+
*
|
|
2667
|
+
* @param searchMethodParams - Muli-search request body. Results are returned in the same order as the requests.
|
|
2421
2668
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2422
2669
|
*/
|
|
2423
2670
|
search(searchMethodParams, requestOptions) {
|
|
@@ -2464,11 +2711,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2464
2711
|
return transporter.request(request, requestOptions);
|
|
2465
2712
|
},
|
|
2466
2713
|
/**
|
|
2467
|
-
*
|
|
2714
|
+
* Searches for standard and custom dictionary entries.
|
|
2715
|
+
*
|
|
2716
|
+
* Required API Key ACLs:
|
|
2717
|
+
* - settings.
|
|
2468
2718
|
*
|
|
2469
|
-
* @summary Search dictionary entries.
|
|
2470
2719
|
* @param searchDictionaryEntries - The searchDictionaryEntries object.
|
|
2471
|
-
* @param searchDictionaryEntries.dictionaryName - Dictionary to search
|
|
2720
|
+
* @param searchDictionaryEntries.dictionaryName - Dictionary type in which to search.
|
|
2472
2721
|
* @param searchDictionaryEntries.searchDictionaryEntriesParams - The searchDictionaryEntriesParams object.
|
|
2473
2722
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2474
2723
|
*/
|
|
@@ -2497,12 +2746,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2497
2746
|
return transporter.request(request, requestOptions);
|
|
2498
2747
|
},
|
|
2499
2748
|
/**
|
|
2500
|
-
*
|
|
2749
|
+
* 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**.
|
|
2750
|
+
*
|
|
2751
|
+
* Required API Key ACLs:
|
|
2752
|
+
* - search.
|
|
2501
2753
|
*
|
|
2502
|
-
* @summary Search for facet values.
|
|
2503
2754
|
* @param searchForFacetValues - The searchForFacetValues object.
|
|
2504
|
-
* @param searchForFacetValues.indexName -
|
|
2505
|
-
* @param searchForFacetValues.facetName - Facet
|
|
2755
|
+
* @param searchForFacetValues.indexName - Name of the index on which to perform the operation.
|
|
2756
|
+
* @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.
|
|
2506
2757
|
* @param searchForFacetValues.searchForFacetValuesRequest - The searchForFacetValuesRequest object.
|
|
2507
2758
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2508
2759
|
*/
|
|
@@ -2530,11 +2781,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2530
2781
|
return transporter.request(request, requestOptions);
|
|
2531
2782
|
},
|
|
2532
2783
|
/**
|
|
2533
|
-
*
|
|
2784
|
+
* Searches for rules in your index.
|
|
2785
|
+
*
|
|
2786
|
+
* Required API Key ACLs:
|
|
2787
|
+
* - settings.
|
|
2534
2788
|
*
|
|
2535
|
-
* @summary Search for rules.
|
|
2536
2789
|
* @param searchRules - The searchRules object.
|
|
2537
|
-
* @param searchRules.indexName -
|
|
2790
|
+
* @param searchRules.indexName - Name of the index on which to perform the operation.
|
|
2538
2791
|
* @param searchRules.searchRulesParams - The searchRulesParams object.
|
|
2539
2792
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2540
2793
|
*/
|
|
@@ -2557,11 +2810,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2557
2810
|
return transporter.request(request, requestOptions);
|
|
2558
2811
|
},
|
|
2559
2812
|
/**
|
|
2560
|
-
*
|
|
2813
|
+
* 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.
|
|
2814
|
+
*
|
|
2815
|
+
* Required API Key ACLs:
|
|
2816
|
+
* - search.
|
|
2561
2817
|
*
|
|
2562
|
-
* @summary Search an index.
|
|
2563
2818
|
* @param searchSingleIndex - The searchSingleIndex object.
|
|
2564
|
-
* @param searchSingleIndex.indexName -
|
|
2819
|
+
* @param searchSingleIndex.indexName - Name of the index on which to perform the operation.
|
|
2565
2820
|
* @param searchSingleIndex.searchParams - The searchParams object.
|
|
2566
2821
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2567
2822
|
*/
|
|
@@ -2584,11 +2839,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2584
2839
|
return transporter.request(request, requestOptions);
|
|
2585
2840
|
},
|
|
2586
2841
|
/**
|
|
2587
|
-
*
|
|
2842
|
+
* Searches for synonyms in your index.
|
|
2843
|
+
*
|
|
2844
|
+
* Required API Key ACLs:
|
|
2845
|
+
* - settings.
|
|
2588
2846
|
*
|
|
2589
|
-
* @summary Search for synonyms.
|
|
2590
2847
|
* @param searchSynonyms - The searchSynonyms object.
|
|
2591
|
-
* @param searchSynonyms.indexName -
|
|
2848
|
+
* @param searchSynonyms.indexName - Name of the index on which to perform the operation.
|
|
2592
2849
|
* @param searchSynonyms.searchSynonymsParams - Body of the `searchSynonyms` operation.
|
|
2593
2850
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2594
2851
|
*/
|
|
@@ -2611,9 +2868,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2611
2868
|
return transporter.request(request, requestOptions);
|
|
2612
2869
|
},
|
|
2613
2870
|
/**
|
|
2614
|
-
* Since it can take
|
|
2871
|
+
* 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).
|
|
2872
|
+
*
|
|
2873
|
+
* Required API Key ACLs:
|
|
2874
|
+
* - admin.
|
|
2615
2875
|
*
|
|
2616
|
-
* @summary Search for a user ID.
|
|
2617
2876
|
* @param searchUserIdsParams - The searchUserIdsParams object.
|
|
2618
2877
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2619
2878
|
*/
|
|
@@ -2639,9 +2898,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2639
2898
|
return transporter.request(request, requestOptions);
|
|
2640
2899
|
},
|
|
2641
2900
|
/**
|
|
2642
|
-
*
|
|
2901
|
+
* Turns standard stop word dictionary entries on or off for a given language.
|
|
2902
|
+
*
|
|
2903
|
+
* Required API Key ACLs:
|
|
2904
|
+
* - editSettings.
|
|
2643
2905
|
*
|
|
2644
|
-
* @summary Set stop word settings.
|
|
2645
2906
|
* @param dictionarySettingsParams - The dictionarySettingsParams object.
|
|
2646
2907
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2647
2908
|
*/
|
|
@@ -2665,13 +2926,15 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2665
2926
|
return transporter.request(request, requestOptions);
|
|
2666
2927
|
},
|
|
2667
2928
|
/**
|
|
2668
|
-
* Update the specified
|
|
2929
|
+
* 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.
|
|
2930
|
+
*
|
|
2931
|
+
* Required API Key ACLs:
|
|
2932
|
+
* - editSettings.
|
|
2669
2933
|
*
|
|
2670
|
-
* @summary Update index settings.
|
|
2671
2934
|
* @param setSettings - The setSettings object.
|
|
2672
|
-
* @param setSettings.indexName -
|
|
2935
|
+
* @param setSettings.indexName - Name of the index on which to perform the operation.
|
|
2673
2936
|
* @param setSettings.indexSettings - The indexSettings object.
|
|
2674
|
-
* @param setSettings.forwardToReplicas -
|
|
2937
|
+
* @param setSettings.forwardToReplicas - Whether changes are applied to replica indices.
|
|
2675
2938
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2676
2939
|
*/
|
|
2677
2940
|
setSettings({ indexName, indexSettings, forwardToReplicas }, requestOptions) {
|
|
@@ -2697,9 +2960,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2697
2960
|
return transporter.request(request, requestOptions);
|
|
2698
2961
|
},
|
|
2699
2962
|
/**
|
|
2700
|
-
*
|
|
2963
|
+
* Replaces the permissions of an existing API key. Any unspecified attribute resets that attribute to its default value.
|
|
2964
|
+
*
|
|
2965
|
+
* Required API Key ACLs:
|
|
2966
|
+
* - admin.
|
|
2701
2967
|
*
|
|
2702
|
-
* @summary Update an API key.
|
|
2703
2968
|
* @param updateApiKey - The updateApiKey object.
|
|
2704
2969
|
* @param updateApiKey.key - API key.
|
|
2705
2970
|
* @param updateApiKey.apiKey - The apiKey object.
|
|
@@ -2731,6 +2996,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2731
2996
|
}
|
|
2732
2997
|
|
|
2733
2998
|
// 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.
|
|
2999
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
2734
3000
|
function searchClient(appId, apiKey, options) {
|
|
2735
3001
|
if (!appId || typeof appId !== 'string') {
|
|
2736
3002
|
throw new Error('`appId` is missing.');
|