@algolia/client-search 5.34.1 → 5.36.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.
- package/README.md +4 -4
- package/dist/browser.d.ts +33 -29
- package/dist/builds/browser.js +2 -2
- package/dist/builds/browser.js.map +1 -1
- package/dist/builds/browser.min.js +1 -1
- package/dist/builds/browser.min.js.map +1 -1
- package/dist/builds/browser.umd.js +1 -1
- package/dist/builds/fetch.js +13 -5
- package/dist/builds/fetch.js.map +1 -1
- package/dist/builds/node.cjs +13 -5
- package/dist/builds/node.cjs.map +1 -1
- package/dist/builds/node.js +13 -5
- package/dist/builds/node.js.map +1 -1
- package/dist/builds/worker.js +2 -2
- package/dist/builds/worker.js.map +1 -1
- package/dist/fetch.d.ts +33 -29
- package/dist/node.d.cts +33 -29
- package/dist/node.d.ts +33 -29
- package/dist/src/searchClient.cjs +2 -2
- package/dist/src/searchClient.cjs.map +1 -1
- package/dist/src/searchClient.js +5 -2
- package/dist/src/searchClient.js.map +1 -1
- package/dist/worker.d.ts +33 -29
- package/package.json +7 -7
package/dist/builds/node.js
CHANGED
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
getAlgoliaAgent,
|
|
21
21
|
shuffle
|
|
22
22
|
} from "@algolia/client-common";
|
|
23
|
-
var apiClientVersion = "5.
|
|
23
|
+
var apiClientVersion = "5.36.0";
|
|
24
24
|
function getDefaultHosts(appId) {
|
|
25
25
|
return [
|
|
26
26
|
{
|
|
@@ -440,7 +440,7 @@ function createSearchClient({
|
|
|
440
440
|
},
|
|
441
441
|
/**
|
|
442
442
|
* 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.
|
|
443
|
-
* See https://api-clients-automation.netlify.app/docs/
|
|
443
|
+
* See https://api-clients-automation.netlify.app/docs/custom-helpers/#replaceallobjects for implementation details.
|
|
444
444
|
*
|
|
445
445
|
* @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.
|
|
446
446
|
* @param replaceAllObjects - The `replaceAllObjects` object.
|
|
@@ -2395,7 +2395,7 @@ function searchClient(appId, apiKey, options) {
|
|
|
2395
2395
|
},
|
|
2396
2396
|
/**
|
|
2397
2397
|
* Helper: Copies the given `sourceIndexName` records, rules and synonyms to an other Algolia application for the given `destinationIndexName`.
|
|
2398
|
-
* See https://api-clients-automation.netlify.app/docs/
|
|
2398
|
+
* See https://api-clients-automation.netlify.app/docs/custom-helpers/#replaceallobjects for implementation details.
|
|
2399
2399
|
*
|
|
2400
2400
|
* @summary Helper: Copies the given `sourceIndexName` records, rules and synonyms to an other Algolia application for the given `destinationIndexName`.
|
|
2401
2401
|
* @param accountCopyIndex - The `accountCopyIndex` object.
|
|
@@ -2403,9 +2403,16 @@ function searchClient(appId, apiKey, options) {
|
|
|
2403
2403
|
* @param accountCopyIndex.destinationAppID - The application ID to write the index to.
|
|
2404
2404
|
* @param accountCopyIndex.destinationApiKey - The API Key of the `destinationAppID` to write the index to, must have write ACLs.
|
|
2405
2405
|
* @param accountCopyIndex.destinationIndexName - The name of the index to write the copied index to.
|
|
2406
|
+
* @param accountCopyIndex.batchSize - The size of the chunk of `objects`. Defaults to 1000.
|
|
2406
2407
|
* @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.
|
|
2407
2408
|
*/
|
|
2408
|
-
async accountCopyIndex({
|
|
2409
|
+
async accountCopyIndex({
|
|
2410
|
+
sourceIndexName,
|
|
2411
|
+
destinationAppID,
|
|
2412
|
+
destinationApiKey,
|
|
2413
|
+
destinationIndexName,
|
|
2414
|
+
batchSize
|
|
2415
|
+
}, requestOptions) {
|
|
2409
2416
|
const responses = [];
|
|
2410
2417
|
if (this.appId === destinationAppID) {
|
|
2411
2418
|
throw new IndicesInSameAppError();
|
|
@@ -2465,10 +2472,11 @@ function searchClient(appId, apiKey, options) {
|
|
|
2465
2472
|
});
|
|
2466
2473
|
await this.browseObjects({
|
|
2467
2474
|
indexName: sourceIndexName,
|
|
2475
|
+
browseParams: batchSize ? { hitsPerPage: batchSize } : void 0,
|
|
2468
2476
|
async aggregator(response) {
|
|
2469
2477
|
responses.push(
|
|
2470
2478
|
...await destinationClient.saveObjects(
|
|
2471
|
-
{ indexName: destinationIndexName, objects: response.hits },
|
|
2479
|
+
{ indexName: destinationIndexName, objects: response.hits, batchSize },
|
|
2472
2480
|
requestOptions
|
|
2473
2481
|
)
|
|
2474
2482
|
);
|