algolia / algolia/algoliasearch-client-python

feat(rules): Client side information consequence in rules

Aperta
#518 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
207
Fork
63
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia dall’issue interna delle specs #152 e traccia come rules.consequence è rappresentato nelle risposte di ricerca. Conferma che le strutture redirect, facetMerchandising e userData, inclusi i campi strict e i metadati, siano esposte come l’array renderingContent descritto nell’issue.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
api, backend
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.