-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(specs): add recommend batch rules endpoint (#3782)
Co-authored-by: Pierre Millot <pierre.millot@algolia.com> Co-authored-by: Clément Vannicatte <vannicattec@gmail.com>
- Loading branch information
1 parent
1d95849
commit dc28c02
Showing
10 changed files
with
133 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
$ref: './common.yml#/recommendUpdatedAtResponse' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
taskID: | ||
type: integer | ||
format: int64 | ||
example: 1514562690001 | ||
description: | | ||
Unique identifier of a task. | ||
A successful API response means that a task was added to a queue. It might not run immediately. You can check the task's progress with the [`task` operation](#tag/Indices/operation/getTask) and this `taskID`. | ||
updatedAt: | ||
type: string | ||
example: 2023-07-04T12:49:15Z | ||
description: Date and time when the object was updated, in RFC 3339 format. | ||
|
||
recommendUpdatedAtResponse: | ||
type: object | ||
description: Response, taskID, and update timestamp. | ||
additionalProperties: false | ||
required: | ||
- taskID | ||
- updatedAt | ||
properties: | ||
taskID: | ||
$ref: '#/taskID' | ||
updatedAt: | ||
$ref: '#/updatedAt' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
post: | ||
tags: | ||
- rules | ||
operationId: batchRecommendRules | ||
x-acl: | ||
- editSettings | ||
summary: Create or update a batch of Recommend Rules | ||
description: | | ||
Create or update a batch of Recommend Rules | ||
Each Recommend Rule is created or updated, depending on whether a Recommend Rule with the same `objectID` already exists. | ||
You may also specify `true` for `clearExistingRules`, in which case the batch will atomically replace all the existing Recommend Rules. | ||
Recommend Rules are similar to Search Rules, except that the conditions and consequences apply to a [source item](/doc/guides/algolia-recommend/overview/#recommend-models) instead of a query. The main differences are the following: | ||
- Conditions `pattern` and `anchoring` are unavailable. | ||
- Condition `filters` triggers if the source item matches the specified filters. | ||
- Condition `filters` accepts numeric filters. | ||
- Consequence `params` only covers filtering parameters. | ||
- Consequence `automaticFacetFilters` doesn't require a facet value placeholder (it tries to match the data source item's attributes instead). | ||
parameters: | ||
- $ref: '../../common/parameters.yml#/IndexName' | ||
- $ref: '../common/parameters.yml#/Models' | ||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
title: rules | ||
type: array | ||
description: Recommend rules. | ||
additionalProperties: false | ||
items: | ||
$ref: '../common/schemas/RecommendRule.yml#/RecommendRule' | ||
|
||
responses: | ||
'200': | ||
$ref: '../common/responses/RecommendUpdatedAt.yml' | ||
'400': | ||
$ref: '../../common/responses/BadRequest.yml' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[ | ||
{ | ||
"testName": "batch recommend rules", | ||
"parameters": { | ||
"indexName": "indexName", | ||
"model": "related-products" | ||
}, | ||
"request": { | ||
"path": "/1/indexes/indexName/related-products/recommend/rules/batch", | ||
"method": "POST", | ||
"body": {} | ||
} | ||
} | ||
] |