@algolia/client-search 5.15.0 → 5.17.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 +24 -36
- package/dist/builds/browser.js +31 -23
- 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 +2 -2
- package/dist/builds/fetch.js +31 -28
- package/dist/builds/fetch.js.map +1 -1
- package/dist/builds/node.cjs +30 -19
- package/dist/builds/node.cjs.map +1 -1
- package/dist/builds/node.js +31 -28
- package/dist/builds/node.js.map +1 -1
- package/dist/fetch.d.ts +24 -36
- package/dist/node.d.cts +24 -36
- package/dist/node.d.ts +24 -36
- package/dist/src/searchClient.cjs +27 -16
- package/dist/src/searchClient.cjs.map +1 -1
- package/dist/src/searchClient.js +27 -16
- package/dist/src/searchClient.js.map +1 -1
- package/package.json +10 -9
package/README.md
CHANGED
|
@@ -41,11 +41,11 @@ All of our clients comes with type definition, and are available for both browse
|
|
|
41
41
|
### With a package manager
|
|
42
42
|
|
|
43
43
|
```bash
|
|
44
|
-
yarn add @algolia/client-search@5.
|
|
44
|
+
yarn add @algolia/client-search@5.17.0
|
|
45
45
|
# or
|
|
46
|
-
npm install @algolia/client-search@5.
|
|
46
|
+
npm install @algolia/client-search@5.17.0
|
|
47
47
|
# or
|
|
48
|
-
pnpm add @algolia/client-search@5.
|
|
48
|
+
pnpm add @algolia/client-search@5.17.0
|
|
49
49
|
```
|
|
50
50
|
|
|
51
51
|
### Without a package manager
|
|
@@ -53,7 +53,7 @@ pnpm add @algolia/client-search@5.15.0
|
|
|
53
53
|
Add the following JavaScript snippet to the <head> of your website:
|
|
54
54
|
|
|
55
55
|
```html
|
|
56
|
-
<script src="https://cdn.jsdelivr.net/npm/@algolia/client-search@5.
|
|
56
|
+
<script src="https://cdn.jsdelivr.net/npm/@algolia/client-search@5.17.0/dist/builds/browser.umd.js"></script>
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
### Usage
|
package/dist/browser.d.ts
CHANGED
|
@@ -702,7 +702,7 @@ type Log = {
|
|
|
702
702
|
/**
|
|
703
703
|
* Number of API requests.
|
|
704
704
|
*/
|
|
705
|
-
nb_api_calls
|
|
705
|
+
nb_api_calls?: string;
|
|
706
706
|
/**
|
|
707
707
|
* Processing time for the query in milliseconds. This doesn\'t include latency due to the network.
|
|
708
708
|
*/
|
|
@@ -1527,7 +1527,7 @@ type Rule = {
|
|
|
1527
1527
|
* Conditions that trigger a rule. Some consequences require specific conditions or don\'t require any condition. For more information, see [Conditions](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/#conditions).
|
|
1528
1528
|
*/
|
|
1529
1529
|
conditions?: Array<Condition>;
|
|
1530
|
-
consequence
|
|
1530
|
+
consequence: Consequence;
|
|
1531
1531
|
/**
|
|
1532
1532
|
* Description of the rule\'s purpose to help you distinguish between different rules.
|
|
1533
1533
|
*/
|
|
@@ -2050,21 +2050,6 @@ type UpdatedAtWithObjectIdResponse = {
|
|
|
2050
2050
|
objectID?: string;
|
|
2051
2051
|
};
|
|
2052
2052
|
|
|
2053
|
-
type UpdatedRuleResponse = {
|
|
2054
|
-
/**
|
|
2055
|
-
* Unique identifier of a rule object.
|
|
2056
|
-
*/
|
|
2057
|
-
objectID: string;
|
|
2058
|
-
/**
|
|
2059
|
-
* Date and time when the object was updated, in RFC 3339 format.
|
|
2060
|
-
*/
|
|
2061
|
-
updatedAt: string;
|
|
2062
|
-
/**
|
|
2063
|
-
* Unique identifier of a task. A successful API response means that a task was added to a queue. It might not run immediately. You can check the task\'s progress with the [`task` operation](#tag/Indices/operation/getTask) and this `taskID`.
|
|
2064
|
-
*/
|
|
2065
|
-
taskID: number;
|
|
2066
|
-
};
|
|
2067
|
-
|
|
2068
2053
|
type ApiKeyOperation = 'add' | 'delete' | 'update';
|
|
2069
2054
|
|
|
2070
2055
|
/**
|
|
@@ -2998,19 +2983,19 @@ type SearchClientNodeHelpers = {
|
|
|
2998
2983
|
generateSecuredApiKey: (opts: GenerateSecuredApiKeyOptions) => string;
|
|
2999
2984
|
getSecuredApiKeyRemainingValidity: (opts: GetSecuredApiKeyRemainingValidityOptions) => number;
|
|
3000
2985
|
};
|
|
3001
|
-
type DeleteObjectsOptions = Pick<ChunkedBatchOptions, 'indexName' | 'waitForTasks'> & {
|
|
2986
|
+
type DeleteObjectsOptions = Pick<ChunkedBatchOptions, 'indexName' | 'waitForTasks' | 'batchSize'> & {
|
|
3002
2987
|
/**
|
|
3003
2988
|
* The objectIDs to delete.
|
|
3004
2989
|
*/
|
|
3005
2990
|
objectIDs: string[];
|
|
3006
2991
|
};
|
|
3007
|
-
type PartialUpdateObjectsOptions = Pick<ChunkedBatchOptions, 'indexName' | 'objects' | 'waitForTasks'> & {
|
|
2992
|
+
type PartialUpdateObjectsOptions = Pick<ChunkedBatchOptions, 'indexName' | 'objects' | 'waitForTasks' | 'batchSize'> & {
|
|
3008
2993
|
/**
|
|
3009
2994
|
*To be provided if non-existing objects are passed, otherwise, the call will fail.
|
|
3010
2995
|
*/
|
|
3011
2996
|
createIfNotExists?: boolean;
|
|
3012
2997
|
};
|
|
3013
|
-
type SaveObjectsOptions = Pick<ChunkedBatchOptions, 'indexName' | 'objects' | 'waitForTasks'>;
|
|
2998
|
+
type SaveObjectsOptions = Pick<ChunkedBatchOptions, 'indexName' | 'objects' | 'waitForTasks' | 'batchSize'>;
|
|
3014
2999
|
type ChunkedBatchOptions = ReplaceAllObjectsOptions & {
|
|
3015
3000
|
/**
|
|
3016
3001
|
* The `batch` `action` to perform on the given array of `objects`, defaults to `addObject`.
|
|
@@ -3036,7 +3021,7 @@ type ReplaceAllObjectsOptions = {
|
|
|
3036
3021
|
batchSize?: number;
|
|
3037
3022
|
};
|
|
3038
3023
|
|
|
3039
|
-
declare const apiClientVersion = "5.
|
|
3024
|
+
declare const apiClientVersion = "5.17.0";
|
|
3040
3025
|
declare function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
|
|
3041
3026
|
transporter: _algolia_client_common.Transporter;
|
|
3042
3027
|
/**
|
|
@@ -3159,10 +3144,11 @@ declare function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
3159
3144
|
* @param saveObjects - The `saveObjects` object.
|
|
3160
3145
|
* @param saveObjects.indexName - The `indexName` to save `objects` in.
|
|
3161
3146
|
* @param saveObjects.objects - The array of `objects` to store in the given Algolia `indexName`.
|
|
3147
|
+
* @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.
|
|
3162
3148
|
* @param saveObjects.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.
|
|
3163
3149
|
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `batch` method and merged with the transporter requestOptions.
|
|
3164
3150
|
*/
|
|
3165
|
-
saveObjects({ indexName, objects, waitForTasks }: SaveObjectsOptions, requestOptions?: RequestOptions): Promise<BatchResponse[]>;
|
|
3151
|
+
saveObjects({ indexName, objects, waitForTasks, batchSize }: SaveObjectsOptions, requestOptions?: RequestOptions): Promise<BatchResponse[]>;
|
|
3166
3152
|
/**
|
|
3167
3153
|
* 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.
|
|
3168
3154
|
*
|
|
@@ -3170,10 +3156,11 @@ declare function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
3170
3156
|
* @param deleteObjects - The `deleteObjects` object.
|
|
3171
3157
|
* @param deleteObjects.indexName - The `indexName` to delete `objectIDs` from.
|
|
3172
3158
|
* @param deleteObjects.objectIDs - The objectIDs to delete.
|
|
3159
|
+
* @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.
|
|
3173
3160
|
* @param deleteObjects.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.
|
|
3174
3161
|
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `batch` method and merged with the transporter requestOptions.
|
|
3175
3162
|
*/
|
|
3176
|
-
deleteObjects({ indexName, objectIDs, waitForTasks }: DeleteObjectsOptions, requestOptions?: RequestOptions): Promise<BatchResponse[]>;
|
|
3163
|
+
deleteObjects({ indexName, objectIDs, waitForTasks, batchSize }: DeleteObjectsOptions, requestOptions?: RequestOptions): Promise<BatchResponse[]>;
|
|
3177
3164
|
/**
|
|
3178
3165
|
* 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.
|
|
3179
3166
|
*
|
|
@@ -3182,10 +3169,11 @@ declare function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
3182
3169
|
* @param partialUpdateObjects.indexName - The `indexName` to update `objects` in.
|
|
3183
3170
|
* @param partialUpdateObjects.objects - The array of `objects` to update in the given Algolia `indexName`.
|
|
3184
3171
|
* @param partialUpdateObjects.createIfNotExists - To be provided if non-existing objects are passed, otherwise, the call will fail..
|
|
3172
|
+
* @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.
|
|
3185
3173
|
* @param partialUpdateObjects.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.
|
|
3186
3174
|
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
|
|
3187
3175
|
*/
|
|
3188
|
-
partialUpdateObjects({ indexName, objects, createIfNotExists, waitForTasks }: PartialUpdateObjectsOptions, requestOptions?: RequestOptions): Promise<BatchResponse[]>;
|
|
3176
|
+
partialUpdateObjects({ indexName, objects, createIfNotExists, waitForTasks, batchSize }: PartialUpdateObjectsOptions, requestOptions?: RequestOptions): Promise<BatchResponse[]>;
|
|
3189
3177
|
/**
|
|
3190
3178
|
* 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.
|
|
3191
3179
|
* See https://api-clients-automation.netlify.app/docs/add-new-api-client#5-helpers for implementation details.
|
|
@@ -3231,7 +3219,7 @@ declare function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
3231
3219
|
*/
|
|
3232
3220
|
addApiKey(apiKey: ApiKey, requestOptions?: RequestOptions): Promise<AddApiKeyResponse>;
|
|
3233
3221
|
/**
|
|
3234
|
-
* 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).
|
|
3222
|
+
* If a record with the specified object ID exists, the existing record is replaced. Otherwise, a new record is added to the index. If you want to use auto-generated object IDs, use the [`saveObject` operation](#tag/Records/operation/saveObject). 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).
|
|
3235
3223
|
*
|
|
3236
3224
|
* Required API Key ACLs:
|
|
3237
3225
|
* - addObject
|
|
@@ -3263,7 +3251,7 @@ declare function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
3263
3251
|
*/
|
|
3264
3252
|
assignUserId({ xAlgoliaUserID, assignUserIdParams }: AssignUserIdProps, requestOptions?: RequestOptions): Promise<CreatedAtResponse>;
|
|
3265
3253
|
/**
|
|
3266
|
-
* 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.
|
|
3254
|
+
* 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. This operation is subject to [indexing rate limits](https://support.algolia.com/hc/en-us/articles/4406975251089-Is-there-a-rate-limit-for-indexing-on-Algolia).
|
|
3267
3255
|
* @param batch - The batch object.
|
|
3268
3256
|
* @param batch.indexName - Name of the index on which to perform the operation.
|
|
3269
3257
|
* @param batch.batchWriteParams - The batchWriteParams object.
|
|
@@ -3304,7 +3292,7 @@ declare function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
3304
3292
|
*/
|
|
3305
3293
|
browse<T>({ indexName, browseParams }: BrowseProps, requestOptions?: RequestOptions): Promise<BrowseResponse<T>>;
|
|
3306
3294
|
/**
|
|
3307
|
-
* Deletes only the records from an index while keeping settings, synonyms, and rules.
|
|
3295
|
+
* Deletes only the records from an index while keeping settings, synonyms, and rules. This operation is resource-intensive and subject to [indexing rate limits](https://support.algolia.com/hc/en-us/articles/4406975251089-Is-there-a-rate-limit-for-indexing-on-Algolia).
|
|
3308
3296
|
*
|
|
3309
3297
|
* Required API Key ACLs:
|
|
3310
3298
|
* - deleteIndex
|
|
@@ -3380,7 +3368,7 @@ declare function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
3380
3368
|
*/
|
|
3381
3369
|
deleteApiKey({ key }: DeleteApiKeyProps, requestOptions?: RequestOptions): Promise<DeleteApiKeyResponse>;
|
|
3382
3370
|
/**
|
|
3383
|
-
* This operation doesn\'t accept empty
|
|
3371
|
+
* This operation doesn\'t accept empty filters. This operation is resource-intensive. You should only use it if you can\'t get the object IDs of the records you want to delete. 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). This operation is subject to [indexing rate limits](https://support.algolia.com/hc/en-us/articles/4406975251089-Is-there-a-rate-limit-for-indexing-on-Algolia).
|
|
3384
3372
|
*
|
|
3385
3373
|
* Required API Key ACLs:
|
|
3386
3374
|
* - deleteIndex
|
|
@@ -3632,13 +3620,13 @@ declare function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
3632
3620
|
*/
|
|
3633
3621
|
listUserIds({ page, hitsPerPage }?: ListUserIdsProps, requestOptions?: RequestOptions | undefined): Promise<ListUserIdsResponse>;
|
|
3634
3622
|
/**
|
|
3635
|
-
* 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.
|
|
3623
|
+
* 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. This operation is subject to [indexing rate limits](https://support.algolia.com/hc/en-us/articles/4406975251089-Is-there-a-rate-limit-for-indexing-on-Algolia).
|
|
3636
3624
|
* @param batchParams - The batchParams object.
|
|
3637
3625
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
3638
3626
|
*/
|
|
3639
3627
|
multipleBatch(batchParams: BatchParams, requestOptions?: RequestOptions): Promise<MultipleBatchResponse>;
|
|
3640
3628
|
/**
|
|
3641
|
-
* 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 keeps its 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/).
|
|
3629
|
+
* 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. - This operation is resource-intensive. **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 keeps its 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/). This operation is subject to [indexing rate limits](https://support.algolia.com/hc/en-us/articles/4406975251089-Is-there-a-rate-limit-for-indexing-on-Algolia).
|
|
3642
3630
|
*
|
|
3643
3631
|
* Required API Key ACLs:
|
|
3644
3632
|
* - addObject
|
|
@@ -3649,7 +3637,7 @@ declare function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
3649
3637
|
*/
|
|
3650
3638
|
operationIndex({ indexName, operationIndexParams }: OperationIndexProps, requestOptions?: RequestOptions): Promise<UpdatedAtResponse>;
|
|
3651
3639
|
/**
|
|
3652
|
-
* Adds new attributes to a record, or updates 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,
|
|
3640
|
+
* Adds new attributes to a record, or updates 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, this operation replaces its first-level ancestor. To update an attribute without pushing the entire record, you can use these built-in operations. These operations can be helpful if you don\'t have access to your initial data. - Increment: increment a numeric attribute - Decrement: decrement a numeric attribute - Add: append a number or string element to an array attribute - Remove: remove all matching number or string elements from an array attribute made of numbers or strings - AddUnique: add a number or string element to an array attribute made of numbers or strings only if it\'s not already present - IncrementFrom: increment a numeric integer attribute only if the provided value matches the current value, and otherwise ignore the whole object update. For example, if you pass an IncrementFrom value of 2 for the version attribute, but the current value of the attribute is 1, the engine ignores the update. If the object doesn\'t exist, the engine only creates it if you pass an IncrementFrom value of 0. - IncrementSet: increment a numeric integer attribute only if the provided value is greater than the current value, and otherwise ignore the whole object update. For example, if you pass an IncrementSet value of 2 for the version attribute, and the current value of the attribute is 1, the engine updates the object. If the object doesn\'t exist yet, the engine only creates it if you pass an IncrementSet value greater than 0. You can specify an operation by providing an object with the attribute to update as the key and its value being an object with the following properties: - _operation: the operation to apply on the attribute - value: the right-hand side argument to the operation, for example, increment or decrement step, value to add or remove. This operation is subject to [indexing rate limits](https://support.algolia.com/hc/en-us/articles/4406975251089-Is-there-a-rate-limit-for-indexing-on-Algolia).
|
|
3653
3641
|
*
|
|
3654
3642
|
* Required API Key ACLs:
|
|
3655
3643
|
* - addObject
|
|
@@ -3692,7 +3680,7 @@ declare function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
3692
3680
|
*/
|
|
3693
3681
|
restoreApiKey({ key }: RestoreApiKeyProps, requestOptions?: RequestOptions): Promise<AddApiKeyResponse>;
|
|
3694
3682
|
/**
|
|
3695
|
-
* Adds a record to an index or
|
|
3683
|
+
* Adds a record to an index or replaces 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/partialUpdateObject). To add, update, or replace multiple records, use the [`batch` operation](#tag/Records/operation/batch). This operation is subject to [indexing rate limits](https://support.algolia.com/hc/en-us/articles/4406975251089-Is-there-a-rate-limit-for-indexing-on-Algolia).
|
|
3696
3684
|
*
|
|
3697
3685
|
* Required API Key ACLs:
|
|
3698
3686
|
* - addObject
|
|
@@ -3714,9 +3702,9 @@ declare function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
3714
3702
|
* @param saveRule.forwardToReplicas - Whether changes are applied to replica indices.
|
|
3715
3703
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
3716
3704
|
*/
|
|
3717
|
-
saveRule({ indexName, objectID, rule, forwardToReplicas }: SaveRuleProps, requestOptions?: RequestOptions): Promise<
|
|
3705
|
+
saveRule({ indexName, objectID, rule, forwardToReplicas }: SaveRuleProps, requestOptions?: RequestOptions): Promise<UpdatedAtResponse>;
|
|
3718
3706
|
/**
|
|
3719
|
-
* 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.
|
|
3707
|
+
* 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. This operation is subject to [indexing rate limits](https://support.algolia.com/hc/en-us/articles/4406975251089-Is-there-a-rate-limit-for-indexing-on-Algolia).
|
|
3720
3708
|
*
|
|
3721
3709
|
* Required API Key ACLs:
|
|
3722
3710
|
* - editSettings
|
|
@@ -3742,7 +3730,7 @@ declare function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
3742
3730
|
*/
|
|
3743
3731
|
saveSynonym({ indexName, objectID, synonymHit, forwardToReplicas }: SaveSynonymProps, requestOptions?: RequestOptions): Promise<SaveSynonymResponse>;
|
|
3744
3732
|
/**
|
|
3745
|
-
* If a synonym with the `objectID` doesn\'t exist, Algolia adds a new one. Otherwise, existing synonyms are replaced.
|
|
3733
|
+
* If a synonym with the `objectID` doesn\'t exist, Algolia adds a new one. Otherwise, existing synonyms are replaced. This operation is subject to [indexing rate limits](https://support.algolia.com/hc/en-us/articles/4406975251089-Is-there-a-rate-limit-for-indexing-on-Algolia).
|
|
3746
3734
|
*
|
|
3747
3735
|
* Required API Key ACLs:
|
|
3748
3736
|
* - editSettings
|
|
@@ -3889,4 +3877,4 @@ type ErrorBase = Record<string, any> & {
|
|
|
3889
3877
|
declare function searchClient(appId: string, apiKey: string, options?: ClientOptions): SearchClient;
|
|
3890
3878
|
type SearchClient = ReturnType<typeof createSearchClient>;
|
|
3891
3879
|
|
|
3892
|
-
export { type Acl, type Action, type AddApiKeyResponse, type AddOrUpdateObjectProps, type AdvancedSyntaxFeatures, type AlternativesAsExact, type Anchoring, type ApiKey, type ApiKeyOperation, type AroundPrecision, type AroundRadius, type AroundRadiusAll, type AssignUserIdParams, type AssignUserIdProps, type AttributeToUpdate, type AutomaticFacetFilter, type AutomaticFacetFilters, type Banner, type BannerImage, type BannerImageUrl, type BannerLink, type BaseGetApiKeyResponse, type BaseIndexSettings, type BaseSearchParams, type BaseSearchParamsWithoutQuery, type BaseSearchResponse, type BatchAssignUserIdsParams, type BatchAssignUserIdsProps, type BatchDictionaryEntriesParams, type BatchDictionaryEntriesProps, type BatchDictionaryEntriesRequest, type BatchParams, type BatchProps, type BatchRequest, type BatchResponse, type BatchWriteParams, type BooleanString, type BrowseOptions, type BrowsePagination, type BrowseParams, type BrowseParamsObject, type BrowseProps, type BrowseResponse, type BuiltInOperation, type BuiltInOperationType, type BuiltInOperationValue, type ChunkedBatchOptions, type ClearObjectsProps, type ClearRulesProps, type ClearSynonymsProps, type Condition, type Consequence, type ConsequenceHide, type ConsequenceParams, type ConsequenceQuery, type ConsequenceQueryObject, type CreatedAtResponse, type Cursor, type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type DeleteApiKeyProps, type DeleteApiKeyResponse, type DeleteByParams, type DeleteByProps, type DeleteIndexProps, type DeleteObjectProps, type DeleteObjectsOptions, type DeleteRuleProps, type DeleteSourceProps, type DeleteSourceResponse, type DeleteSynonymProps, type DeletedAtResponse, type DictionaryAction, type DictionaryEntry, type DictionaryEntryState, type DictionaryEntryType, type DictionaryLanguage, type DictionarySettingsParams, type DictionaryType, type Distinct, type Edit, type EditType, type ErrorBase, type ExactOnSingleWordQuery, type Exhaustive, type FacetFilters, type FacetHits, type FacetOrdering, type FacetStats, type Facets, type FetchedIndex, type GenerateSecuredApiKeyOptions, type GetApiKeyProps, type GetApiKeyResponse, type GetAppTaskProps, type GetDictionarySettingsResponse, type GetLogsProps, type GetLogsResponse, type GetObjectProps, type GetObjectsParams, type GetObjectsRequest, type GetObjectsResponse, type GetRuleProps, type GetSecuredApiKeyRemainingValidityOptions, type GetSettingsProps, type GetSynonymProps, type GetTaskProps, type GetTaskResponse, type GetTopUserIdsResponse, type GetUserIdProps, type HasPendingMappingsProps, type HasPendingMappingsResponse, type HighlightResult, type HighlightResultOption, type Hit, type IgnorePlurals, type IndexSettings, type IndexSettingsAsSearchParams, type InsideBoundingBox, type Languages, type LegacySearchMethodProps, type ListApiKeysResponse, type ListClustersResponse, type ListIndicesProps, type ListIndicesResponse, type ListUserIdsProps, type ListUserIdsResponse, type Log, type LogQuery, type LogType, type MatchLevel, type MatchedGeoLocation, type Mode, type MultipleBatchRequest, type MultipleBatchResponse, type NumericFilters, type OperationIndexParams, type OperationIndexProps, type OperationType, type OptionalFilters, type OptionalWords, type Params, type PartialUpdateObjectProps, type PartialUpdateObjectsOptions, type Personalization, type Promote, type PromoteObjectID, type PromoteObjectIDs, type QueryType, type Range, type RankingInfo, type ReRankingApplyFilter, type Redirect, type RedirectRuleIndexData, type RedirectRuleIndexMetadata, type RedirectURL, type RemoveStopWords, type RemoveUserIdProps, type RemoveUserIdResponse, type RemoveWordsIfNoResults, type RenderingContent, type ReplaceAllObjectsOptions, type ReplaceAllObjectsResponse, type ReplaceSourceResponse, type ReplaceSourcesProps, type RestoreApiKeyProps, type Rule, type SaveObjectProps, type SaveObjectResponse, type SaveObjectsOptions, type SaveRuleProps, type SaveRulesProps, type SaveSynonymProps, type SaveSynonymResponse, type SaveSynonymsProps, type ScopeType, type SearchClient, type SearchClientNodeHelpers, type SearchDictionaryEntriesParams, type SearchDictionaryEntriesProps, type SearchDictionaryEntriesResponse, type SearchForFacetValuesProps, type SearchForFacetValuesRequest, type SearchForFacetValuesResponse, type SearchForFacets, type SearchForFacetsOptions, type SearchForHits, type SearchForHitsOptions, type SearchHits, type SearchMethodParams, type SearchPagination, type SearchParams, type SearchParamsObject, type SearchParamsQuery, type SearchParamsString, type SearchQuery, type SearchResponse, type SearchResponses, type SearchResult, type SearchRulesParams, type SearchRulesProps, type SearchRulesResponse, type SearchSingleIndexProps, type SearchStrategy, type SearchSynonymsParams, type SearchSynonymsProps, type SearchSynonymsResponse, type SearchTypeDefault, type SearchTypeFacet, type SearchUserIdsParams, type SearchUserIdsResponse, type SecuredApiKeyRestrictions, type SemanticSearch, type SetSettingsProps, type SettingsResponse, type SnippetResult, type SnippetResultOption, type SortRemainingBy, type Source, type StandardEntries, type SupportedLanguage, type SynonymHit, type SynonymType, type TagFilters, type TaskStatus, type TimeRange, type TypoTolerance, type TypoToleranceEnum, type UpdateApiKeyProps, type UpdateApiKeyResponse, type UpdatedAtResponse, type UpdatedAtWithObjectIdResponse, type
|
|
3880
|
+
export { type Acl, type Action, type AddApiKeyResponse, type AddOrUpdateObjectProps, type AdvancedSyntaxFeatures, type AlternativesAsExact, type Anchoring, type ApiKey, type ApiKeyOperation, type AroundPrecision, type AroundRadius, type AroundRadiusAll, type AssignUserIdParams, type AssignUserIdProps, type AttributeToUpdate, type AutomaticFacetFilter, type AutomaticFacetFilters, type Banner, type BannerImage, type BannerImageUrl, type BannerLink, type BaseGetApiKeyResponse, type BaseIndexSettings, type BaseSearchParams, type BaseSearchParamsWithoutQuery, type BaseSearchResponse, type BatchAssignUserIdsParams, type BatchAssignUserIdsProps, type BatchDictionaryEntriesParams, type BatchDictionaryEntriesProps, type BatchDictionaryEntriesRequest, type BatchParams, type BatchProps, type BatchRequest, type BatchResponse, type BatchWriteParams, type BooleanString, type BrowseOptions, type BrowsePagination, type BrowseParams, type BrowseParamsObject, type BrowseProps, type BrowseResponse, type BuiltInOperation, type BuiltInOperationType, type BuiltInOperationValue, type ChunkedBatchOptions, type ClearObjectsProps, type ClearRulesProps, type ClearSynonymsProps, type Condition, type Consequence, type ConsequenceHide, type ConsequenceParams, type ConsequenceQuery, type ConsequenceQueryObject, type CreatedAtResponse, type Cursor, type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type DeleteApiKeyProps, type DeleteApiKeyResponse, type DeleteByParams, type DeleteByProps, type DeleteIndexProps, type DeleteObjectProps, type DeleteObjectsOptions, type DeleteRuleProps, type DeleteSourceProps, type DeleteSourceResponse, type DeleteSynonymProps, type DeletedAtResponse, type DictionaryAction, type DictionaryEntry, type DictionaryEntryState, type DictionaryEntryType, type DictionaryLanguage, type DictionarySettingsParams, type DictionaryType, type Distinct, type Edit, type EditType, type ErrorBase, type ExactOnSingleWordQuery, type Exhaustive, type FacetFilters, type FacetHits, type FacetOrdering, type FacetStats, type Facets, type FetchedIndex, type GenerateSecuredApiKeyOptions, type GetApiKeyProps, type GetApiKeyResponse, type GetAppTaskProps, type GetDictionarySettingsResponse, type GetLogsProps, type GetLogsResponse, type GetObjectProps, type GetObjectsParams, type GetObjectsRequest, type GetObjectsResponse, type GetRuleProps, type GetSecuredApiKeyRemainingValidityOptions, type GetSettingsProps, type GetSynonymProps, type GetTaskProps, type GetTaskResponse, type GetTopUserIdsResponse, type GetUserIdProps, type HasPendingMappingsProps, type HasPendingMappingsResponse, type HighlightResult, type HighlightResultOption, type Hit, type IgnorePlurals, type IndexSettings, type IndexSettingsAsSearchParams, type InsideBoundingBox, type Languages, type LegacySearchMethodProps, type ListApiKeysResponse, type ListClustersResponse, type ListIndicesProps, type ListIndicesResponse, type ListUserIdsProps, type ListUserIdsResponse, type Log, type LogQuery, type LogType, type MatchLevel, type MatchedGeoLocation, type Mode, type MultipleBatchRequest, type MultipleBatchResponse, type NumericFilters, type OperationIndexParams, type OperationIndexProps, type OperationType, type OptionalFilters, type OptionalWords, type Params, type PartialUpdateObjectProps, type PartialUpdateObjectsOptions, type Personalization, type Promote, type PromoteObjectID, type PromoteObjectIDs, type QueryType, type Range, type RankingInfo, type ReRankingApplyFilter, type Redirect, type RedirectRuleIndexData, type RedirectRuleIndexMetadata, type RedirectURL, type RemoveStopWords, type RemoveUserIdProps, type RemoveUserIdResponse, type RemoveWordsIfNoResults, type RenderingContent, type ReplaceAllObjectsOptions, type ReplaceAllObjectsResponse, type ReplaceSourceResponse, type ReplaceSourcesProps, type RestoreApiKeyProps, type Rule, type SaveObjectProps, type SaveObjectResponse, type SaveObjectsOptions, type SaveRuleProps, type SaveRulesProps, type SaveSynonymProps, type SaveSynonymResponse, type SaveSynonymsProps, type ScopeType, type SearchClient, type SearchClientNodeHelpers, type SearchDictionaryEntriesParams, type SearchDictionaryEntriesProps, type SearchDictionaryEntriesResponse, type SearchForFacetValuesProps, type SearchForFacetValuesRequest, type SearchForFacetValuesResponse, type SearchForFacets, type SearchForFacetsOptions, type SearchForHits, type SearchForHitsOptions, type SearchHits, type SearchMethodParams, type SearchPagination, type SearchParams, type SearchParamsObject, type SearchParamsQuery, type SearchParamsString, type SearchQuery, type SearchResponse, type SearchResponses, type SearchResult, type SearchRulesParams, type SearchRulesProps, type SearchRulesResponse, type SearchSingleIndexProps, type SearchStrategy, type SearchSynonymsParams, type SearchSynonymsProps, type SearchSynonymsResponse, type SearchTypeDefault, type SearchTypeFacet, type SearchUserIdsParams, type SearchUserIdsResponse, type SecuredApiKeyRestrictions, type SemanticSearch, type SetSettingsProps, type SettingsResponse, type SnippetResult, type SnippetResultOption, type SortRemainingBy, type Source, type StandardEntries, type SupportedLanguage, type SynonymHit, type SynonymType, type TagFilters, type TaskStatus, type TimeRange, type TypoTolerance, type TypoToleranceEnum, type UpdateApiKeyProps, type UpdateApiKeyResponse, type UpdatedAtResponse, type UpdatedAtWithObjectIdResponse, type UserHighlightResult, type UserHit, type UserId, type Value, type WaitForApiKeyOptions, type WaitForAppTaskOptions, type WaitForTaskOptions, type Widgets, type WithPrimary, apiClientVersion, searchClient };
|
package/dist/builds/browser.js
CHANGED
|
@@ -4,10 +4,7 @@ import {
|
|
|
4
4
|
createBrowserLocalStorageCache,
|
|
5
5
|
createFallbackableCache,
|
|
6
6
|
createMemoryCache,
|
|
7
|
-
createNullLogger
|
|
8
|
-
DEFAULT_CONNECT_TIMEOUT_BROWSER,
|
|
9
|
-
DEFAULT_READ_TIMEOUT_BROWSER,
|
|
10
|
-
DEFAULT_WRITE_TIMEOUT_BROWSER
|
|
7
|
+
createNullLogger
|
|
11
8
|
} from "@algolia/client-common";
|
|
12
9
|
|
|
13
10
|
// src/searchClient.ts
|
|
@@ -19,7 +16,7 @@ import {
|
|
|
19
16
|
getAlgoliaAgent,
|
|
20
17
|
shuffle
|
|
21
18
|
} from "@algolia/client-common";
|
|
22
|
-
var apiClientVersion = "5.
|
|
19
|
+
var apiClientVersion = "5.17.0";
|
|
23
20
|
function getDefaultHosts(appId) {
|
|
24
21
|
return [
|
|
25
22
|
{
|
|
@@ -376,11 +373,15 @@ function createSearchClient({
|
|
|
376
373
|
* @param saveObjects - The `saveObjects` object.
|
|
377
374
|
* @param saveObjects.indexName - The `indexName` to save `objects` in.
|
|
378
375
|
* @param saveObjects.objects - The array of `objects` to store in the given Algolia `indexName`.
|
|
376
|
+
* @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.
|
|
379
377
|
* @param saveObjects.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.
|
|
380
378
|
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `batch` method and merged with the transporter requestOptions.
|
|
381
379
|
*/
|
|
382
|
-
async saveObjects({ indexName, objects, waitForTasks }, requestOptions) {
|
|
383
|
-
return await this.chunkedBatch(
|
|
380
|
+
async saveObjects({ indexName, objects, waitForTasks, batchSize }, requestOptions) {
|
|
381
|
+
return await this.chunkedBatch(
|
|
382
|
+
{ indexName, objects, action: "addObject", waitForTasks, batchSize },
|
|
383
|
+
requestOptions
|
|
384
|
+
);
|
|
384
385
|
},
|
|
385
386
|
/**
|
|
386
387
|
* 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.
|
|
@@ -389,16 +390,18 @@ function createSearchClient({
|
|
|
389
390
|
* @param deleteObjects - The `deleteObjects` object.
|
|
390
391
|
* @param deleteObjects.indexName - The `indexName` to delete `objectIDs` from.
|
|
391
392
|
* @param deleteObjects.objectIDs - The objectIDs to delete.
|
|
393
|
+
* @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.
|
|
392
394
|
* @param deleteObjects.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.
|
|
393
395
|
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `batch` method and merged with the transporter requestOptions.
|
|
394
396
|
*/
|
|
395
|
-
async deleteObjects({ indexName, objectIDs, waitForTasks }, requestOptions) {
|
|
397
|
+
async deleteObjects({ indexName, objectIDs, waitForTasks, batchSize }, requestOptions) {
|
|
396
398
|
return await this.chunkedBatch(
|
|
397
399
|
{
|
|
398
400
|
indexName,
|
|
399
401
|
objects: objectIDs.map((objectID) => ({ objectID })),
|
|
400
402
|
action: "deleteObject",
|
|
401
|
-
waitForTasks
|
|
403
|
+
waitForTasks,
|
|
404
|
+
batchSize
|
|
402
405
|
},
|
|
403
406
|
requestOptions
|
|
404
407
|
);
|
|
@@ -411,15 +414,17 @@ function createSearchClient({
|
|
|
411
414
|
* @param partialUpdateObjects.indexName - The `indexName` to update `objects` in.
|
|
412
415
|
* @param partialUpdateObjects.objects - The array of `objects` to update in the given Algolia `indexName`.
|
|
413
416
|
* @param partialUpdateObjects.createIfNotExists - To be provided if non-existing objects are passed, otherwise, the call will fail..
|
|
417
|
+
* @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.
|
|
414
418
|
* @param partialUpdateObjects.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.
|
|
415
419
|
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
|
|
416
420
|
*/
|
|
417
|
-
async partialUpdateObjects({ indexName, objects, createIfNotExists, waitForTasks }, requestOptions) {
|
|
421
|
+
async partialUpdateObjects({ indexName, objects, createIfNotExists, waitForTasks, batchSize }, requestOptions) {
|
|
418
422
|
return await this.chunkedBatch(
|
|
419
423
|
{
|
|
420
424
|
indexName,
|
|
421
425
|
objects,
|
|
422
426
|
action: createIfNotExists ? "partialUpdateObject" : "partialUpdateObjectNoCreate",
|
|
427
|
+
batchSize,
|
|
423
428
|
waitForTasks
|
|
424
429
|
},
|
|
425
430
|
requestOptions
|
|
@@ -547,7 +552,7 @@ function createSearchClient({
|
|
|
547
552
|
return transporter.request(request, requestOptions);
|
|
548
553
|
},
|
|
549
554
|
/**
|
|
550
|
-
* 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).
|
|
555
|
+
* If a record with the specified object ID exists, the existing record is replaced. Otherwise, a new record is added to the index. If you want to use auto-generated object IDs, use the [`saveObject` operation](#tag/Records/operation/saveObject). 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).
|
|
551
556
|
*
|
|
552
557
|
* Required API Key ACLs:
|
|
553
558
|
* - addObject
|
|
@@ -642,7 +647,7 @@ function createSearchClient({
|
|
|
642
647
|
return transporter.request(request, requestOptions);
|
|
643
648
|
},
|
|
644
649
|
/**
|
|
645
|
-
* 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.
|
|
650
|
+
* 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. This operation is subject to [indexing rate limits](https://support.algolia.com/hc/en-us/articles/4406975251089-Is-there-a-rate-limit-for-indexing-on-Algolia).
|
|
646
651
|
* @param batch - The batch object.
|
|
647
652
|
* @param batch.indexName - Name of the index on which to perform the operation.
|
|
648
653
|
* @param batch.batchWriteParams - The batchWriteParams object.
|
|
@@ -773,7 +778,7 @@ function createSearchClient({
|
|
|
773
778
|
return transporter.request(request, requestOptions);
|
|
774
779
|
},
|
|
775
780
|
/**
|
|
776
|
-
* Deletes only the records from an index while keeping settings, synonyms, and rules.
|
|
781
|
+
* Deletes only the records from an index while keeping settings, synonyms, and rules. This operation is resource-intensive and subject to [indexing rate limits](https://support.algolia.com/hc/en-us/articles/4406975251089-Is-there-a-rate-limit-for-indexing-on-Algolia).
|
|
777
782
|
*
|
|
778
783
|
* Required API Key ACLs:
|
|
779
784
|
* - deleteIndex
|
|
@@ -969,7 +974,7 @@ function createSearchClient({
|
|
|
969
974
|
return transporter.request(request, requestOptions);
|
|
970
975
|
},
|
|
971
976
|
/**
|
|
972
|
-
* This operation doesn\'t accept empty
|
|
977
|
+
* This operation doesn\'t accept empty filters. This operation is resource-intensive. You should only use it if you can\'t get the object IDs of the records you want to delete. 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). This operation is subject to [indexing rate limits](https://support.algolia.com/hc/en-us/articles/4406975251089-Is-there-a-rate-limit-for-indexing-on-Algolia).
|
|
973
978
|
*
|
|
974
979
|
* Required API Key ACLs:
|
|
975
980
|
* - deleteIndex
|
|
@@ -1606,7 +1611,7 @@ function createSearchClient({
|
|
|
1606
1611
|
return transporter.request(request, requestOptions);
|
|
1607
1612
|
},
|
|
1608
1613
|
/**
|
|
1609
|
-
* 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.
|
|
1614
|
+
* 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. This operation is subject to [indexing rate limits](https://support.algolia.com/hc/en-us/articles/4406975251089-Is-there-a-rate-limit-for-indexing-on-Algolia).
|
|
1610
1615
|
* @param batchParams - The batchParams object.
|
|
1611
1616
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1612
1617
|
*/
|
|
@@ -1630,7 +1635,7 @@ function createSearchClient({
|
|
|
1630
1635
|
return transporter.request(request, requestOptions);
|
|
1631
1636
|
},
|
|
1632
1637
|
/**
|
|
1633
|
-
* 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 keeps its 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/).
|
|
1638
|
+
* 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. - This operation is resource-intensive. **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 keeps its 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/). This operation is subject to [indexing rate limits](https://support.algolia.com/hc/en-us/articles/4406975251089-Is-there-a-rate-limit-for-indexing-on-Algolia).
|
|
1634
1639
|
*
|
|
1635
1640
|
* Required API Key ACLs:
|
|
1636
1641
|
* - addObject
|
|
@@ -1665,7 +1670,7 @@ function createSearchClient({
|
|
|
1665
1670
|
return transporter.request(request, requestOptions);
|
|
1666
1671
|
},
|
|
1667
1672
|
/**
|
|
1668
|
-
* Adds new attributes to a record, or updates 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,
|
|
1673
|
+
* Adds new attributes to a record, or updates 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, this operation replaces its first-level ancestor. To update an attribute without pushing the entire record, you can use these built-in operations. These operations can be helpful if you don\'t have access to your initial data. - Increment: increment a numeric attribute - Decrement: decrement a numeric attribute - Add: append a number or string element to an array attribute - Remove: remove all matching number or string elements from an array attribute made of numbers or strings - AddUnique: add a number or string element to an array attribute made of numbers or strings only if it\'s not already present - IncrementFrom: increment a numeric integer attribute only if the provided value matches the current value, and otherwise ignore the whole object update. For example, if you pass an IncrementFrom value of 2 for the version attribute, but the current value of the attribute is 1, the engine ignores the update. If the object doesn\'t exist, the engine only creates it if you pass an IncrementFrom value of 0. - IncrementSet: increment a numeric integer attribute only if the provided value is greater than the current value, and otherwise ignore the whole object update. For example, if you pass an IncrementSet value of 2 for the version attribute, and the current value of the attribute is 1, the engine updates the object. If the object doesn\'t exist yet, the engine only creates it if you pass an IncrementSet value greater than 0. You can specify an operation by providing an object with the attribute to update as the key and its value being an object with the following properties: - _operation: the operation to apply on the attribute - value: the right-hand side argument to the operation, for example, increment or decrement step, value to add or remove. This operation is subject to [indexing rate limits](https://support.algolia.com/hc/en-us/articles/4406975251089-Is-there-a-rate-limit-for-indexing-on-Algolia).
|
|
1669
1674
|
*
|
|
1670
1675
|
* Required API Key ACLs:
|
|
1671
1676
|
* - addObject
|
|
@@ -1775,7 +1780,7 @@ function createSearchClient({
|
|
|
1775
1780
|
return transporter.request(request, requestOptions);
|
|
1776
1781
|
},
|
|
1777
1782
|
/**
|
|
1778
|
-
* Adds a record to an index or
|
|
1783
|
+
* Adds a record to an index or replaces 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/partialUpdateObject). To add, update, or replace multiple records, use the [`batch` operation](#tag/Records/operation/batch). This operation is subject to [indexing rate limits](https://support.algolia.com/hc/en-us/articles/4406975251089-Is-there-a-rate-limit-for-indexing-on-Algolia).
|
|
1779
1784
|
*
|
|
1780
1785
|
* Required API Key ACLs:
|
|
1781
1786
|
* - addObject
|
|
@@ -1828,6 +1833,9 @@ function createSearchClient({
|
|
|
1828
1833
|
if (!rule.objectID) {
|
|
1829
1834
|
throw new Error("Parameter `rule.objectID` is required when calling `saveRule`.");
|
|
1830
1835
|
}
|
|
1836
|
+
if (!rule.consequence) {
|
|
1837
|
+
throw new Error("Parameter `rule.consequence` is required when calling `saveRule`.");
|
|
1838
|
+
}
|
|
1831
1839
|
const requestPath = "/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}", encodeURIComponent(indexName)).replace("{objectID}", encodeURIComponent(objectID));
|
|
1832
1840
|
const headers = {};
|
|
1833
1841
|
const queryParameters = {};
|
|
@@ -1844,7 +1852,7 @@ function createSearchClient({
|
|
|
1844
1852
|
return transporter.request(request, requestOptions);
|
|
1845
1853
|
},
|
|
1846
1854
|
/**
|
|
1847
|
-
* 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.
|
|
1855
|
+
* 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. This operation is subject to [indexing rate limits](https://support.algolia.com/hc/en-us/articles/4406975251089-Is-there-a-rate-limit-for-indexing-on-Algolia).
|
|
1848
1856
|
*
|
|
1849
1857
|
* Required API Key ACLs:
|
|
1850
1858
|
* - editSettings
|
|
@@ -1924,7 +1932,7 @@ function createSearchClient({
|
|
|
1924
1932
|
return transporter.request(request, requestOptions);
|
|
1925
1933
|
},
|
|
1926
1934
|
/**
|
|
1927
|
-
* If a synonym with the `objectID` doesn\'t exist, Algolia adds a new one. Otherwise, existing synonyms are replaced.
|
|
1935
|
+
* If a synonym with the `objectID` doesn\'t exist, Algolia adds a new one. Otherwise, existing synonyms are replaced. This operation is subject to [indexing rate limits](https://support.algolia.com/hc/en-us/articles/4406975251089-Is-there-a-rate-limit-for-indexing-on-Algolia).
|
|
1928
1936
|
*
|
|
1929
1937
|
* Required API Key ACLs:
|
|
1930
1938
|
* - editSettings
|
|
@@ -2308,9 +2316,9 @@ function searchClient(appId, apiKey, options) {
|
|
|
2308
2316
|
appId,
|
|
2309
2317
|
apiKey,
|
|
2310
2318
|
timeouts: {
|
|
2311
|
-
connect:
|
|
2312
|
-
read:
|
|
2313
|
-
write:
|
|
2319
|
+
connect: 1e3,
|
|
2320
|
+
read: 2e3,
|
|
2321
|
+
write: 3e4
|
|
2314
2322
|
},
|
|
2315
2323
|
logger: createNullLogger(),
|
|
2316
2324
|
requester: createXhrRequester(),
|