diff --git a/specs/query-suggestions/common/enums.yml b/specs/query-suggestions/common/enums.yml index 27a016357f..ed442b3662 100644 --- a/specs/query-suggestions/common/enums.yml +++ b/specs/query-suggestions/common/enums.yml @@ -2,7 +2,7 @@ LogLevel: title: level type: string description: | - The type of log entry. + Type of log entry. - `SKIP`. A query is skipped because it doesn't match the conditions for successful inclusion. For example, when a query doesn't generate enough search results. - `INFO`. An informative log entry. diff --git a/specs/query-suggestions/common/responses/BadRequest.yml b/specs/query-suggestions/common/responses/BadRequest.yml index c51ea033fb..674dd806c0 100644 --- a/specs/query-suggestions/common/responses/BadRequest.yml +++ b/specs/query-suggestions/common/responses/BadRequest.yml @@ -2,31 +2,33 @@ description: Bad Request. content: application/json: schema: - $ref: '../schemas/BaseResponse.yml' + $ref: './BaseResponse.yml' examples: IndexNameRequired: summary: Index name required. - value: {'status': 400, 'message': 'IndexName cannot be empty'} + value: + status: 400 + message: IndexName cannot be empty. SourceIndicesRequired: summary: Source indices required. value: - 'status': 400 - 'message': 'Invalid body "sourceIndices needs to contain at least one index".' - + status: 400 + message: Invalid body "sourceIndices needs to contain at least one index". + SourceIndexNameRequired: summary: Source index name required. value: - 'status': 400 - 'message': 'Invalid body "every source index must have an `indexName`".' - + status: 400 + message: Invalid body "every source index must have an `indexName`". + MinHitsPositive: summary: MinHits must be positive. value: - 'status': 400 - 'message': 'Invalid body "every source index `minHits` must be positive".' - + status: 400 + message: Invalid body "every source index `minHits` must be positive". + MinLettersPositive: summary: MinLetters must be positive. value: - 'status': 400 - 'message': 'Invalid body "every source index `minLetters` must be positive".' + status: 400 + message: Invalid body "every source index `minLetters` must be positive". diff --git a/specs/query-suggestions/common/schemas/BaseResponse.yml b/specs/query-suggestions/common/responses/BaseResponse.yml similarity index 86% rename from specs/query-suggestions/common/schemas/BaseResponse.yml rename to specs/query-suggestions/common/responses/BaseResponse.yml index 79f3b3476d..d7e894e1f8 100644 --- a/specs/query-suggestions/common/schemas/BaseResponse.yml +++ b/specs/query-suggestions/common/responses/BaseResponse.yml @@ -1,5 +1,4 @@ type: object -additionalProperties: false properties: status: type: integer diff --git a/specs/query-suggestions/common/responses/InternalError.yml b/specs/query-suggestions/common/responses/InternalError.yml index d09246b86f..80285904c8 100644 --- a/specs/query-suggestions/common/responses/InternalError.yml +++ b/specs/query-suggestions/common/responses/InternalError.yml @@ -2,8 +2,10 @@ description: Internal Server Error. content: application/json: schema: - $ref: '../schemas/BaseResponse.yml' + $ref: './BaseResponse.yml' examples: Error: description: This error can happen if you use a non-existing `indexName` as a path parameter when trying to update or delete a Query Suggestions configuration. - value: {'status': 500, 'message': 'Internal Server Error'} + value: + status: 500 + message: Internal Server Error diff --git a/specs/query-suggestions/common/responses/NotFound.yml b/specs/query-suggestions/common/responses/NotFound.yml index 20d6fa1237..98c025b5d7 100644 --- a/specs/query-suggestions/common/responses/NotFound.yml +++ b/specs/query-suggestions/common/responses/NotFound.yml @@ -2,8 +2,10 @@ description: Not Found. content: application/json: schema: - $ref: '../schemas/BaseResponse.yml' + $ref: './BaseResponse.yml' examples: NotFound: summary: Index not found. - value: {'status': 404, 'message': 'Not Found'} + value: + status: 404 + message: Not Found diff --git a/specs/query-suggestions/common/responses/QuerySuggestionsConfigurationResponse.yml b/specs/query-suggestions/common/responses/QuerySuggestionsConfigurationResponse.yml new file mode 100644 index 0000000000..ea37a9b918 --- /dev/null +++ b/specs/query-suggestions/common/responses/QuerySuggestionsConfigurationResponse.yml @@ -0,0 +1,20 @@ +QuerySuggestionsConfigurationResponse: + type: object + description: API response for retrieving Query Suggestions configurations. + allOf: + - $ref: '#/AppID' + - $ref: '../schemas/QuerySuggestionsConfiguration.yml#/QuerySuggestionsConfigurationWithIndex' + required: + - appID + - allowSpecialCharacters + - enablePersonalization + - exclude + - languages + - sourceIndices + +AppID: + type: object + properties: + appID: + type: string + description: Algolia application ID to which this Query Suggestions configuration belongs. diff --git a/specs/query-suggestions/common/responses/Unauthorized.yml b/specs/query-suggestions/common/responses/Unauthorized.yml index 1dd736fb5e..a2a46d4ae8 100644 --- a/specs/query-suggestions/common/responses/Unauthorized.yml +++ b/specs/query-suggestions/common/responses/Unauthorized.yml @@ -2,24 +2,27 @@ description: Unauthorized content: application/json: schema: - $ref: '../schemas/BaseResponse.yml' + $ref: './BaseResponse.yml' examples: Unauthorized: summary: Wrong region. description: | - Make sure to make your request to the server corresponding to your region. + Make sure to make your request to the server corresponding to your region. You can check the region for your application in the [Algolia dashboard](https://dashboard.algolia.com/account/infrastructure/analytics). value: - 'status': 401 - 'message': 'The log processing region does not match' - + status: 401 + message: The log processing region does not match. + InvalidCredentials: summary: Invalid credentials. description: Your application ID or API key is wrong. - value: {'status': 401, 'message': 'Invalid credentials'} + value: + status: 401 + message: Invalid credentials MissingACL: summary: Key is missing ACL. description: Your API key is missing the required ACL for this operation. value: - {'status': 401, 'message': 'The provided API key is missing the \"editSettings\" ACL'} + status: 401 + message: The provided API key is missing the \"editSettings\" ACL. diff --git a/specs/query-suggestions/common/responses/UnprocessableEntity.yml b/specs/query-suggestions/common/responses/UnprocessableEntity.yml index 77c5f26268..d83c7a4796 100644 --- a/specs/query-suggestions/common/responses/UnprocessableEntity.yml +++ b/specs/query-suggestions/common/responses/UnprocessableEntity.yml @@ -2,10 +2,10 @@ description: Unprocessable Entity. content: application/json: schema: - $ref: '../schemas/BaseResponse.yml' + $ref: './BaseResponse.yml' examples: UnprocessableEntity: summary: Configuration already exists. - value: - 'status': 422 - 'message': 'Configuration already exists for index: test-qs' + value: + status: 422 + message: 'Configuration already exists for index: test-qs' diff --git a/specs/query-suggestions/common/schemas/Facet.yml b/specs/query-suggestions/common/schemas/Facet.yml deleted file mode 100644 index 349c6fe701..0000000000 --- a/specs/query-suggestions/common/schemas/Facet.yml +++ /dev/null @@ -1,11 +0,0 @@ -title: facet -description: Facet to use as category. -type: object -additionalProperties: false -properties: - attribute: - type: string - description: Facet name. - amount: - type: integer - description: Number of suggestions. diff --git a/specs/query-suggestions/common/schemas/Languages.yml b/specs/query-suggestions/common/schemas/Languages.yml deleted file mode 100644 index b7cfaa4a64..0000000000 --- a/specs/query-suggestions/common/schemas/Languages.yml +++ /dev/null @@ -1,10 +0,0 @@ -title: languages -description: | - Set the language for deduplicating singular and plural suggestions. - If specified, only the more popular form is included. -oneOf: - - type: array - items: - type: string - - type: boolean - default: false diff --git a/specs/query-suggestions/common/schemas/QuerySuggestionsConfiguration.yml b/specs/query-suggestions/common/schemas/QuerySuggestionsConfiguration.yml index 746bfc446a..73a79c4081 100644 --- a/specs/query-suggestions/common/schemas/QuerySuggestionsConfiguration.yml +++ b/specs/query-suggestions/common/schemas/QuerySuggestionsConfiguration.yml @@ -1,25 +1,184 @@ -type: object -description: Query Suggestions configuration. -additionalProperties: false -required: - - sourceIndices -properties: - sourceIndices: - $ref: './SourceIndices.yml' - languages: - $ref: './Languages.yml' - exclude: - oneOf: - - type: array - description: Patterns to exclude from query suggestions. +QuerySuggestionsConfigurationWithIndex: + type: object + description: Query Suggestions configuration. + required: + - indexName + - sourceIndices + allOf: + - type: object + properties: + indexName: + $ref: './QuerySuggestionsIndexName.yml' + - $ref: '#/QuerySuggestionsConfiguration' + +QuerySuggestionsConfiguration: + type: object + description: Query Suggestions configuration. + required: + - sourceIndices + properties: + sourceIndices: + type: array + description: Algolia indices from which to get the popular searches for query suggestions. + minItems: 1 + items: + $ref: '#/SourceIndex' + languages: + $ref: '#/Languages' + exclude: + $ref: '#/Exclude' + enablePersonalization: + type: boolean + default: false + description: Whether to turn on personalized query suggestions. + allowSpecialCharacters: + type: boolean + default: false + description: Whether to include suggestions with special characters. + +Exclude: + title: exclude + description: Words or regular expressions to exclude from the suggestions. + default: null + oneOf: + - type: array + items: + type: string + - type: 'null' + +Languages: + title: languages + description: | + Languages for deduplicating singular and plural suggestions. + If specified, only the more popular form is included. + default: false + oneOf: + - type: array + description: Languages for which to deduplicate singular and plural forms. + items: + type: string + description: Two-letter country code. + - type: boolean + description: If true, deduplication is enabled for all languages. + +SourceIndex: + type: object + description: Configuration of an Algolia index for Query Suggestions. + required: + - indexName + properties: + indexName: + type: string + description: Name of the Algolia index to use as source for query suggestions. + example: products + replicas: + type: boolean + default: false + description: | + If true, Query Suggestions uses all replica indices to find popular searches. + If false, only the primary index is used. + example: false + analyticsTags: + $ref: '#/AnalyticsTags' + facets: + $ref: '#/Facets' + minHits: + type: integer + minimum: 0 + default: 5 + description: | + Minimum number of hits required to be included as a suggestion. + + A search query must at least generate `minHits` search results to be included in the Query Suggestions index. + minLetters: + type: integer + minimum: 0 + default: 4 + description: | + Minimum letters required to be included as a suggestion. + + A search query must be at least `minLetters` long to be included in the Query Suggestions index. + generate: + $ref: '#/Generate' + external: + $ref: '#/External' + +AnalyticsTags: + title: analyticsTags + description: | + Analytics tags for filtering the popular searches. + For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/). + default: null + oneOf: + - type: array + items: + type: string + - type: 'null' + +Facets: + title: facets + description: | + Facets to use as top categories with your suggestions. + + If provided, Query Suggestions adds the top facet values to each suggestion. + default: null + oneOf: + - type: array + items: + $ref: '#/Facet' + - type: 'null' + example: + - attribute: category + amount: 3 + - attribute: brand + amount: 2 + +Facet: + type: object + description: Facet to use as category. + properties: + attribute: + type: string + description: Facet name. + amount: + type: integer + description: Number of suggestions. + +Generate: + title: generate + description: | + Facets used for generating query suggestions from facet values. + + For example, if you set `generate: ["color", "brand"]`, combinations from the facet values are added as query suggestions, + such as "blue adidas", "red adidas", "blue nike", "red nike", etc. + + You can include nested lists. + default: null + oneOf: + - type: array + items: + type: array items: type: string - - type: 'null' - enablePersonalization: - type: boolean - default: false - description: Turn on personalized query suggestions. - allowSpecialCharacters: - type: boolean - default: false - description: Allow suggestions with special characters. + - type: 'null' + example: + - [color, brand] + +External: + description: | + Algolia indices with popular searches to use as query suggestions. + + Records of these indices must have these attributes: + + - `query`: search query which will be added as a suggestion + - `count`: measure of popularity of that search query + + For example, you can export popular searches from an external analytics provider, such as Google Analytics or Adobe Analytics, + and feed this data into an Algolia index. + You can use this index to generate query suggestions until your Algolia Analytics has collected enough data. + default: null + oneOf: + - type: array + items: + type: string + - type: 'null' diff --git a/specs/query-suggestions/common/schemas/QuerySuggestionsConfigurationResponse.yml b/specs/query-suggestions/common/schemas/QuerySuggestionsConfigurationResponse.yml deleted file mode 100644 index a58ecde544..0000000000 --- a/specs/query-suggestions/common/schemas/QuerySuggestionsConfigurationResponse.yml +++ /dev/null @@ -1,20 +0,0 @@ -QuerySuggestionsConfigurationResponse: - type: object - allOf: - - $ref: '#/baseQuerySuggestionsConfigurationResponse' - - $ref: './QuerySuggestionsConfigurationWithIndex.yml#/QuerySuggestionsConfigurationWithIndex' - -baseQuerySuggestionsConfigurationResponse: - type: object - additionalProperties: false - properties: - sourceIndicesAPIKey: - type: string - description: API key used to read from your source index. - suggestionsIndicesAPIKey: - type: string - description: API key used to write and configure your Query Suggestions index. - externalIndicesAPIKey: - type: string - default: '' - description: API key used to read from external Algolia indices. diff --git a/specs/query-suggestions/common/schemas/QuerySuggestionsConfigurationWithIndex.yml b/specs/query-suggestions/common/schemas/QuerySuggestionsConfigurationWithIndex.yml deleted file mode 100644 index 5777c95a14..0000000000 --- a/specs/query-suggestions/common/schemas/QuerySuggestionsConfigurationWithIndex.yml +++ /dev/null @@ -1,18 +0,0 @@ -QuerySuggestionsConfigurationWithIndex: - type: object - description: Query Suggestions configuration. - required: - - indexName - - sourceIndices - allOf: - - $ref: '#/baseQuerySuggestionsConfigurationWithIndex' - - $ref: './QuerySuggestionsConfiguration.yml' - -baseQuerySuggestionsConfigurationWithIndex: - type: object - additionalProperties: false - required: - - indexName - properties: - indexName: - $ref: './QuerySuggestionsIndexName.yml' diff --git a/specs/query-suggestions/common/schemas/QuerySuggestionsIndex.yml b/specs/query-suggestions/common/schemas/QuerySuggestionsIndex.yml deleted file mode 100644 index 01f1c9d6b2..0000000000 --- a/specs/query-suggestions/common/schemas/QuerySuggestionsIndex.yml +++ /dev/null @@ -1,62 +0,0 @@ -QuerySuggestionsIndex: - type: object - additionalProperties: false - required: - - indexName - - sourceIndices - - languages - - exclude - properties: - indexName: - type: string - description: Index name to target. - sourceIndices: - $ref: '#/SourceIndicesWithReplicas' - languages: - type: array - items: - type: string - description: De-duplicate singular and plural suggestions. For example, let's say your index contains English content, and that two suggestions “shoe” and “shoes” end up in your Query Suggestions index. If the English language is configured, only the most popular of those two suggestions would remain. - exclude: - type: array - items: - type: string - description: List of words and patterns to exclude from the Query Suggestions index. - -SourceIndicesWithReplicas: - type: array - description: List of source indices used to generate a Query Suggestions index. - items: - $ref: '#/SourceIndexWithReplicas' - -SourceIndexWithReplicas: - type: object - additionalProperties: false - description: Source index with replicas used to generate a Query Suggestions index. - required: - - replicas - - indexName - - analyticsTags - - facets - - minHits - - minLetters - - generate - - external - properties: - replicas: - type: boolean - description: true if the Query Suggestions index is a replicas. - indexName: - $ref: '../parameters.yml#/indexName' - analyticsTags: - $ref: '../parameters.yml#/analyticsTags' - facets: - $ref: '../parameters.yml#/facets' - minHits: - $ref: '../parameters.yml#/minHits' - minLetters: - $ref: '../parameters.yml#/minLetters' - generate: - $ref: '../parameters.yml#/generate' - external: - $ref: '../parameters.yml#/external' diff --git a/specs/query-suggestions/common/schemas/QuerySuggestionsIndexName.yml b/specs/query-suggestions/common/schemas/QuerySuggestionsIndexName.yml index 6f85d52f63..eb889ad89b 100644 --- a/specs/query-suggestions/common/schemas/QuerySuggestionsIndexName.yml +++ b/specs/query-suggestions/common/schemas/QuerySuggestionsIndexName.yml @@ -1,4 +1,4 @@ title: indexName type: string -description: Query Suggestions index name. +description: Name of the Query Suggestions index. example: products_query_suggestions diff --git a/specs/query-suggestions/common/schemas/SourceIndex.yml b/specs/query-suggestions/common/schemas/SourceIndex.yml deleted file mode 100644 index 950de06145..0000000000 --- a/specs/query-suggestions/common/schemas/SourceIndex.yml +++ /dev/null @@ -1,87 +0,0 @@ -title: sourceIndex -type: object -description: Configuration of an Algolia index for Query Suggestions. -additionalProperties: false -required: - - indexName -properties: - indexName: - type: string - description: Name of the Algolia index to use as source for query suggestions. - example: products - replicas: - type: boolean - default: false - description: | - If true, Query Suggestions uses all replicas of the primary index to find popular searches. - If false, only the primary index is used. - example: false - analyticsTags: - oneOf: - - type: array - description: | - [Analytics tags](https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/) for filtering the popular searches. - items: - type: string - - type: 'null' - facets: - oneOf: - - type: array - items: - $ref: './Facet.yml' - description: | - Facets to use as top categories with your suggestions. - - If provided, Query Suggestions adds the top facet values to each suggestion. - example: - - {'attribute': 'category', 'amount': 3} - - {'attribute': 'brand', 'amount': 2} - - - type: 'null' - minHits: - type: integer - minimum: 0 - default: 5 - description: | - Minimum number of hits required to be included as a suggestion. - - A search query must at least generate `minHits` hits to be included in the Query Suggestions index. - minLetters: - type: integer - minimum: 0 - default: 4 - description: | - Minimum letters required to be included as a suggestion. - - A search query must be at least `minLetters` long to be included in the Query Suggestions index. - generate: - type: array - items: - type: array - items: - type: string - description: | - Facets used for generating query suggestions from facet values. - - For example, if you set `generate: ["color", "brand"]`, combinations from the facet values are added as query suggestions, - such as "blue adidas", "red adidas", "blue nike", "red nike", etc. - - You can include nested lists. - example: ['color', 'brand'] - external: - oneOf: - - type: array - items: - type: string - description: | - Algolia indices with popular searches to use as query suggestions. - - Records of these indices must have these attributes: - - - `query`: search query which will be added as a suggestion - - `count`: measure of popularity of that search query - - For example, you can export popular searches from an external analytics tool, such as Google Analytics or Adobe Analytics, - and feed this data into an external Algolia index. - You can use this external index to generate query suggestions until your Algolia analytics has collected enough data. - - type: 'null' diff --git a/specs/query-suggestions/common/schemas/SourceIndices.yml b/specs/query-suggestions/common/schemas/SourceIndices.yml deleted file mode 100644 index d99954fe66..0000000000 --- a/specs/query-suggestions/common/schemas/SourceIndices.yml +++ /dev/null @@ -1,6 +0,0 @@ -title: sourceIndices -type: array -description: Algolia indices from which to get the popular searches for query suggestions. -minItems: 1 -items: - $ref: './SourceIndex.yml' diff --git a/specs/query-suggestions/paths/getConfigurationStatus.yml b/specs/query-suggestions/paths/getConfigurationStatus.yml index 3ce4ddd90a..9679e60a33 100644 --- a/specs/query-suggestions/paths/getConfigurationStatus.yml +++ b/specs/query-suggestions/paths/getConfigurationStatus.yml @@ -4,8 +4,8 @@ get: operationId: getConfigStatus x-acl: - settings - summary: Get configuration status. - description: Report the status of a Query Suggestions index. + summary: Retrieve configuration status. + description: Reports the status of a Query Suggestions index. parameters: - $ref: '../common/parameters.yml#/IndexName' responses: @@ -21,7 +21,7 @@ get: $ref: '../common/schemas/QuerySuggestionsIndexName.yml' isRunning: type: boolean - description: Indicates whether the creation or update of the Query Suggestions is in progress. + description: Whether the creation or update of the Query Suggestions index is in progress. example: false lastBuiltAt: type: string diff --git a/specs/query-suggestions/paths/getLogFile.yml b/specs/query-suggestions/paths/getLogFile.yml index 0c86eb2e44..03d16061a7 100644 --- a/specs/query-suggestions/paths/getLogFile.yml +++ b/specs/query-suggestions/paths/getLogFile.yml @@ -4,8 +4,8 @@ get: operationId: getLogFile x-acl: - settings - summary: Get logs. - description: Get the logs for a single Query Suggestions index. + summary: Retrieve logs. + description: Retrieves the logs for a single Query Suggestions index. parameters: - $ref: '../common/parameters.yml#/IndexName' responses: @@ -30,7 +30,7 @@ get: contextLevel: type: integer description: | - Level indicating the position of a suggestion in a hierarchy of records. + Level indicating the position of a suggestion in a hierarchy of records. For example, a `contextLevel` of 1 indicates that this suggestion belongs to a previous suggestion with `contextLevel` 0. example: 1 diff --git a/specs/query-suggestions/paths/qsConfig.yml b/specs/query-suggestions/paths/qsConfig.yml index 0e8108466c..66aa6362f9 100644 --- a/specs/query-suggestions/paths/qsConfig.yml +++ b/specs/query-suggestions/paths/qsConfig.yml @@ -4,8 +4,8 @@ get: operationId: getConfig x-acl: - settings - summary: Get a configuration. - description: Get a single Query Suggestions configuration. + summary: Retrieve a configuration. + description: Retrieves a single Query Suggestions configuration by its index name. parameters: - $ref: '../common/parameters.yml#/IndexName' responses: @@ -14,7 +14,7 @@ get: content: application/json: schema: - $ref: '../common/schemas/QuerySuggestionsConfigurationResponse.yml#/QuerySuggestionsConfigurationResponse' + $ref: '../common/responses/QuerySuggestionsConfigurationResponse.yml#/QuerySuggestionsConfigurationResponse' '400': $ref: '../common/responses/BadRequest.yml' '401': @@ -29,7 +29,7 @@ put: x-acl: - editSettings summary: Update a configuration. - description: Update a QuerySuggestions configuration. + description: Updates a QuerySuggestions configuration. parameters: - $ref: '../common/parameters.yml#/IndexName' requestBody: @@ -37,21 +37,21 @@ put: content: application/json: schema: - $ref: '../common/schemas/QuerySuggestionsConfiguration.yml' + $ref: '../common/schemas/QuerySuggestionsConfiguration.yml#/QuerySuggestionsConfiguration' responses: '200': description: OK content: application/json: schema: - $ref: '../common/schemas/BaseResponse.yml' + $ref: '../common/responses/BaseResponse.yml' examples: Created: summary: Configuration created. value: 'status': 200 'message': 'Configuration was updated, and a new indexing job has been scheduled.' - + '401': $ref: '../common/responses/Unauthorized.yml' '500': @@ -65,10 +65,10 @@ delete: - editSettings summary: Delete a configuration. description: | - Delete a Query Suggestions configuration. + Deletes a Query Suggestions configuration. Deleting only removes the configuration and stops updates to the Query Suggestions index. - The Query Suggestions index itself is not deleted. + To delete the Query Suggestions index itself, use the Search API and the [Delete an index](/specs/search#tag/Indices/operation/deleteIndex) operation. parameters: - $ref: '../common/parameters.yml#/IndexName' responses: @@ -77,14 +77,14 @@ delete: content: application/json: schema: - $ref: '#/components/schemas/BaseResponse' + $ref: '../common/responses/BaseResponse.yml' examples: Created: summary: Configuration created. value: 'status': 200 'message': 'Configuration was deleted with success.' - + '401': $ref: '../common/responses/Unauthorized.yml' '500': diff --git a/specs/query-suggestions/paths/qsConfigs.yml b/specs/query-suggestions/paths/qsConfigs.yml index 6ee29c4ecb..95581265f1 100644 --- a/specs/query-suggestions/paths/qsConfigs.yml +++ b/specs/query-suggestions/paths/qsConfigs.yml @@ -5,7 +5,7 @@ get: x-acl: - settings summary: List configurations. - description: List all Query Suggestions configurations of your Algolia application. + description: Retrieves all Query Suggestions configurations of your Algolia application. responses: '200': description: OK @@ -14,7 +14,7 @@ get: schema: type: array items: - $ref: '../common/schemas/QuerySuggestionsConfigurationResponse.yml#/QuerySuggestionsConfigurationResponse' + $ref: '../common/responses/QuerySuggestionsConfigurationResponse.yml#/QuerySuggestionsConfigurationResponse' '401': $ref: '../common/responses/Unauthorized.yml' @@ -26,7 +26,7 @@ post: - editSettings summary: Create a configuration. description: | - Create a new Query Suggestions configuration. + Creates a new Query Suggestions configuration. You can have up to 100 configurations per Algolia application. requestBody: @@ -34,20 +34,20 @@ post: content: application/json: schema: - $ref: '../common/schemas/QuerySuggestionsConfigurationWithIndex.yml#/QuerySuggestionsConfigurationWithIndex' + $ref: '../common/schemas/QuerySuggestionsConfiguration.yml#/QuerySuggestionsConfigurationWithIndex' responses: '200': description: OK content: application/json: schema: - $ref: '../common/schemas/BaseResponse.yml' + $ref: '../common/responses/BaseResponse.yml' examples: Created: summary: Configuration created. value: - 'status': 200 - 'message': 'Configuration was created, and a new indexing job has been scheduled.' + status: 200 + message: Configuration was created, and a new indexing job has been scheduled. '400': $ref: '../common/responses/BadRequest.yml' '401': diff --git a/specs/query-suggestions/spec.yml b/specs/query-suggestions/spec.yml index db09eb03f1..275dd1da19 100644 --- a/specs/query-suggestions/spec.yml +++ b/specs/query-suggestions/spec.yml @@ -2,9 +2,52 @@ openapi: 3.0.2 info: title: Query Suggestions API description: | - The Query Suggestions API lets you manage Algolia's Query Suggestions configurations. - Query Suggestions add new indices with popular search queries, external suggestions, or facet values to your Algolia application. + The Query Suggestions API lets you manage your Query Suggestions configurations. + Query Suggestions add new indices to your Algolia application with popular search queries, external suggestions, or facet values. In your user interface, you can query the Query Suggestions indices like regular indices and add [suggested searches](https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/query-suggestions/js/) to guide users and speed up their search. + + # Base URLs + + The base URLs for making requests to the Query Suggestions API are: + + - `https://query-suggestions.us.algolia.com` + - `https://query-suggestions.eu.algolia.com` + + Use the URL that matches your [analytics region](https://dashboard.algolia.com/account/infrastructure/analytics). + + **All requests must use HTTPS.** + + # Authentication + + To authenticate your API requests, add these headers: + +
+
x-algolia-application-id
+
Your Algolia application ID.
+
x-algolia-api-key
+
+ An API key with the necessary permissions to make the request. + The required access control list (ACL) to make a request is listed in each endpoint's reference. +
+
+ + You can find your application ID and API key in the [Algolia dashboard](https://dashboard.algolia.com/account). + + # Request format + + Request bodies must be JSON objects. + + # Response status and errors + + Response bodies are JSON objects. + Deleting a user token returns an empty response body with rate-limiting information as headers. + + Successful responses return a `2xx` status. Client errors return a `4xx` status. Server errors are indicated by a `5xx` status. + Error responses have a `message` property with more information. + + # Version + + The current version of the Query Suggestions API is version 1, as indicated by the `/1/` in each endpoint's URL. version: 1.0.0 components: securitySchemes: @@ -33,7 +76,7 @@ tags: - name: logs x-displayName: Logs description: Get logs for a Query Suggestions index. -x-tagGroups: +x-tagGroups: - name: Configurations tags: - configurations diff --git a/tests/CTS/requests/query-suggestions/getConfig.json b/tests/CTS/requests/query-suggestions/getConfig.json index dcf55f17f5..ca9dcf1820 100644 --- a/tests/CTS/requests/query-suggestions/getConfig.json +++ b/tests/CTS/requests/query-suggestions/getConfig.json @@ -11,6 +11,7 @@ "response": { "statusCode": 200, "body": { + "appID": "T8JK9S7I7X", "allowSpecialCharacters": true, "enablePersonalization": false, "exclude": [