You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Helper: Chunks the given `objects` list in subset of 1000 elements max in order to make it fit in `batch` requests.
311
+
*
312
+
* @summary Helper: Chunks the given `objects` list in subset of 1000 elements max in order to make it fit in `batch` requests. * @param getSecuredApiKeyRemainingValidity - The `getSecuredApiKeyRemainingValidity` object.
313
+
* @param chunkedBatch - The `chunkedBatch` object.
314
+
* @param chunkedBatch.indexName - The `indexName` to replace `objects` in.
315
+
* @param chunkedBatch.objects - The array of `objects` to store in the given Algolia `indexName`.
316
+
* @param chunkedBatch.action - The `batch` `action` to perform on the given array of `objects`, defaults to `addObject`.
317
+
* @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.
318
+
* @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.
319
+
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
* 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.
344
+
*
345
+
* @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.
346
+
* @param replaceAllObjects - The `replaceAllObjects` object.
347
+
* @param replaceAllObjects.indexName - The `indexName` to replace `objects` in.
348
+
* @param replaceAllObjects.objects - The array of `objects` to store in the given Algolia `indexName`.
349
+
* @param replaceAllObjects.batchSize - The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.
350
+
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
{{! Imports for the helpers method of the search client }}
13
-
{{#isSearchClient}}import type { CreateIterablePromise } from '{{{npmNamespace}}}/client-common';{{/isSearchClient}}
13
+
{{#isSearchClient}}
14
+
import type { CreateIterablePromise } from '{{{npmNamespace}}}/client-common';
15
+
import type { Action } from './action';
16
+
import type { UpdatedAtResponse } from './updatedAtResponse';
17
+
{{/isSearchClient}}
14
18
15
19
{{#operations}}
16
20
{{#operation}}
@@ -138,6 +142,52 @@ export type SecuredApiKeyRestrictions = {
138
142
139
143
searchParams?: SearchParamsObject;
140
144
};
145
+
146
+
export type ChunkedBatchOptions = ReplaceAllObjectsOptions & {
147
+
/**
148
+
* The `batch` `action` to perform on the given array of `objects`, defaults to `addObject`.
149
+
*/
150
+
action?: Action;
151
+
152
+
/**
153
+
* Whether ornot 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.
154
+
*/
155
+
waitForTasks?: boolean;
156
+
157
+
/**
158
+
* The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.
159
+
*/
160
+
batchSize?: number;
161
+
}
162
+
163
+
export type ReplaceAllObjectsOptions = {
164
+
/**
165
+
* The `indexName` to replace `objects` in.
166
+
*/
167
+
indexName: string;
168
+
169
+
/**
170
+
* The array of `objects` to store in the given Algolia `indexName`.
171
+
*/
172
+
objects: Array<Record<string, any>>;
173
+
}
174
+
175
+
export type ReplaceAllObjectsResponse = {
176
+
/**
177
+
* The response of the `operationIndex` request for the `copy` operation.
178
+
*/
179
+
copyOperationResponse: UpdatedAtResponse;
180
+
181
+
/**
182
+
* The response of the `batch` request(s).
183
+
*/
184
+
batchResponses: BatchResponse[];
185
+
186
+
/**
187
+
* The response of the `operationIndex` request for the `move` operation.
0 commit comments