From 7c0cbb72ef3965283e601f33e5c6b02152f67d56 Mon Sep 17 00:00:00 2001 From: Kai Welke Date: Tue, 19 Nov 2024 18:02:10 +0100 Subject: [PATCH 1/4] fix(specs): add rate limiting info to API methods --- specs/search/paths/manage_indices/operationIndex.yml | 2 ++ specs/search/paths/objects/batch.yml | 2 ++ specs/search/paths/objects/clearObjects.yml | 4 +++- specs/search/paths/objects/deleteBy.yml | 11 +++++++++-- specs/search/paths/objects/multipleBatch.yml | 2 ++ specs/search/paths/objects/objects.yml | 3 ++- specs/search/paths/objects/partialUpdate.yml | 7 +++++-- specs/search/paths/rules/saveRules.yml | 2 ++ specs/search/paths/synonyms/saveSynonyms.yml | 2 ++ 9 files changed, 29 insertions(+), 6 deletions(-) diff --git a/specs/search/paths/manage_indices/operationIndex.yml b/specs/search/paths/manage_indices/operationIndex.yml index 9ff2c29dfb..ff2ed69af3 100644 --- a/specs/search/paths/manage_indices/operationIndex.yml +++ b/specs/search/paths/manage_indices/operationIndex.yml @@ -10,6 +10,7 @@ post: - 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** @@ -28,6 +29,7 @@ post: - 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). parameters: - $ref: '../../../common/parameters.yml#/IndexName' requestBody: diff --git a/specs/search/paths/objects/batch.yml b/specs/search/paths/objects/batch.yml index adc6cbbdcc..2b28b26d17 100644 --- a/specs/search/paths/objects/batch.yml +++ b/specs/search/paths/objects/batch.yml @@ -10,6 +10,8 @@ post: - 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). parameters: - $ref: '../../../common/parameters.yml#/IndexName' x-codegen-request-body-name: batchWriteParams diff --git a/specs/search/paths/objects/clearObjects.yml b/specs/search/paths/objects/clearObjects.yml index e184b0240e..adcdf9690e 100644 --- a/specs/search/paths/objects/clearObjects.yml +++ b/specs/search/paths/objects/clearObjects.yml @@ -5,7 +5,9 @@ post: x-acl: - deleteIndex summary: Delete all records from an index - description: Deletes only the records from an index while keeping settings, synonyms, and rules. + description: | + Deletes only the records from an index while keeping settings, synonyms, and rules. + 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). parameters: - $ref: '../../../common/parameters.yml#/IndexName' responses: diff --git a/specs/search/paths/objects/deleteBy.yml b/specs/search/paths/objects/deleteBy.yml index 7a0f2b4bfd..7ec46a93ac 100644 --- a/specs/search/paths/objects/deleteBy.yml +++ b/specs/search/paths/objects/deleteBy.yml @@ -4,12 +4,19 @@ post: operationId: deleteBy x-acl: - deleteIndex - summary: Delete records matching a query + summary: Delete records matching a filter description: | - This operation doesn't accept empty queries or filters. + 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). + externalDocs: + url: https://support.algolia.com/hc/en-us/articles/16385098766353-Should-I-use-the-deleteby-method-for-deleting-records-matching-a-query- + description: Should I use the deleteBy method for deleting records. parameters: - $ref: '../../../common/parameters.yml#/IndexName' requestBody: diff --git a/specs/search/paths/objects/multipleBatch.yml b/specs/search/paths/objects/multipleBatch.yml index 34c27dddcd..f0667f4c16 100644 --- a/specs/search/paths/objects/multipleBatch.yml +++ b/specs/search/paths/objects/multipleBatch.yml @@ -7,6 +7,8 @@ post: - 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). summary: Batch indexing operations on multiple indices requestBody: required: true diff --git a/specs/search/paths/objects/objects.yml b/specs/search/paths/objects/objects.yml index d36e571966..4b5908cf80 100644 --- a/specs/search/paths/objects/objects.yml +++ b/specs/search/paths/objects/objects.yml @@ -14,6 +14,8 @@ post: 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). summary: Add or replace a record parameters: - $ref: '../../../common/parameters.yml#/IndexName' @@ -51,7 +53,6 @@ post: $ref: '../../../common/responses/MethodNotAllowed.yml' '404': $ref: '../../../common/responses/IndexNotFound.yml' - delete: tags: - Indices diff --git a/specs/search/paths/objects/partialUpdate.yml b/specs/search/paths/objects/partialUpdate.yml index 23f6c4acc2..a80bc80fc8 100644 --- a/specs/search/paths/objects/partialUpdate.yml +++ b/specs/search/paths/objects/partialUpdate.yml @@ -13,9 +13,10 @@ post: 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. + 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. + 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 @@ -29,6 +30,8 @@ post: - _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). parameters: - $ref: '../../../common/parameters.yml#/IndexName' - $ref: '../../../common/parameters.yml#/ObjectID' diff --git a/specs/search/paths/rules/saveRules.yml b/specs/search/paths/rules/saveRules.yml index d830764b9d..b4e3009395 100644 --- a/specs/search/paths/rules/saveRules.yml +++ b/specs/search/paths/rules/saveRules.yml @@ -10,6 +10,8 @@ post: 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). x-codegen-request-body-name: rules parameters: - $ref: '../../../common/parameters.yml#/IndexName' diff --git a/specs/search/paths/synonyms/saveSynonyms.yml b/specs/search/paths/synonyms/saveSynonyms.yml index 050279e710..7918d00c81 100644 --- a/specs/search/paths/synonyms/saveSynonyms.yml +++ b/specs/search/paths/synonyms/saveSynonyms.yml @@ -8,6 +8,8 @@ post: description: | 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). parameters: - $ref: '../../../common/parameters.yml#/IndexName' - $ref: '../../../common/parameters.yml#/ForwardToReplicas' From 8a20f1fb48686b2c96278123617a849d2878522d Mon Sep 17 00:00:00 2001 From: Kai Welke Date: Tue, 19 Nov 2024 18:04:57 +0100 Subject: [PATCH 2/4] fix(specs): add rate limit info to records tag --- specs/search/spec.yml | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/specs/search/spec.yml b/specs/search/spec.yml index acfb67cb3b..73035a6c89 100644 --- a/specs/search/spec.yml +++ b/specs/search/spec.yml @@ -123,7 +123,6 @@ tags: url: https://www.algolia.com/doc/guides/security/api-keys/ description: | Related guide: API keys. - - name: Clusters description: | Multi-cluster operations. @@ -161,6 +160,7 @@ tags: Records are individual items in your index. When they match a search query, they're returned as search results, in the order determined by your ranking. Records are schemaless JSON objects. + When adding or updating many records, check the [indexing rate limits](https://support.algolia.com/hc/en-us/articles/4406975251089-Is-there-a-rate-limit-for-indexing-on-Algolia). externalDocs: url: https://www.algolia.com/doc/guides/sending-and-managing-data/prepare-your-data/ description: | @@ -224,7 +224,6 @@ paths: # ###################### /{path}: $ref: '../common/paths/customRequest.yml' - # ######################## # ### Search Endpoints ### # ######################## @@ -236,7 +235,6 @@ paths: $ref: 'paths/search/searchForFacetValues.yml' /1/indexes/{indexName}/browse: $ref: 'paths/search/browse.yml' - # ######################### # ### Objects Endpoints ### # ######################### @@ -256,13 +254,11 @@ paths: $ref: 'paths/objects/multipleBatch.yml' /1/indexes/*/objects: $ref: 'paths/objects/getObjects.yml' - # ########################## # ### Settings Endpoints ### # ########################## /1/indexes/{indexName}/settings: $ref: 'paths/settings/settings.yml' - # ########################## # ### Synonyms Endpoints ### # ########################## @@ -274,7 +270,6 @@ paths: $ref: 'paths/synonyms/clearSynonyms.yml' /1/indexes/{indexName}/synonyms/search: $ref: 'paths/synonyms/searchSynonyms.yml' - # ###################### # ### Keys Endpoints ### # ###################### @@ -284,7 +279,6 @@ paths: $ref: 'paths/keys/key.yml' /1/keys/{key}/restore: $ref: 'paths/keys/restoreApiKey.yml' - # ####################### # ### Rules Endpoints ### # ####################### @@ -296,7 +290,6 @@ paths: $ref: 'paths/rules/clearRules.yml' /1/indexes/{indexName}/rules/search: $ref: 'paths/rules/searchRules.yml' - # ############################## # ### Dictionaries Endpoints ### # ############################## @@ -308,7 +301,6 @@ paths: $ref: 'paths/dictionaries/dictionarySettings.yml' /1/dictionaries/*/languages: $ref: 'paths/dictionaries/getDictionaryLanguages.yml' - # ############################### # ### MultiClusters Endpoints ### # ############################### @@ -326,7 +318,6 @@ paths: $ref: 'paths/multiclusters/searchUserIds.yml' /1/clusters/mapping/pending: $ref: 'paths/multiclusters/hasPendingMappings.yml' - # ####################### # ### Vault Endpoints ### # ####################### @@ -336,7 +327,6 @@ paths: $ref: 'paths/vault/appendSource.yml' /1/security/sources/{source}: $ref: 'paths/vault/deleteSource.yml' - # ########################## # ### Advanced Endpoints ### # ########################## @@ -346,7 +336,6 @@ paths: $ref: 'paths/advanced/getAppTask.yml' /1/indexes/{indexName}/task/{taskID}: $ref: 'paths/advanced/getTask.yml' - # ################################ # ### Manage Indices Endpoints ### # ################################ @@ -354,42 +343,30 @@ paths: $ref: 'paths/manage_indices/operationIndex.yml' /1/indexes: $ref: 'paths/manage_indices/listIndices.yml' - # ############### # ### Helpers ### # ############### /waitForApiKey: $ref: 'helpers/waitForApiKey.yml#/method' - /waitForTask: $ref: 'helpers/waitForTask.yml#/method' - /waitForAppTask: $ref: 'helpers/waitForAppTask.yml#/method' - /browseObjects: $ref: 'helpers/browseObjects.yml#/method' - /generateSecuredApiKey: $ref: 'helpers/generateSecuredApiKey.yml#/method' - /replaceAllObjects: $ref: 'helpers/replaceAllObjects.yml#/method' - /chunkedBatch: $ref: 'helpers/chunkedBatch.yml#/method' - /saveObjects: $ref: 'helpers/saveObjects.yml#/method' - /deleteObjects: $ref: 'helpers/deleteObjects.yml#/method' - /partialUpdateObjects: $ref: 'helpers/partialUpdateObjects.yml#/method' - /indexExists: $ref: 'helpers/indexExists.yml#/method' - /setClientApiKey: $ref: '../common/helpers/setClientApiKey.yml#/method' From 218a0aa6111dd9c62da33775fcfcfa4959a30b52 Mon Sep 17 00:00:00 2001 From: Kai Welke Date: Tue, 19 Nov 2024 18:11:07 +0100 Subject: [PATCH 3/4] fix(specs): clearObjects is resource intensive too --- specs/search/paths/objects/clearObjects.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/search/paths/objects/clearObjects.yml b/specs/search/paths/objects/clearObjects.yml index adcdf9690e..d9c4f963bc 100644 --- a/specs/search/paths/objects/clearObjects.yml +++ b/specs/search/paths/objects/clearObjects.yml @@ -7,7 +7,7 @@ post: summary: Delete all records from an index description: | Deletes only the records from an index while keeping settings, synonyms, and rules. - 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). + 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). parameters: - $ref: '../../../common/parameters.yml#/IndexName' responses: From 90f0bd35fd700a219f20eac8a7b8c1487782522d Mon Sep 17 00:00:00 2001 From: Kai Welke Date: Tue, 19 Nov 2024 18:14:45 +0100 Subject: [PATCH 4/4] fix(specs): dont autoformat yaml --- specs/search/spec.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/specs/search/spec.yml b/specs/search/spec.yml index 73035a6c89..2ade6042d2 100644 --- a/specs/search/spec.yml +++ b/specs/search/spec.yml @@ -123,6 +123,7 @@ tags: url: https://www.algolia.com/doc/guides/security/api-keys/ description: | Related guide: API keys. + - name: Clusters description: | Multi-cluster operations. @@ -224,6 +225,7 @@ paths: # ###################### /{path}: $ref: '../common/paths/customRequest.yml' + # ######################## # ### Search Endpoints ### # ######################## @@ -235,6 +237,7 @@ paths: $ref: 'paths/search/searchForFacetValues.yml' /1/indexes/{indexName}/browse: $ref: 'paths/search/browse.yml' + # ######################### # ### Objects Endpoints ### # ######################### @@ -254,11 +257,13 @@ paths: $ref: 'paths/objects/multipleBatch.yml' /1/indexes/*/objects: $ref: 'paths/objects/getObjects.yml' + # ########################## # ### Settings Endpoints ### # ########################## /1/indexes/{indexName}/settings: $ref: 'paths/settings/settings.yml' + # ########################## # ### Synonyms Endpoints ### # ########################## @@ -270,6 +275,7 @@ paths: $ref: 'paths/synonyms/clearSynonyms.yml' /1/indexes/{indexName}/synonyms/search: $ref: 'paths/synonyms/searchSynonyms.yml' + # ###################### # ### Keys Endpoints ### # ###################### @@ -279,6 +285,7 @@ paths: $ref: 'paths/keys/key.yml' /1/keys/{key}/restore: $ref: 'paths/keys/restoreApiKey.yml' + # ####################### # ### Rules Endpoints ### # ####################### @@ -290,6 +297,7 @@ paths: $ref: 'paths/rules/clearRules.yml' /1/indexes/{indexName}/rules/search: $ref: 'paths/rules/searchRules.yml' + # ############################## # ### Dictionaries Endpoints ### # ############################## @@ -301,6 +309,7 @@ paths: $ref: 'paths/dictionaries/dictionarySettings.yml' /1/dictionaries/*/languages: $ref: 'paths/dictionaries/getDictionaryLanguages.yml' + # ############################### # ### MultiClusters Endpoints ### # ############################### @@ -318,6 +327,7 @@ paths: $ref: 'paths/multiclusters/searchUserIds.yml' /1/clusters/mapping/pending: $ref: 'paths/multiclusters/hasPendingMappings.yml' + # ####################### # ### Vault Endpoints ### # ####################### @@ -327,6 +337,7 @@ paths: $ref: 'paths/vault/appendSource.yml' /1/security/sources/{source}: $ref: 'paths/vault/deleteSource.yml' + # ########################## # ### Advanced Endpoints ### # ########################## @@ -336,6 +347,7 @@ paths: $ref: 'paths/advanced/getAppTask.yml' /1/indexes/{indexName}/task/{taskID}: $ref: 'paths/advanced/getTask.yml' + # ################################ # ### Manage Indices Endpoints ### # ################################ @@ -343,30 +355,42 @@ paths: $ref: 'paths/manage_indices/operationIndex.yml' /1/indexes: $ref: 'paths/manage_indices/listIndices.yml' + # ############### # ### Helpers ### # ############### /waitForApiKey: $ref: 'helpers/waitForApiKey.yml#/method' + /waitForTask: $ref: 'helpers/waitForTask.yml#/method' + /waitForAppTask: $ref: 'helpers/waitForAppTask.yml#/method' + /browseObjects: $ref: 'helpers/browseObjects.yml#/method' + /generateSecuredApiKey: $ref: 'helpers/generateSecuredApiKey.yml#/method' + /replaceAllObjects: $ref: 'helpers/replaceAllObjects.yml#/method' + /chunkedBatch: $ref: 'helpers/chunkedBatch.yml#/method' + /saveObjects: $ref: 'helpers/saveObjects.yml#/method' + /deleteObjects: $ref: 'helpers/deleteObjects.yml#/method' + /partialUpdateObjects: $ref: 'helpers/partialUpdateObjects.yml#/method' + /indexExists: $ref: 'helpers/indexExists.yml#/method' + /setClientApiKey: $ref: '../common/helpers/setClientApiKey.yml#/method'