diff --git a/api/specs/search.yml b/api/specs/search.yml index 38a0e382..00bb430a 100644 --- a/api/specs/search.yml +++ b/api/specs/search.yml @@ -2,7 +2,7 @@ openapi: 3.0.2 info: title: Search API description: > - The Algolia Search API lets you search, configure, and mange your indices + The Algolia Search API lets you search, configure, and manage your indices and records. @@ -42,7 +42,7 @@ info: ## Retry strategy - To guarantee a high availability, implement a retry strategy for all API + To guarantee high availability, implement a retry strategy for all API requests using the URLs of your servers as fallbacks: @@ -134,23 +134,23 @@ servers: - url: https://{appId}.algolia.net variables: appId: - default: myAppId + default: ALGOLIA_APPLICATION_ID - url: https://{appId}-1.algolianet.com variables: appId: - default: myAppId + default: ALGOLIA_APPLICATION_ID - url: https://{appId}-2.algolianet.com variables: appId: - default: myAppId + default: ALGOLIA_APPLICATION_ID - url: https://{appId}-3.algolianet.com variables: appId: - default: myAppId + default: ALGOLIA_APPLICATION_ID - url: https://{appId}-dsn.algolia.net variables: appId: - default: myAppId + default: ALGOLIA_APPLICATION_ID security: - appId: [] apiKey: [] @@ -221,6 +221,9 @@ tags: 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/ @@ -233,10 +236,10 @@ tags: Rules are _if-then_ statements that you can use to curate search results. - Rules have _conditions_ which can trigger _consequences_. + Rules have _conditions_ that can trigger _consequences_. Consequences are changes to the search results, such as changing the order - of search results, or boosting a facet. + of search results or boosting a facet. This can be useful for tuning specific queries or for merchandising. externalDocs: @@ -389,7 +392,7 @@ paths: - search summary: Search an index description: > - Searches a single index and return matching search results (_hits_). + Searches a single index and returns matching search results (_hits_). This method lets you retrieve up to 1,000 hits. @@ -431,7 +434,7 @@ paths: - search summary: Search multiple indices description: > - Sends multiple search request to one or more indices. + Sends multiple search requests to one or more indices. This can be useful in these cases: @@ -551,6 +554,7 @@ paths: tags: - search operationId: browse + x-use-read-transporter: true x-acl: - browse summary: Browse for records @@ -597,7 +601,7 @@ paths: - `optionalFilters`: `[]` - - `typoTolerance`: `true` or `false` (`min` and `strict` is evaluated to + - `typoTolerance`: `true` or `false` (`min` and `strict` evaluate to `true`) @@ -633,7 +637,7 @@ paths: x-acl: - addObject description: > - Adds a record to an index or replace it. + Adds a record to an index or replaces it. - If the record doesn't have an object ID, a new record with an @@ -650,17 +654,21 @@ paths: To update _some_ attributes of a record, use the [`partial` - operation](#tag/Records/operation/partial). + operation](#tag/Records/operation/partialUpdateObject). To add, update, or replace multiple records, use the [`batch` operation](#tag/Records/operation/batch). - summary: Add or replace a record + + + 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 a new record (with auto-generated object ID) parameters: - $ref: '#/components/parameters/IndexName' requestBody: required: true description: >- - The record, a schemaless object with attributes that are useful in the + The record. A schemaless object with attributes that are useful in the context of search and discovery. content: application/json: @@ -777,11 +785,8 @@ paths: content: application/json: schema: - title: getObjectResponse type: object description: The requested record. - additionalProperties: - $ref: '#/components/schemas/attribute' '400': $ref: '#/components/responses/BadRequest' '402': @@ -804,6 +809,9 @@ paths: 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. @@ -815,7 +823,7 @@ paths: requestBody: required: true description: >- - The record, a schemaless object with attributes that are useful in the + The record. A schemaless object with attributes that are useful in the context of search and discovery. content: application/json: @@ -869,16 +877,29 @@ paths: 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). + 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: '#/components/parameters/IndexName' requestBody: @@ -889,7 +910,7 @@ paths: $ref: '#/components/schemas/deleteByParams' responses: '200': - $ref: '#/components/responses/DeletedAt' + $ref: '#/components/responses/UpdatedAt' '400': $ref: '#/components/responses/BadRequest' '402': @@ -906,9 +927,12 @@ paths: x-acl: - deleteIndex summary: Delete all records from an index - description: >- + description: > 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). parameters: - $ref: '#/components/parameters/IndexName' responses: @@ -931,14 +955,65 @@ paths: - addObject summary: Add or update attributes x-codegen-request-body-name: attributesToUpdate - description: | - Adds new attributes to a record, or update existing ones. + description: > + 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, 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. + + + - 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). parameters: - $ref: '#/components/parameters/IndexName' - $ref: '#/components/parameters/ObjectID' @@ -954,10 +1029,8 @@ paths: content: application/json: schema: - type: object description: Attributes to update. - additionalProperties: - $ref: '#/components/schemas/attributeToUpdate' + type: object responses: '200': $ref: '#/components/responses/UpdatedAtWithObjectId' @@ -987,54 +1060,19 @@ paths: - 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: '#/components/parameters/IndexName' + x-codegen-request-body-name: batchWriteParams requestBody: - required: true content: application/json: schema: - title: batchWriteParams - description: Batch parameters. - type: object - additionalProperties: false - properties: - requests: - type: array - items: - title: batchRequest - type: object - additionalProperties: false - properties: - action: - $ref: '#/components/schemas/action' - body: - type: object - description: Operation arguments (varies with specified `action`). - example: - name: Betty Jane McCamey - company: Vita Foods Inc. - email: betty@mccamey.com - required: - - action - - body - required: - - requests - examples: - batch: - summary: Batch indexing request - value: - requests: - - action: addObject - body: - name: Betty Jane McCamey - company: Vita Foods Inc. - email: betty@mccamey.com - - action: addObject - body: - name: Gayla geimer - company: Ortman McCain Co. - email: gayla@geimer.com + $ref: '#/components/schemas/batchWriteParams' + required: true responses: '200': description: OK @@ -1064,6 +1102,10 @@ paths: - 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 @@ -1091,7 +1133,6 @@ paths: $ref: '#/components/schemas/indexName' required: - action - - body - indexName required: - requests @@ -1168,8 +1209,8 @@ paths: requests: type: array items: - description: Request body for retrieving records. title: getObjectsRequest + description: Request body for retrieving records. type: object additionalProperties: false required: @@ -1209,6 +1250,10 @@ paths: type: object additionalProperties: false properties: + message: + type: string + description: An optional status message. + example: Index INDEX_NAME does not exist. results: type: array description: Retrieved records. @@ -1243,7 +1288,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/indexSettings' + $ref: '#/components/schemas/settingsResponse' '400': $ref: '#/components/responses/BadRequest' '402': @@ -1299,7 +1344,7 @@ paths: - settings summary: Retrieve a synonym description: | - Retrieves a syonym by its ID. + Retrieves a synonym by its ID. To find the object IDs for your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms). parameters: @@ -1408,9 +1453,14 @@ paths: x-acl: - editSettings summary: Create or replace synonyms - description: | + 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: '#/components/parameters/IndexName' - $ref: '#/components/parameters/ForwardToReplicas' @@ -1579,7 +1629,9 @@ paths: for any of your application's keys. When authenticating with other API keys, you can only retrieve - information for that key. + information for that key, + + with the description replaced by ``. parameters: - $ref: '#/components/parameters/KeyString' responses: @@ -1767,11 +1819,7 @@ paths: $ref: '#/components/schemas/rule' responses: '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/updatedRuleResponse' + $ref: '#/components/responses/UpdatedAt' '400': $ref: '#/components/responses/BadRequest' '402': @@ -1822,6 +1870,10 @@ paths: 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: '#/components/parameters/IndexName' @@ -1887,8 +1939,8 @@ paths: content: application/json: schema: - type: object title: searchRulesParams + type: object description: Rules search parameters. additionalProperties: false properties: @@ -2911,8 +2963,8 @@ paths: type: array description: Queries performed for the given request. items: - type: object title: logQuery + type: object properties: index_name: type: string @@ -2936,7 +2988,6 @@ paths: - ip - query_headers - sha1 - - nb_api_calls - processing_time_ms '400': $ref: '#/components/responses/BadRequest' @@ -2971,14 +3022,7 @@ paths: content: application/json: schema: - title: getTaskResponse - type: object - additionalProperties: false - properties: - status: - $ref: '#/components/schemas/taskStatus' - required: - - status + $ref: '#/components/schemas/GetTaskResponse' '400': $ref: '#/components/responses/BadRequest' '402': @@ -3023,14 +3067,7 @@ paths: content: application/json: schema: - title: getTaskResponse - type: object - additionalProperties: false - properties: - status: - $ref: '#/components/schemas/taskStatus' - required: - - status + $ref: '#/components/schemas/GetTaskResponse' '400': $ref: '#/components/responses/BadRequest' '402': @@ -3056,6 +3093,8 @@ paths: - If the destination index doesn't exist yet, it'll be created. + - This operation is resource-intensive. + **Copy** @@ -3083,7 +3122,7 @@ paths: - Moving a source index that doesn't exist is ignored without returning an error. - - When moving an index, the analytics data keep their original name and + - 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 @@ -3091,6 +3130,10 @@ paths: - 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: '#/components/parameters/IndexName' requestBody: @@ -3203,6 +3246,106 @@ paths: $ref: '#/components/schemas/getApiKeyResponse' '400': $ref: '#/components/responses/IndexNotFound' + /waitForTask: + get: + x-helper: true + tags: + - search + operationId: waitForTask + summary: Wait for operation to complete + description: > + Wait for a task to complete to ensure synchronized index updates. + + + All Algolia write operations are asynchronous. When you make a request + for a write operation, for example, to add or update records in your + index, Algolia creates a task on a queue and returns a taskID. The task + itself runs separately, depending on the server load. + parameters: + - in: query + name: indexName + description: The name of the index on which the operation was performed. + required: true + schema: + type: string + - in: query + name: taskID + description: The taskID returned by the operation. + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GetTaskResponse' + '400': + $ref: '#/components/responses/IndexNotFound' + /waitForAppTask: + get: + x-helper: true + operationId: waitForAppTask + summary: Wait for application-level operation to complete + description: Wait for a application-level task to complete. + parameters: + - in: query + name: taskID + description: The taskID returned by the operation. + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GetTaskResponse' + '400': + $ref: '#/components/responses/IndexNotFound' + tags: + - search + /browseObjects: + get: + x-helper: true + tags: + - search + operationId: browseObjects + summary: Get all records from an index + description: > + You can use the browse method to get records from an index—for example, + to export your index as a backup. To export all records, use an empty + query. + + + Use browse instead of search when exporting records from your index, + when ranking, or analytics, isn't important. The Analytics API doesn't + collect data when using browse. + + + Don't use this method for building a search UI. Use search instead. + parameters: + - in: query + name: indexName + description: The name of the index on which the operation was performed. + required: true + schema: + type: string + - in: query + name: browseParams + description: Browse parameters. + required: true + schema: + $ref: '#/components/schemas/browseParamsObject' + responses: + '204': + description: No content. + '400': + $ref: '#/components/responses/IndexNotFound' /generateSecuredApiKey: get: x-helper: true @@ -3324,6 +3467,16 @@ paths: required: false schema: type: integer + - in: query + name: scopes + description: >- + List of scopes to kepp in the index. Defaults to `settings`, + `synonyms`, and `rules`. + required: false + schema: + type: array + items: + $ref: '#/components/schemas/scopeType' responses: '200': description: OK @@ -3420,6 +3573,23 @@ paths: type: array items: type: object + - in: query + name: waitForTasks + description: >- + 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. + required: false + schema: + type: boolean + - in: query + name: batchSize + description: >- + The size of the chunk of `objects`. The number of `batch` calls will + be equal to `length(objects) / batchSize`. Defaults to 1000. + required: false + schema: + type: integer - in: query name: requestOptions description: The request options to pass to the `batch` method. @@ -3463,6 +3633,23 @@ paths: type: array items: type: string + - in: query + name: waitForTasks + description: >- + 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. + required: false + schema: + type: boolean + - in: query + name: batchSize + description: >- + The size of the chunk of `objects`. The number of `batch` calls will + be equal to `length(objects) / batchSize`. Defaults to 1000. + required: false + schema: + type: integer - in: query name: requestOptions description: The request options to pass to the `batch` method. @@ -3517,6 +3704,23 @@ paths: required: false schema: type: boolean + - in: query + name: waitForTasks + description: >- + 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. + required: false + schema: + type: boolean + - in: query + name: batchSize + description: >- + The size of the chunk of `objects`. The number of `batch` calls will + be equal to `length(objects) / batchSize`. Defaults to 1000. + required: false + schema: + type: integer - in: query name: requestOptions description: The request options to pass to the `batch` method. @@ -3534,147 +3738,83 @@ paths: $ref: '#/components/schemas/batchResponse' '400': $ref: '#/components/responses/IndexNotFound' -components: - securitySchemes: - appId: - type: apiKey - in: header - name: x-algolia-application-id - description: Your Algolia application ID. - apiKey: - type: apiKey - in: header - name: x-algolia-api-key + /indexExists: + get: + x-helper: true + tags: + - search + operationId: indexExists + summary: Check if an index exists or not description: > - Your Algolia API key with the necessary permissions to make the request. - - Permissions are controlled through access control lists (ACL) and access - restrictions. + You can initialize an index with any name. The index is created on + Algolia's servers when you add objects or set settings. To prevent + accidentally creating new indices, or changing existing indices, you can + use the exists method. The exists method returns a boolean that + indicates whether an initialized index has been created. + parameters: + - in: query + name: indexName + description: The name of the index to check. + required: true + schema: + type: string + responses: + '200': + description: Index exists. + content: + application/json: + schema: + type: boolean + /setClientApiKey: + get: + x-helper: true + x-asynchronous-helper: false + tags: + - search + operationId: setClientApiKey + summary: Switch the API key used to authenticate requests + description: | + Switch the API key used to authenticate requests. + parameters: + - in: query + name: apiKey + description: API key to be used from now on. + required: true + schema: + type: string + responses: + '204': + description: No content. +components: + securitySchemes: + appId: + type: apiKey + in: header + name: x-algolia-application-id + description: Your Algolia application ID. + apiKey: + type: apiKey + in: header + name: x-algolia-api-key + description: > + Your Algolia API key with the necessary permissions to make the request. + + Permissions are controlled through access control lists (ACL) and access + restrictions. The required ACL to make a request is listed in each endpoint's reference. - parameters: - PathInPath: - name: path - in: path - description: Path of the endpoint, anything after "/1" must be specified. - required: true - schema: - type: string - example: /keys - Parameters: - name: parameters - in: query - description: Query parameters to apply to the current query. - schema: - type: object - additionalProperties: true - IndexName: - name: indexName - in: path - description: Name of the index on which to perform the operation. - required: true - schema: - type: string - example: YourIndexName - ObjectID: - name: objectID - in: path - description: Unique record identifier. - required: true - schema: - $ref: '#/components/schemas/objectID' - ForwardToReplicas: - in: query - name: forwardToReplicas - required: false - description: Whether changes are applied to replica indices. - schema: - type: boolean - parameters_ObjectID: - name: objectID - in: path - description: Unique identifier of a synonym object. - required: true - schema: - type: string - example: synonymID - ReplaceExistingSynonyms: - in: query - name: replaceExistingSynonyms - schema: - type: boolean - description: >- - Whether to replace all synonyms in the index with the ones sent with - this request. - KeyString: - in: path - name: key - required: true - schema: - type: string - example: YourAPIKey - description: API key. - ObjectIDRule: - in: path - name: objectID - description: Unique identifier of a rule object. - required: true - schema: - $ref: '#/components/schemas/ruleID' - ClearExistingRules: - in: query - name: clearExistingRules - required: false - schema: - type: boolean - description: Whether existing rules should be deleted before adding this batch. - DictionaryName: - in: path - name: dictionaryName - description: Dictionary type in which to search. - required: true - schema: - $ref: '#/components/schemas/dictionaryType' - Page: - in: query - name: page - description: | - Requested page of the API response. - If `null`, the API response is not paginated. - required: false - schema: - oneOf: - - type: integer - minimum: 0 - - type: 'null' - default: null - HitsPerPage: - in: query - name: hitsPerPage - description: Number of hits per page. - required: false - schema: - type: integer - default: 100 - UserIDInHeader: - name: X-Algolia-User-ID - description: Unique identifier of the user who makes the search request. - in: header - required: true - schema: - $ref: '#/components/schemas/userID' - UserIDInPath: - name: userID - description: Unique identifier of the user who makes the search request. - in: path - required: true - schema: - $ref: '#/components/schemas/userID' schemas: + attributeToUpdate: + x-keep-model: true + deprecated: true + oneOf: + - type: string + - $ref: '#/components/schemas/builtInOperation' ErrorBase: description: Error. type: object + x-keep-model: true additionalProperties: true properties: message: @@ -3687,7 +3827,8 @@ components: default: '' searchParamsString: type: object - title: Search parameters as query string + title: Search parameters as query string. + description: Search parameters as query string. additionalProperties: false x-discriminator-fields: - params @@ -3806,6 +3947,10 @@ components: - Optional filters are applied _after_ sort-by attributes. + - Optional filters are applied _before_ custom ranking attributes (in + the default + [ranking](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/)). + - Optional filters don't work with numeric attributes. example: - category:Book @@ -3827,7 +3972,9 @@ components: You can use numeric comparison operators: `<`, `<=`, `=`, `!=`, `>`, - `>=`. Comparsions are precise up to 3 decimals. + `>=`. + + Comparisons are precise up to 3 decimals. You can also provide ranges: `facet: TO `. The range includes the lower and upper boundaries. @@ -3886,7 +4033,7 @@ components: string of latitude and longitude. - Only records included within circle around this central location are + Only records included within a circle around this central location are included in the results. The radius of the circle is determined by the `aroundRadius` and @@ -3936,6 +4083,7 @@ components: title: range objects type: array items: + title: range type: object description: >- Range object with lower and upper values in meters to define custom @@ -3975,7 +4123,7 @@ components: - $ref: '#/components/schemas/aroundPrecisionFromValue' x-categories: - Geo-Search - insideBoundingBox: + insideBoundingBoxArray: type: array items: type: array @@ -4010,6 +4158,11 @@ components: - 1.9916 x-categories: - Geo-Search + insideBoundingBox: + oneOf: + - type: string + - type: 'null' + - $ref: '#/components/schemas/insideBoundingBoxArray' insidePolygon: type: array items: @@ -4249,7 +4402,7 @@ components: length: type: integer description: Number of hits to retrieve (used in combination with `offset`). - minimum: 1 + minimum: 0 maximum: 1000 x-categories: - Pagination @@ -4415,8 +4568,8 @@ components: If typo tolerance is true, `min`, or `strict`, [word splitting and - concetenation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/splitting-and-concatenation/) - is also active. + concatenation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/splitting-and-concatenation/) + are also active. oneOf: - type: boolean default: true @@ -4426,6 +4579,11 @@ components: - $ref: '#/components/schemas/typoToleranceEnum' x-categories: - Typos + booleanString: + type: string + enum: + - 'true' + - 'false' ignorePlurals: description: | Treat singular, plurals, and other forms of declensions as equivalent. @@ -4440,6 +4598,7 @@ components: This overrides languages you set with `queryLanguages`. items: $ref: '#/components/schemas/supportedLanguage' + - $ref: '#/components/schemas/booleanString' - type: boolean description: > If true, `ignorePlurals` is active for all languages included in @@ -4493,7 +4652,7 @@ components: Determines if and how query words are interpreted as prefixes. - By default, only the last query word is treated as prefix + By default, only the last query word is treated as a prefix (`prefixLast`). To turn off prefix search, use `prefixNone`. @@ -4573,6 +4732,58 @@ components: items: type: string - type: 'null' + optionalWordsArray: + type: array + items: + type: string + example: + - blue + - iphone case + description: > + Words that should be considered optional when found in the query. + + + By default, records must match all words in the search query to be + included in the search results. + + Adding optional words can help to increase the number of search results + by running an additional search query that doesn't include the optional + words. + + For example, if the search query is "action video" and "video" is an + optional word, + + the search engine runs two queries. One for "action video" and one for + "action". + + Records that match all words are ranked higher. + + + For a search query with 4 or more words **and** all its words are + optional, + + the number of matched words required for a record to be included in the + search results increases for every 1,000 records: + + + - If `optionalWords` has less than 10 words, the required number of + matched words increases by 1: + results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. + - If `optionalWords` has 10 or more words, the number of required + matched words increases by the number of optional words divided by 5 + (rounded down). + For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. + + For more information, see [Optional + words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). + default: [] + x-categories: + - Query strategy + optionalWords: + oneOf: + - type: string + - type: 'null' + - $ref: '#/components/schemas/optionalWordsArray' exactOnSingleWordQuery: type: string enum: @@ -4606,6 +4817,7 @@ components: - ignorePlurals - singleWordSynonym - multiWordsSynonym + - ignoreConjugations x-categories: - Query strategy advancedSyntaxFeatures: @@ -4656,15 +4868,6 @@ components: default: 0 x-categories: - Advanced - maxFacetHits: - type: integer - description: >- - Maximum number of facet values to return when [searching for facet - values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). - maximum: 100 - default: 10 - x-categories: - - Advanced order: description: > Explicit order of facets or facet values. @@ -4739,13 +4942,59 @@ components: properties: url: type: string + bannerImageUrl: + description: url for a search banner image. + type: object + additionalProperties: false + properties: + url: + type: string + bannerImage: + description: image of a search banner. + type: object + additionalProperties: false + properties: + urls: + type: array + items: + $ref: '#/components/schemas/bannerImageUrl' + title: + type: string + bannerLink: + description: link for a banner defined in merchandising studio. + type: object + additionalProperties: false + properties: + url: + type: string + banner: + description: a search banner with image and url. + type: object + additionalProperties: false + properties: + image: + $ref: '#/components/schemas/bannerImage' + link: + $ref: '#/components/schemas/bannerLink' + banners: + description: banners defined in the merchandising studio for the given search. + type: array + items: + $ref: '#/components/schemas/banner' + widgets: + description: widgets returned from any rules that are applied to the current search. + type: object + additionalProperties: false + properties: + banners: + $ref: '#/components/schemas/banners' renderingContent: description: > Extra data that can be used in the search UI. - You can use this to control aspects of your search UI, such as, the - order of facet names and values + You can use this to control aspects of your search UI, such as the order + of facet names and values without changing your frontend code. type: object @@ -4755,6 +5004,8 @@ components: $ref: '#/components/schemas/facetOrdering' redirect: $ref: '#/components/schemas/redirectURL' + widgets: + $ref: '#/components/schemas/widgets' x-categories: - Advanced reRankingApplyFilter: @@ -4848,49 +5099,6 @@ components: - custom x-categories: - Ranking - customRanking: - type: array - items: - type: string - example: - - desc(popularity) - - asc(price) - description: > - Attributes to use as [custom - ranking](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/). - - Attribute names are case-sensitive. - - - The custom ranking attributes decide which items are shown first if - the other ranking criteria are equal. - - - Records with missing values for your selected custom ranking - attributes are always sorted last. - - Boolean attributes are sorted based on their alphabetical order. - - - **Modifiers** - - - - `asc("ATTRIBUTE")`. - Sort the index by the values of an attribute, in ascending order. - - - `desc("ATTRIBUTE")`. - Sort the index by the values of an attribute, in descending order. - - If you use two or more custom ranking attributes, - - [reduce the - precision](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/how-to/controlling-custom-ranking-metrics-precision/) - of your first attributes, - - or the other attributes will never be applied. - default: [] - x-categories: - - Ranking relevancyStrictness: type: integer example: 90 @@ -5063,18 +5271,6 @@ components: $ref: '#/components/schemas/ignorePlurals' removeStopWords: $ref: '#/components/schemas/removeStopWords' - keepDiacriticsOnCharacters: - type: string - example: øé - description: | - Characters for which diacritics should be preserved. - - By default, Algolia removes diacritics from letters. - For example, `é` becomes `e`. If this causes issues in your search, - you can specify characters that should keep their diacritics. - default: '' - x-categories: - - Languages queryLanguages: type: array items: @@ -5116,7 +5312,8 @@ components: decompoundQuery: type: boolean description: > - Whether to split compound words into their building blocks. + Whether to split compound words in the query into their building + blocks. For more information, see [Word @@ -5124,6 +5321,12 @@ components: Word segmentation is supported for these languages: German, Dutch, Finnish, Swedish, and Norwegian. + + Decompounding doesn't work for words with [non-spacing mark Unicode + characters](https://www.charactercodes.net/category/non-spacing_mark). + + For example, `Gartenstühle` won't be decompounded if the `ü` + consists of `u` (U+0075) and `◌̈` (U+0308). default: true x-categories: - Languages @@ -5160,52 +5363,7 @@ components: x-categories: - Query strategy optionalWords: - type: array - items: - type: string - example: - - blue - - iphone case - description: > - Words that should be considered optional when found in the query. - - - By default, records must match all words in the search query to be - included in the search results. - - Adding optional words can help to increase the number of search - results by running an additional search query that doesn't include - the optional words. - - For example, if the search query is "action video" and "video" is an - optional word, - - the search engine runs two queries. One for "action video" and one - for "action". - - Records that match all words are ranked higher. - - - For a search query with 4 or more words **and** all its words are - optional, - - the number of matched words required for a record to be included in - the search results increases for every 1,000 records: - - - - If `optionalWords` has less than 10 words, the required number of - matched words increases by 1: - results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 2 matched words. - - If `optionalWords` has 10 or more words, the number of required - matched words increases by the number of optional words dividied by - 5 (rounded down). - For example, with 18 optional words: results 1 to 1,000 require 1 matched word, results 1,001 to 2000 need 4 matched words. - - For more information, see [Optional - words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/#creating-a-list-of-optional-words). - default: [] - x-categories: - - Query strategy + $ref: '#/components/schemas/optionalWords' disableExactOnAttributes: type: array items: @@ -5221,7 +5379,7 @@ components: This can be useful for attributes with long values, where the - likelyhood of an exact match is high, + likelihood of an exact match is high, such as product descriptions. @@ -5240,18 +5398,32 @@ components: items: $ref: '#/components/schemas/alternativesAsExact' description: > - Alternatives of query words that should be considered as exact - matches by the Exact ranking criterion. + Determine which plurals and synonyms should be considered an exact + matches. + + + By default, Algolia treats singular and plural forms of a word, and + single-word synonyms, as + [exact](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#exact) + matches when searching. + + For example: + + + - "swimsuit" and "swimsuits" are treated the same + + - "swimsuit" and "swimwear" are treated the same (if they are + [synonyms](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/#regular-synonyms)). - `ignorePlurals`. Plurals and similar declensions added by the `ignorePlurals` setting are considered exact matches. - `singleWordSynonym`. - Single-word synonyms, such as "NY/NYC" are considered exact matches. + Single-word synonyms, such as "NY" = "NYC", are considered exact matches. - `multiWordsSynonym`. - Multi-word synonyms, such as "NY/New York" are considered exact matches. + Multi-word synonyms, such as "NY" = "New York", are considered exact matches. default: - ignorePlurals - singleWordSynonym @@ -5301,7 +5473,7 @@ components: With `replaceSynonymsInHighlight` set to `true`, a search for `home` still matches the same records, - but all occurences of "house" are replaced by "home" in the + but all occurrences of "house" are replaced by "home" in the highlighted response. default: false x-categories: @@ -5353,8 +5525,6 @@ components: - '*' x-categories: - Advanced - maxFacetHits: - $ref: '#/components/schemas/maxFacetHits' maxValuesPerFacet: type: integer description: Maximum number of facet values to return for each facet. @@ -5451,6 +5621,7 @@ components: type: boolean description: Redirect rule status. data: + title: redirectRuleIndexData type: object description: Redirect rule data. required: @@ -5502,8 +5673,8 @@ components: type: string description: Distance from a central coordinate provided by `aroundLatLng`. exhaustive: - type: object title: exhaustive + type: object description: >- Whether certain properties of the search response are calculated exhaustive (exact) or approximated. @@ -5550,6 +5721,12 @@ components: default) to be processed (this can happen when a lot of typo alternatives exist for the query). This field will not be included when typo-tolerance is entirely disabled. + appliedRules: + description: Rules applied to the query. + title: appliedRules + type: array + items: + type: object exhaustiveFacetsCount: type: boolean description: >- @@ -5579,12 +5756,11 @@ components: food: 1 tech: 42 facets_stats: - title: facetsStats type: object description: Statistics for numerical facets. additionalProperties: - type: object title: facetStats + type: object properties: min: type: number @@ -5668,6 +5844,9 @@ components: Unique identifier for the query. This is used for [click analytics](https://www.algolia.com/doc/guides/analytics/click-analytics/). example: a00dbc80a8d13c4565a442e7e2dca80a + _automaticInsights: + type: boolean + description: Whether automatic events collection is enabled for the application. nbHits: type: integer description: Number of results (hits). @@ -5688,11 +5867,6 @@ components: $ref: '#/components/schemas/nbPages' hitsPerPage: $ref: '#/components/schemas/hitsPerPage' - required: - - page - - nbHits - - nbPages - - hitsPerPage objectID: type: string description: Unique record identifier. @@ -5731,27 +5905,25 @@ components: - value - matchLevel - matchedWords - highlightResultOptionMap: + x-discriminator-fields: + - matchLevel + - matchedWords + highlightResultMap: type: object description: Surround words that match the query with HTML tags for highlighting. + x-is-free-form: false additionalProperties: x-additionalPropertiesName: attribute - $ref: '#/components/schemas/highlightResultOption' - highlightResultOptionArray: - type: array - description: Surround words that match the query with HTML tags for highlighting. - items: - $ref: '#/components/schemas/highlightResultOption' + $ref: '#/components/schemas/highlightResult' highlightResult: oneOf: - $ref: '#/components/schemas/highlightResultOption' - - $ref: '#/components/schemas/highlightResultOptionMap' - - $ref: '#/components/schemas/highlightResultOptionArray' - highlightResultMap: - type: object + - $ref: '#/components/schemas/highlightResultMap' + - $ref: '#/components/schemas/highlightResultArray' + highlightResultArray: + type: array description: Surround words that match the query with HTML tags for highlighting. - additionalProperties: - x-additionalPropertiesName: attribute + items: $ref: '#/components/schemas/highlightResult' snippetResultOption: type: object @@ -5765,27 +5937,24 @@ components: required: - value - matchLevel - snippetResultOptionMap: + x-discriminator-fields: + - matchLevel + snippetResultMap: type: object description: Snippets that show the context around a matching search query. + x-is-free-form: false additionalProperties: x-additionalPropertiesName: attribute - $ref: '#/components/schemas/snippetResultOption' - snippetResultOptionArray: - type: array - description: Snippets that show the context around a matching search query. - items: - $ref: '#/components/schemas/snippetResultOption' + $ref: '#/components/schemas/snippetResult' snippetResult: oneOf: - $ref: '#/components/schemas/snippetResultOption' - - $ref: '#/components/schemas/snippetResultOptionMap' - - $ref: '#/components/schemas/snippetResultOptionArray' - snippetResultMap: - type: object + - $ref: '#/components/schemas/snippetResultMap' + - $ref: '#/components/schemas/snippetResultArray' + snippetResultArray: + type: array description: Snippets that show the context around a matching search query. - additionalProperties: - x-additionalPropertiesName: attribute + items: $ref: '#/components/schemas/snippetResult' matchedGeoLocation: type: object @@ -5880,7 +6049,7 @@ components: - geoDistance - nbExactWords - userScore - _distinctSeqID: + distinctSeqID: type: integer hit: type: object @@ -5904,7 +6073,7 @@ components: _rankingInfo: $ref: '#/components/schemas/rankingInfo' _distinctSeqID: - $ref: '#/components/schemas/_distinctSeqID' + $ref: '#/components/schemas/distinctSeqID' searchHits: type: object additionalProperties: true @@ -5968,6 +6137,15 @@ components: description: Text to search inside the facet's values. example: george default: '' + maxFacetHits: + type: integer + description: >- + Maximum number of facet values to return when [searching for facet + values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). + maximum: 100 + default: 10 + x-categories: + - Advanced searchTypeFacet: type: string enum: @@ -6033,8 +6211,8 @@ components: type: array description: Matching facet values. items: - type: object title: facetHits + type: object additionalProperties: false required: - value @@ -6125,9 +6303,6 @@ components: type: string example: '2023-06-27T14:42:38.831Z' description: Date and time when the object was deleted, in RFC 3339 format. - attribute: - type: string - description: Value of the attribute to update. updatedAt: type: string example: '2023-07-04T12:49:15Z' @@ -6164,36 +6339,6 @@ components: $ref: '#/components/schemas/taskID' updatedAt: $ref: '#/components/schemas/updatedAt' - builtInOperationType: - type: string - enum: - - Increment - - Decrement - - Add - - Remove - - AddUnique - - IncrementFrom - - IncrementSet - description: How to change the attribute. - builtInOperation: - type: object - description: Update to perform on the attribute. - additionalProperties: false - properties: - _operation: - $ref: '#/components/schemas/builtInOperationType' - value: - type: string - description: >- - Value that corresponds to the operation, for example an `Increment` - or `Decrement` step, or an `Add` or `Remove` value. - required: - - _operation - - value - attributeToUpdate: - oneOf: - - $ref: '#/components/schemas/attribute' - - $ref: '#/components/schemas/builtInOperation' action: type: string enum: @@ -6205,6 +6350,48 @@ components: - delete - clear description: Type of indexing operation. + batchWriteParams: + title: batchWriteParams + description: Batch parameters. + type: object + additionalProperties: false + properties: + requests: + type: array + items: + title: batchRequest + type: object + additionalProperties: false + properties: + action: + $ref: '#/components/schemas/action' + body: + type: object + description: Operation arguments (varies with specified `action`). + example: + name: Betty Jane McCamey + company: Vita Foods Inc. + email: betty@mccamey.com + required: + - action + - body + required: + - requests + example: + batch: + summary: Batch indexing request + value: + requests: + - action: addObject + body: + name: Betty Jane McCamey + company: Vita Foods Inc. + email: betty@mccamey.com + - action: addObject + body: + name: Gayla geimer + company: Ortman McCain Co. + email: gayla@geimer.com objectIDs: type: array items: @@ -6226,7 +6413,6 @@ components: - objectIDs baseIndexSettings: type: object - title: Index settings. additionalProperties: false properties: attributesForFaceting: @@ -6257,7 +6443,7 @@ components: - `filterOnly("ATTRIBUTE")`. - Allows using this attribute as a filter, but doesn't evalue the facet values. + Allows the attribute to be used as a filter but doesn't evaluate the facet values. - `searchable("ATTRIBUTE")`. Allows searching for facet values. @@ -6294,7 +6480,7 @@ components: replicas to this parameter. If you omit a replica from this list, the replica turns into a - regular, standalone index that will no longer by synced with the + regular, standalone index that will no longer be synced with the primary index. @@ -6349,8 +6535,8 @@ components: - wheel - 1X2BCD description: > - Words for which you want to turn off [typo - tolerance](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/). + Creates a list of [words which require exact + matches](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#turn-off-typo-tolerance-for-certain-words). This also turns off [word splitting and concatenation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/splitting-and-concatenation/) @@ -6421,6 +6607,12 @@ components: Dutch (`nl`), German (`de`), Finnish (`fi`), Danish (`da`), Swedish (`sv`), and Norwegian (`no`). + + Decompounding doesn't work for words with [non-spacing mark Unicode + characters](https://www.charactercodes.net/category/non-spacing_mark). + + For example, `Gartenstühle` won't be decompounded if the `ü` + consists of `u` (U+0075) and `◌̈` (U+0308). default: {} x-categories: - Languages @@ -6492,8 +6684,8 @@ components: For faster indexing, reduce the number of numeric attributes. - If you want to turn off filtering for all numeric attributes, - specifiy an attribute that doesn't exist in your index, such as + To turn off filtering for all numeric attributes, specify an + attribute that doesn't exist in your index, such as `NO_NUMERIC_FILTERING`. @@ -6512,18 +6704,25 @@ components: type: string example: +# description: > - Controls which separators are indexed. + Control which non-alphanumeric characters are indexed. + + + By default, Algolia ignores [non-alphanumeric + characters](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/how-to/how-to-search-in-hyphenated-attributes/#handling-non-alphanumeric-characters) + like hyphen (`-`), plus (`+`), and parentheses (`(`,`)`). + + To include such characters, define them with `separatorsToIndex`. Separators are all non-letter characters except spaces and currency characters, such as $€£¥. - By default, separator characters aren't indexed. With `separatorsToIndex`, Algolia treats separator characters as separate words. - For example, a search for `C#` would report two matches. + For example, in a search for "Disney+", Algolia considers "Disney" + and "+" as two separate words. default: '' x-categories: - Typos @@ -6567,8 +6766,8 @@ components: - `unordered("ATTRIBUTE")`. Ignore the position of a match within the attribute. - Without modifier, matches at the beginning of an attribute rank - higer than matches at the end. + Without a modifier, matches at the beginning of an attribute rank + higher than matches at the end. default: [] x-categories: - Attributes @@ -6614,11 +6813,81 @@ components: accurate facet counts. example: url type: string + maxFacetHits: + $ref: '#/components/schemas/maxFacetHits' + keepDiacriticsOnCharacters: + type: string + example: øé + description: | + Characters for which diacritics should be preserved. + + By default, Algolia removes diacritics from letters. + For example, `é` becomes `e`. If this causes issues in your search, + you can specify characters that should keep their diacritics. + default: '' + x-categories: + - Languages + customRanking: + type: array + items: + type: string + example: + - desc(popularity) + - asc(price) + description: > + Attributes to use as [custom + ranking](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/). + + Attribute names are case-sensitive. + + + The custom ranking attributes decide which items are shown first if + the other ranking criteria are equal. + + + Records with missing values for your selected custom ranking + attributes are always sorted last. + + Boolean attributes are sorted based on their alphabetical order. + + + **Modifiers** + + + - `asc("ATTRIBUTE")`. + Sort the index by the values of an attribute, in ascending order. + + - `desc("ATTRIBUTE")`. + Sort the index by the values of an attribute, in descending order. + + If you use two or more custom ranking attributes, + + [reduce the + precision](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/how-to/controlling-custom-ranking-metrics-precision/) + of your first attributes, + + or the other attributes will never be applied. + default: [] + x-categories: + - Ranking indexSettings: description: Index settings. allOf: - $ref: '#/components/schemas/baseIndexSettings' - $ref: '#/components/schemas/indexSettingsAsSearchParams' + WithPrimary: + type: object + additionalProperties: false + properties: + primary: + type: string + description: > + Replica indices only: the name of the primary index for this + replica. + settingsResponse: + allOf: + - $ref: '#/components/schemas/indexSettings' + - $ref: '#/components/schemas/WithPrimary' SynonymType: type: string description: Synonym type. @@ -6629,6 +6898,9 @@ components: - altcorrection1 - altcorrection2 - placeholder + - oneWaySynonym + - altCorrection1 + - altCorrection2 synonymHit: type: object description: Synonym object. @@ -6728,7 +7000,7 @@ components: createdAt: $ref: '#/components/schemas/createdAtTimestamp' required: - - key + - value - createdAt acl: description: Access control list permissions. @@ -6831,7 +7103,7 @@ components: Creating an API key fails if the request is made from an IP address - that's outside the restricted range. + outside the restricted range. example: typoTolerance=strict&restrictSources=192.168.1.0/24 default: '' referers: @@ -6896,12 +7168,12 @@ components: description: | Which part of the search query the pattern should match: - - `startsWith`. The pattern must match the begginning of the query. + - `startsWith`. The pattern must match the beginning of the query. - `endsWith`. The pattern must match the end of the query. - `is`. The pattern must match the query exactly. - `contains`. The pattern must match anywhere in the query. - Empty queries are only allowed as pattern with `anchoring: is`. + Empty queries are only allowed as patterns with `anchoring: is`. enum: - is - startsWith @@ -7106,6 +7378,8 @@ components: required: - position - objectIDs + x-discriminator-fields: + - objectIDs promoteObjectID: title: objectID description: Record to promote. @@ -7119,6 +7393,8 @@ components: required: - position - objectID + x-discriminator-fields: + - objectID promote: oneOf: - $ref: '#/components/schemas/promoteObjectIDs' @@ -7192,9 +7468,11 @@ components: properties: from: type: integer + format: int64 description: When the rule should start to be active, in Unix epoch time. until: type: integer + format: int64 description: When the rule should stop to be active, in Unix epoch time. required: - from @@ -7240,20 +7518,7 @@ components: $ref: '#/components/schemas/timeRange' required: - objectID - updatedRuleResponse: - type: object - additionalProperties: false - properties: - objectID: - $ref: '#/components/schemas/ruleID' - updatedAt: - $ref: '#/components/schemas/updatedAt' - taskID: - $ref: '#/components/schemas/taskID' - required: - - objectID - - updatedAt - - taskID + - consequence parameters_query: type: string description: Search query for rules. @@ -7261,13 +7526,49 @@ components: parameters_page: type: integer minimum: 0 - description: Requested page of the API response. + description: > + Requested page of the API response. + + + Algolia uses `page` and `hitsPerPage` to control how search results are + displayed + ([paginated](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/)). + + + - `hitsPerPage`: sets the number of search results (_hits_) displayed + per page. + + - `page`: specifies the page number of the search results you want to + retrieve. Page numbering starts at 0, so the first page is `page=0`, the + second is `page=1`, and so on. + + + For example, to display 10 results per page starting from the third + page, set `hitsPerPage` to 10 and `page` to 2. parameters_hitsPerPage: type: integer default: 20 minimum: 1 maximum: 1000 - description: Maximum number of hits per page. + description: > + Maximum number of hits per page. + + + Algolia uses `page` and `hitsPerPage` to control how search results are + displayed + ([paginated](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/)). + + + - `hitsPerPage`: sets the number of search results (_hits_) displayed + per page. + + - `page`: specifies the page number of the search results you want to + retrieve. Page numbering starts at 0, so the first page is `page=0`, the + second is `page=1`, and so on. + + + For example, to display 10 results per page starting from the third + page, set `hitsPerPage` to 10 and `page` to 2. dictionaryType: type: string enum: @@ -7287,13 +7588,20 @@ components: - disabled default: enabled description: Whether a dictionary entry is active. + dictionaryEntryType: + type: string + enum: + - custom + - standard + description: >- + Whether a dictionary entry is provided by Algolia (standard), or has + been added by you (custom). dictionaryEntry: type: object description: Dictionary entry. additionalProperties: true required: - objectID - - language properties: objectID: type: string @@ -7328,6 +7636,8 @@ components: type: string state: $ref: '#/components/schemas/dictionaryEntryState' + type: + $ref: '#/components/schemas/dictionaryEntryType' searchDictionaryEntriesResponse: type: object additionalProperties: false @@ -7473,6 +7783,15 @@ components: description: >- Task status, `published` if the task is completed, `notPublished` otherwise. + GetTaskResponse: + title: getTaskResponse + type: object + additionalProperties: false + properties: + status: + $ref: '#/components/schemas/taskStatus' + required: + - status operationType: type: string enum: @@ -7672,6 +7991,155 @@ components: - copyOperationResponse - batchResponses - moveOperationResponse + builtInOperationType: + type: string + enum: + - Increment + - Decrement + - Add + - Remove + - AddUnique + - IncrementFrom + - IncrementSet + description: How to change the attribute. + builtInOperationValue: + oneOf: + - type: string + description: >- + A string to append or remove for the `Add`, `Remove`, and + `AddUnique` operations. + - type: integer + description: A number to add, remove, or append, depending on the operation. + builtInOperation: + type: object + description: Update to perform on the attribute. + additionalProperties: false + properties: + _operation: + $ref: '#/components/schemas/builtInOperationType' + value: + $ref: '#/components/schemas/builtInOperationValue' + required: + - _operation + - value + parameters: + PathInPath: + name: path + in: path + description: Path of the endpoint, anything after "/1" must be specified. + required: true + schema: + type: string + example: /keys + Parameters: + name: parameters + in: query + description: Query parameters to apply to the current query. + schema: + type: object + additionalProperties: true + IndexName: + name: indexName + in: path + description: Name of the index on which to perform the operation. + required: true + schema: + type: string + example: ALGOLIA_INDEX_NAME + ObjectID: + name: objectID + in: path + description: Unique record identifier. + required: true + schema: + $ref: '#/components/schemas/objectID' + ForwardToReplicas: + in: query + name: forwardToReplicas + required: false + description: Whether changes are applied to replica indices. + schema: + type: boolean + parameters_ObjectID: + name: objectID + in: path + description: Unique identifier of a synonym object. + required: true + schema: + type: string + example: synonymID + ReplaceExistingSynonyms: + in: query + name: replaceExistingSynonyms + schema: + type: boolean + description: >- + Whether to replace all synonyms in the index with the ones sent with + this request. + KeyString: + in: path + name: key + required: true + schema: + type: string + example: ALGOLIA_API_KEY + description: API key. + ObjectIDRule: + in: path + name: objectID + description: Unique identifier of a rule object. + required: true + schema: + $ref: '#/components/schemas/ruleID' + ClearExistingRules: + in: query + name: clearExistingRules + required: false + schema: + type: boolean + description: Whether existing rules should be deleted before adding this batch. + DictionaryName: + in: path + name: dictionaryName + description: Dictionary type in which to search. + required: true + schema: + $ref: '#/components/schemas/dictionaryType' + Page: + in: query + name: page + description: | + Requested page of the API response. + If `null`, the API response is not paginated. + required: false + schema: + oneOf: + - type: integer + minimum: 0 + - type: 'null' + default: null + HitsPerPage: + in: query + name: hitsPerPage + description: Number of hits per page. + required: false + schema: + type: integer + default: 100 + UserIDInHeader: + name: X-Algolia-User-ID + description: Unique identifier of the user who makes the search request. + in: header + required: true + schema: + $ref: '#/components/schemas/userID' + UserIDInPath: + name: userID + description: Unique identifier of the user who makes the search request. + in: path + required: true + schema: + $ref: '#/components/schemas/userID' responses: BadRequest: description: Bad request or request arguments. diff --git a/pkg/cmdutil/spec_flags.go b/pkg/cmdutil/spec_flags.go index aa3c0d1b..09ada0fb 100644 --- a/pkg/cmdutil/spec_flags.go +++ b/pkg/cmdutil/spec_flags.go @@ -24,7 +24,6 @@ var BrowseParamsObject = []string{ "attributesToSnippet", "clickAnalytics", "cursor", - "customRanking", "decompoundQuery", "disableExactOnAttributes", "disableTypoToleranceOnAttributes", @@ -45,9 +44,7 @@ var BrowseParamsObject = []string{ "ignorePlurals", "insideBoundingBox", "insidePolygon", - "keepDiacriticsOnCharacters", "length", - "maxFacetHits", "maxValuesPerFacet", "minProximity", "minWordSizefor1Typo", @@ -178,7 +175,6 @@ var SearchParamsObject = []string{ "attributesToRetrieve", "attributesToSnippet", "clickAnalytics", - "customRanking", "decompoundQuery", "disableExactOnAttributes", "disableTypoToleranceOnAttributes", @@ -199,9 +195,7 @@ var SearchParamsObject = []string{ "ignorePlurals", "insideBoundingBox", "insidePolygon", - "keepDiacriticsOnCharacters", "length", - "maxFacetHits", "maxValuesPerFacet", "minProximity", "minWordSizefor1Typo", @@ -251,7 +245,7 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/advancedSyntaxFeat cmd.Flags().Bool("allowTyposOnNumericTokens", true, heredoc.Doc(`Whether to allow typos on numbers in the search query. See: https://www.algolia.com/doc/api-reference/api-parameters/allowTyposOnNumericTokens/`)) cmd.Flags().SetAnnotation("allowTyposOnNumericTokens", "Categories", []string{"Typos"}) - cmd.Flags().StringSlice("alternativesAsExact", []string{"ignorePlurals", "singleWordSynonym"}, heredoc.Doc(`Alternatives of query words that should be considered as exact matches by the Exact ranking criterion. + cmd.Flags().StringSlice("alternativesAsExact", []string{"ignorePlurals", "singleWordSynonym"}, heredoc.Doc(`Determine which plurals and synonyms should be considered an exact matches. See: https://www.algolia.com/doc/api-reference/api-parameters/alternativesAsExact/`)) cmd.Flags().SetAnnotation("alternativesAsExact", "Categories", []string{"Query strategy"}) cmd.Flags().Bool("analytics", true, heredoc.Doc(`Whether this search will be included in Analytics. @@ -290,10 +284,7 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/attributesToSnippe See: https://www.algolia.com/doc/api-reference/api-parameters/clickAnalytics/`)) cmd.Flags().SetAnnotation("clickAnalytics", "Categories", []string{"Analytics"}) cmd.Flags().String("cursor", "", heredoc.Doc(`Cursor to get the next page of the response.`)) - cmd.Flags().StringSlice("customRanking", []string{}, heredoc.Doc(`Attributes to use as custom ranking. -See: https://www.algolia.com/doc/api-reference/api-parameters/customRanking/`)) - cmd.Flags().SetAnnotation("customRanking", "Categories", []string{"Ranking"}) - cmd.Flags().Bool("decompoundQuery", true, heredoc.Doc(`Whether to split compound words into their building blocks. + cmd.Flags().Bool("decompoundQuery", true, heredoc.Doc(`Whether to split compound words in the query into their building blocks. See: https://www.algolia.com/doc/api-reference/api-parameters/decompoundQuery/`)) cmd.Flags().SetAnnotation("decompoundQuery", "Categories", []string{"Languages"}) cmd.Flags().StringSlice("disableExactOnAttributes", []string{}, heredoc.Doc(`Searchable attributes for which you want to turn off the Exact ranking criterion. @@ -346,21 +337,17 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/highlightPreTag/`) cmd.Flags().Int("hitsPerPage", 20, heredoc.Doc(`Number of hits per page. See: https://www.algolia.com/doc/api-reference/api-parameters/hitsPerPage/`)) cmd.Flags().SetAnnotation("hitsPerPage", "Categories", []string{"Pagination"}) - ignorePlurals := NewJSONVar([]string{"array", "boolean"}...) + ignorePlurals := NewJSONVar([]string{"array", "string", "boolean"}...) cmd.Flags().Var(ignorePlurals, "ignorePlurals", heredoc.Doc(`Treat singular, plurals, and other forms of declensions as equivalent. See: https://www.algolia.com/doc/api-reference/api-parameters/ignorePlurals/`)) cmd.Flags().SetAnnotation("ignorePlurals", "Categories", []string{"Languages"}) - cmd.Flags().SetAnnotation("insideBoundingBox", "Categories", []string{"Geo-Search"}) + insideBoundingBox := NewJSONVar([]string{"string", "null", "array"}...) + cmd.Flags().Var(insideBoundingBox, "insideBoundingBox", heredoc.Doc(`. +See: https://www.algolia.com/doc/api-reference/api-parameters/insideBoundingBox/`)) cmd.Flags().SetAnnotation("insidePolygon", "Categories", []string{"Geo-Search"}) - cmd.Flags().String("keepDiacriticsOnCharacters", "", heredoc.Doc(`Characters for which diacritics should be preserved. -See: https://www.algolia.com/doc/api-reference/api-parameters/keepDiacriticsOnCharacters/`)) - cmd.Flags().SetAnnotation("keepDiacriticsOnCharacters", "Categories", []string{"Languages"}) cmd.Flags().Int("length", 0, heredoc.Doc(`Number of hits to retrieve (used in combination with offset). See: https://www.algolia.com/doc/api-reference/api-parameters/length/`)) cmd.Flags().SetAnnotation("length", "Categories", []string{"Pagination"}) - cmd.Flags().Int("maxFacetHits", 10, heredoc.Doc(`Maximum number of facet values to return when searching for facet values. -See: https://www.algolia.com/doc/api-reference/api-parameters/maxFacetHits/`)) - cmd.Flags().SetAnnotation("maxFacetHits", "Categories", []string{"Advanced"}) cmd.Flags().Int("maxValuesPerFacet", 100, heredoc.Doc(`Maximum number of facet values to return for each facet. See: https://www.algolia.com/doc/api-reference/api-parameters/maxValuesPerFacet/`)) cmd.Flags().SetAnnotation("maxValuesPerFacet", "Categories", []string{"Faceting"}) @@ -393,9 +380,9 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/offset/`)) cmd.Flags().Var(optionalFilters, "optionalFilters", heredoc.Doc(`Filters to promote or demote records in the search results. See: https://www.algolia.com/doc/api-reference/api-parameters/optionalFilters/`)) cmd.Flags().SetAnnotation("optionalFilters", "Categories", []string{"Filtering"}) - cmd.Flags().StringSlice("optionalWords", []string{}, heredoc.Doc(`Words that should be considered optional when found in the query. + optionalWords := NewJSONVar([]string{"string", "null", "array"}...) + cmd.Flags().Var(optionalWords, "optionalWords", heredoc.Doc(`. See: https://www.algolia.com/doc/api-reference/api-parameters/optionalWords/`)) - cmd.Flags().SetAnnotation("optionalWords", "Categories", []string{"Query strategy"}) cmd.Flags().Int("page", 0, heredoc.Doc(`Page of search results to retrieve. See: https://www.algolia.com/doc/api-reference/api-parameters/page/`)) cmd.Flags().SetAnnotation("page", "Categories", []string{"Pagination"}) @@ -493,7 +480,9 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/facetFilters/`)) cmd.Flags().String("filters", "", heredoc.Doc(`Filter expression to only include items that match the filter criteria in the response. See: https://www.algolia.com/doc/api-reference/api-parameters/filters/`)) cmd.Flags().SetAnnotation("filters", "Categories", []string{"Filtering"}) - cmd.Flags().SetAnnotation("insideBoundingBox", "Categories", []string{"Geo-Search"}) + insideBoundingBox := NewJSONVar([]string{"string", "null", "array"}...) + cmd.Flags().Var(insideBoundingBox, "insideBoundingBox", heredoc.Doc(`. +See: https://www.algolia.com/doc/api-reference/api-parameters/insideBoundingBox/`)) cmd.Flags().SetAnnotation("insidePolygon", "Categories", []string{"Geo-Search"}) numericFilters := NewJSONVar([]string{"array", "string"}...) cmd.Flags().Var(numericFilters, "numericFilters", heredoc.Doc(`Filter by numeric facets. @@ -518,7 +507,7 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/allowCompressionOf cmd.Flags().Bool("allowTyposOnNumericTokens", true, heredoc.Doc(`Whether to allow typos on numbers in the search query. See: https://www.algolia.com/doc/api-reference/api-parameters/allowTyposOnNumericTokens/`)) cmd.Flags().SetAnnotation("allowTyposOnNumericTokens", "Categories", []string{"Typos"}) - cmd.Flags().StringSlice("alternativesAsExact", []string{"ignorePlurals", "singleWordSynonym"}, heredoc.Doc(`Alternatives of query words that should be considered as exact matches by the Exact ranking criterion. + cmd.Flags().StringSlice("alternativesAsExact", []string{"ignorePlurals", "singleWordSynonym"}, heredoc.Doc(`Determine which plurals and synonyms should be considered an exact matches. See: https://www.algolia.com/doc/api-reference/api-parameters/alternativesAsExact/`)) cmd.Flags().SetAnnotation("alternativesAsExact", "Categories", []string{"Query strategy"}) cmd.Flags().Bool("attributeCriteriaComputedByMinProximity", false, heredoc.Doc(`Whether the best matching attribute should be determined by minimum proximity. @@ -551,7 +540,7 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/customNormalizatio cmd.Flags().StringSlice("customRanking", []string{}, heredoc.Doc(`Attributes to use as custom ranking. See: https://www.algolia.com/doc/api-reference/api-parameters/customRanking/`)) cmd.Flags().SetAnnotation("customRanking", "Categories", []string{"Ranking"}) - cmd.Flags().Bool("decompoundQuery", true, heredoc.Doc(`Whether to split compound words into their building blocks. + cmd.Flags().Bool("decompoundQuery", true, heredoc.Doc(`Whether to split compound words in the query into their building blocks. See: https://www.algolia.com/doc/api-reference/api-parameters/decompoundQuery/`)) cmd.Flags().SetAnnotation("decompoundQuery", "Categories", []string{"Languages"}) decompoundedAttributes := NewJSONVar([]string{}...) @@ -567,7 +556,7 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/disablePrefixOnAtt cmd.Flags().StringSlice("disableTypoToleranceOnAttributes", []string{}, heredoc.Doc(`Attributes for which you want to turn off typo tolerance. See: https://www.algolia.com/doc/api-reference/api-parameters/disableTypoToleranceOnAttributes/`)) cmd.Flags().SetAnnotation("disableTypoToleranceOnAttributes", "Categories", []string{"Typos"}) - cmd.Flags().StringSlice("disableTypoToleranceOnWords", []string{}, heredoc.Doc(`Words for which you want to turn off typo tolerance. + cmd.Flags().StringSlice("disableTypoToleranceOnWords", []string{}, heredoc.Doc(`Creates a list of words which require exact matches. See: https://www.algolia.com/doc/api-reference/api-parameters/disableTypoToleranceOnWords/`)) cmd.Flags().SetAnnotation("disableTypoToleranceOnWords", "Categories", []string{"Typos"}) distinct := NewJSONVar([]string{"boolean", "integer"}...) @@ -595,7 +584,7 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/highlightPreTag/`) cmd.Flags().Int("hitsPerPage", 20, heredoc.Doc(`Number of hits per page. See: https://www.algolia.com/doc/api-reference/api-parameters/hitsPerPage/`)) cmd.Flags().SetAnnotation("hitsPerPage", "Categories", []string{"Pagination"}) - ignorePlurals := NewJSONVar([]string{"array", "boolean"}...) + ignorePlurals := NewJSONVar([]string{"array", "string", "boolean"}...) cmd.Flags().Var(ignorePlurals, "ignorePlurals", heredoc.Doc(`Treat singular, plurals, and other forms of declensions as equivalent. See: https://www.algolia.com/doc/api-reference/api-parameters/ignorePlurals/`)) cmd.Flags().SetAnnotation("ignorePlurals", "Categories", []string{"Languages"}) @@ -626,9 +615,9 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/mode/`)) cmd.Flags().StringSlice("numericAttributesForFiltering", []string{}, heredoc.Doc(`Numeric attributes that can be used as numerical filters. See: https://www.algolia.com/doc/api-reference/api-parameters/numericAttributesForFiltering/`)) cmd.Flags().SetAnnotation("numericAttributesForFiltering", "Categories", []string{"Performance"}) - cmd.Flags().StringSlice("optionalWords", []string{}, heredoc.Doc(`Words that should be considered optional when found in the query. + optionalWords := NewJSONVar([]string{"string", "null", "array"}...) + cmd.Flags().Var(optionalWords, "optionalWords", heredoc.Doc(`. See: https://www.algolia.com/doc/api-reference/api-parameters/optionalWords/`)) - cmd.Flags().SetAnnotation("optionalWords", "Categories", []string{"Query strategy"}) cmd.Flags().Int("paginationLimitedTo", 1000, heredoc.Doc(`Maximum number of search results that can be obtained through pagination. See: https://www.algolia.com/doc/api-reference/api-parameters/paginationLimitedTo/`)) cmd.Flags().StringSlice("queryLanguages", []string{}, heredoc.Doc(`Languages for language-specific query processing steps such as plurals, stop-word removal, and word-detection dictionaries. @@ -673,7 +662,7 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/searchableAttribut cmd.Flags().SetAnnotation("searchableAttributes", "Categories", []string{"Attributes"}) semanticSearch := NewJSONVar([]string{}...) cmd.Flags().Var(semanticSearch, "semanticSearch", heredoc.Doc(`Settings for the semantic search part of NeuralSearch.`)) - cmd.Flags().String("separatorsToIndex", "", heredoc.Doc(`Controls which separators are indexed. + cmd.Flags().String("separatorsToIndex", "", heredoc.Doc(`Control which non-alphanumeric characters are indexed. See: https://www.algolia.com/doc/api-reference/api-parameters/separatorsToIndex/`)) cmd.Flags().SetAnnotation("separatorsToIndex", "Categories", []string{"Typos"}) cmd.Flags().String("snippetEllipsisText", "…", heredoc.Doc(`String used as an ellipsis indicator when a snippet is truncated. @@ -705,7 +694,7 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/advancedSyntaxFeat cmd.Flags().Bool("allowTyposOnNumericTokens", true, heredoc.Doc(`Whether to allow typos on numbers in the search query. See: https://www.algolia.com/doc/api-reference/api-parameters/allowTyposOnNumericTokens/`)) cmd.Flags().SetAnnotation("allowTyposOnNumericTokens", "Categories", []string{"Typos"}) - cmd.Flags().StringSlice("alternativesAsExact", []string{"ignorePlurals", "singleWordSynonym"}, heredoc.Doc(`Alternatives of query words that should be considered as exact matches by the Exact ranking criterion. + cmd.Flags().StringSlice("alternativesAsExact", []string{"ignorePlurals", "singleWordSynonym"}, heredoc.Doc(`Determine which plurals and synonyms should be considered an exact matches. See: https://www.algolia.com/doc/api-reference/api-parameters/alternativesAsExact/`)) cmd.Flags().SetAnnotation("alternativesAsExact", "Categories", []string{"Query strategy"}) cmd.Flags().Bool("analytics", true, heredoc.Doc(`Whether this search will be included in Analytics. @@ -743,10 +732,7 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/attributesToSnippe cmd.Flags().Bool("clickAnalytics", false, heredoc.Doc(`Whether to include a queryID attribute in the response. See: https://www.algolia.com/doc/api-reference/api-parameters/clickAnalytics/`)) cmd.Flags().SetAnnotation("clickAnalytics", "Categories", []string{"Analytics"}) - cmd.Flags().StringSlice("customRanking", []string{}, heredoc.Doc(`Attributes to use as custom ranking. -See: https://www.algolia.com/doc/api-reference/api-parameters/customRanking/`)) - cmd.Flags().SetAnnotation("customRanking", "Categories", []string{"Ranking"}) - cmd.Flags().Bool("decompoundQuery", true, heredoc.Doc(`Whether to split compound words into their building blocks. + cmd.Flags().Bool("decompoundQuery", true, heredoc.Doc(`Whether to split compound words in the query into their building blocks. See: https://www.algolia.com/doc/api-reference/api-parameters/decompoundQuery/`)) cmd.Flags().SetAnnotation("decompoundQuery", "Categories", []string{"Languages"}) cmd.Flags().StringSlice("disableExactOnAttributes", []string{}, heredoc.Doc(`Searchable attributes for which you want to turn off the Exact ranking criterion. @@ -799,21 +785,17 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/highlightPreTag/`) cmd.Flags().Int("hitsPerPage", 20, heredoc.Doc(`Number of hits per page. See: https://www.algolia.com/doc/api-reference/api-parameters/hitsPerPage/`)) cmd.Flags().SetAnnotation("hitsPerPage", "Categories", []string{"Pagination"}) - ignorePlurals := NewJSONVar([]string{"array", "boolean"}...) + ignorePlurals := NewJSONVar([]string{"array", "string", "boolean"}...) cmd.Flags().Var(ignorePlurals, "ignorePlurals", heredoc.Doc(`Treat singular, plurals, and other forms of declensions as equivalent. See: https://www.algolia.com/doc/api-reference/api-parameters/ignorePlurals/`)) cmd.Flags().SetAnnotation("ignorePlurals", "Categories", []string{"Languages"}) - cmd.Flags().SetAnnotation("insideBoundingBox", "Categories", []string{"Geo-Search"}) + insideBoundingBox := NewJSONVar([]string{"string", "null", "array"}...) + cmd.Flags().Var(insideBoundingBox, "insideBoundingBox", heredoc.Doc(`. +See: https://www.algolia.com/doc/api-reference/api-parameters/insideBoundingBox/`)) cmd.Flags().SetAnnotation("insidePolygon", "Categories", []string{"Geo-Search"}) - cmd.Flags().String("keepDiacriticsOnCharacters", "", heredoc.Doc(`Characters for which diacritics should be preserved. -See: https://www.algolia.com/doc/api-reference/api-parameters/keepDiacriticsOnCharacters/`)) - cmd.Flags().SetAnnotation("keepDiacriticsOnCharacters", "Categories", []string{"Languages"}) cmd.Flags().Int("length", 0, heredoc.Doc(`Number of hits to retrieve (used in combination with offset). See: https://www.algolia.com/doc/api-reference/api-parameters/length/`)) cmd.Flags().SetAnnotation("length", "Categories", []string{"Pagination"}) - cmd.Flags().Int("maxFacetHits", 10, heredoc.Doc(`Maximum number of facet values to return when searching for facet values. -See: https://www.algolia.com/doc/api-reference/api-parameters/maxFacetHits/`)) - cmd.Flags().SetAnnotation("maxFacetHits", "Categories", []string{"Advanced"}) cmd.Flags().Int("maxValuesPerFacet", 100, heredoc.Doc(`Maximum number of facet values to return for each facet. See: https://www.algolia.com/doc/api-reference/api-parameters/maxValuesPerFacet/`)) cmd.Flags().SetAnnotation("maxValuesPerFacet", "Categories", []string{"Faceting"}) @@ -846,9 +828,9 @@ See: https://www.algolia.com/doc/api-reference/api-parameters/offset/`)) cmd.Flags().Var(optionalFilters, "optionalFilters", heredoc.Doc(`Filters to promote or demote records in the search results. See: https://www.algolia.com/doc/api-reference/api-parameters/optionalFilters/`)) cmd.Flags().SetAnnotation("optionalFilters", "Categories", []string{"Filtering"}) - cmd.Flags().StringSlice("optionalWords", []string{}, heredoc.Doc(`Words that should be considered optional when found in the query. + optionalWords := NewJSONVar([]string{"string", "null", "array"}...) + cmd.Flags().Var(optionalWords, "optionalWords", heredoc.Doc(`. See: https://www.algolia.com/doc/api-reference/api-parameters/optionalWords/`)) - cmd.Flags().SetAnnotation("optionalWords", "Categories", []string{"Query strategy"}) cmd.Flags().Int("page", 0, heredoc.Doc(`Page of search results to retrieve. See: https://www.algolia.com/doc/api-reference/api-parameters/page/`)) cmd.Flags().SetAnnotation("page", "Categories", []string{"Pagination"})