algolia / algolia/algoliasearch-client-python
feat(rules): Client side information consequence in rules
- 主要言語
- Python
- スター
- 207
- フォーク
- 63
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
**Summary**
With the release of the merchandising UI, the need to control UI aspects using the QR is growing and the rules API needs to expose fields to store information to perform specific client side tasks in a structured way.
The new consequence `consequence.renderingContent` contains a json object where each top level attribute is restricted to known use cases. The currently identified use cases are:
- Redirect
- Facet merchandising / ordering
- User defined data
Each top level excepted the `userData` one have a schema which is enforced and strict and customers can add metadata using the `userData` object:
```json
{
"condition": {
"anchoring": "is",
"pattern": "samsung"
},
"consequence": {
"renderingContent": {
"redirect": {
"url": "https://algolia.com/samsung" // required by the API
},
"facetMerchandising": {
"order": [ "brand", "price"] // required by the API
},
"userData": {
"callback": "displayBrand(samsung)" // optional field defined by user
}
}
}
}
```
This information will be returned in a structured way in the path `rules.consequence` of the search response:
```json
{
"hits": [...],
[...],
"query": "samsung",
"rules": {
"consequence": {
"renderingContent": [ // Array containing the content of matching rules
{
"facetMerchandising": {
"order": [
"brand",
"price"
]
},
"redirect": {
"url": "https://algolia.com/samsung"
},
"userData": {
"callback": "displayBrand(samsung)"
}
}
]
}
},
"userData": [ // Legacy userData
{
"myUserData": {}
}
]
}
```
Internal specs issue: [#152](https://github.com/algolia/algoliasearch-client-specs-internal/issues/152)
コントリビューションガイド
調査の方向性
内部の specs issue #152 から始め、検索レスポンス内で rules.consequence がどのように表現されているかを追跡します。strict fields とメタデータを含む redirect、facetMerchandising、userData の構造が、issue で説明されている renderingContent 配列として公開されていることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- api, backend
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100