algolia / algolia/algoliasearch-client-java
feat(rules): Client side information consequence in rules
- Lenguaje dominante
- Java
- Estrellas
- 52
- Forks
- 33
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
**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)
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Comienza con el issue interno de specs vinculado #152 y, a continuación, rastrea cómo se representa rules.consequence en la respuesta de búsqueda del cliente Java. Se considera terminado cuando el cliente expone renderingContent con las estructuras redirect, facetMerchandising y userData descritas en el issue, incluidos los campos obligatorios y la estructura de respuesta indicados.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- java
- Área
- api
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100