algolia / algolia/algoliasearch-client-python

feat(rules): Client side information consequence in rules

Đang mở
#518 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
207
Fork
63
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

**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)

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu với specs issue nội bộ #152 và theo dõi cách rules.consequence được biểu diễn trong các phản hồi tìm kiếm. Xác nhận rằng các cấu trúc redirect, facetMerchandising và userData, bao gồm các trường strict và metadata, được cung cấp dưới dạng mảng renderingContent được mô tả trong issue.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
api, backend
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.