feat(rules): Client side information consequence in rules

Đang mở
#729 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

  • #730 của @aallam — đã đóng, không merge

Đánh giá

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

Hướng nghiên cứu

Bắt đầu với specs issue nội bộ được liên kết #152, sau đó lần theo cách rules.consequence được biểu diễn trong search response của Java client. Công việc được xem là hoàn tất khi client expose renderingContent với các cấu trúc redirect, facetMerchandising và userData được mô tả trong issue, bao gồm các trường bắt buộc và response shape đã nêu.

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

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:

{
    "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:

{
  "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

Ngôn ngữ chính
Java
Star
51
Fork
33
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của algolia/algoliasearch-client-java

Tất cả issue của algolia/algoliasearch-client-java

Issue tương tự

Thêm issue về Java

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.