algolia / algolia/algoliasearch-client-java

feat(rules): Client side information consequence in rules

Offen
#729 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Java
Sterne
52
Forks
33
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Beginne mit dem verknüpften internen Specs-Issue #152 und verfolge anschließend, wie rules.consequence in der Search Response des Java-Clients dargestellt wird. Als erledigt gilt die Aufgabe, wenn der Client renderingContent mit den im Issue beschriebenen Strukturen redirect, facetMerchandising und userData bereitstellt, einschließlich der dort genannten erforderlichen Felder und Response-Struktur.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java
Bereich
api
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.