@algolia/client-search 5.34.0 → 5.35.0

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.
@@ -30,7 +30,7 @@ var import_client_common2 = require("@algolia/client-common");
30
30
 
31
31
  // src/searchClient.ts
32
32
  var import_client_common = require("@algolia/client-common");
33
- var apiClientVersion = "5.34.0";
33
+ var apiClientVersion = "5.35.0";
34
34
  function getDefaultHosts(appId) {
35
35
  return [
36
36
  {
@@ -2413,9 +2413,16 @@ function searchClient(appId, apiKey, options) {
2413
2413
  * @param accountCopyIndex.destinationAppID - The application ID to write the index to.
2414
2414
  * @param accountCopyIndex.destinationApiKey - The API Key of the `destinationAppID` to write the index to, must have write ACLs.
2415
2415
  * @param accountCopyIndex.destinationIndexName - The name of the index to write the copied index to.
2416
+ * @param accountCopyIndex.batchSize - The size of the chunk of `objects`. Defaults to 1000.
2416
2417
  * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `setSettings`, `saveRules`, `saveSynonyms` and `saveObjects` method and merged with the transporter requestOptions.
2417
2418
  */
2418
- async accountCopyIndex({ sourceIndexName, destinationAppID, destinationApiKey, destinationIndexName }, requestOptions) {
2419
+ async accountCopyIndex({
2420
+ sourceIndexName,
2421
+ destinationAppID,
2422
+ destinationApiKey,
2423
+ destinationIndexName,
2424
+ batchSize
2425
+ }, requestOptions) {
2419
2426
  const responses = [];
2420
2427
  if (this.appId === destinationAppID) {
2421
2428
  throw new import_client_common2.IndicesInSameAppError();
@@ -2475,10 +2482,11 @@ function searchClient(appId, apiKey, options) {
2475
2482
  });
2476
2483
  await this.browseObjects({
2477
2484
  indexName: sourceIndexName,
2485
+ browseParams: batchSize ? { hitsPerPage: batchSize } : void 0,
2478
2486
  async aggregator(response) {
2479
2487
  responses.push(
2480
2488
  ...await destinationClient.saveObjects(
2481
- { indexName: destinationIndexName, objects: response.hits },
2489
+ { indexName: destinationIndexName, objects: response.hits, batchSize },
2482
2490
  requestOptions
2483
2491
  )
2484
2492
  );