Multiple values in lvl1 for a value in lvl0

Hi there!
I want to use ais-hierarchical-menu with more than one value in the second level of filtering to select in the first level the province and in the second instance localities of that.
In my index it look like that
image
I set these atributes as facets
image
My code is the following
image
but in my web i don’t see the filters
image

Can you send us a code sandbox of your implementation to see exactly what you are doing.

You can use the above as a template to get you started.

Hi Jordan! thank for your answer.
The problem is that I need a dataset with records like this
{
“objectID”: “321432”,
“name”: “lemon”,
“hierarchicalCategories.lvl0”: [“products”, “goods”],
“hierarchicalCategories.lvl1”: [“products > fruits”, “goods > to eat”]
}

where the lvls in the hierarchicalCategories are arrays. How can I get this?

Hi @giannilupi9,

Could you tell us how you’re building the dataset you’re sending to Algolia please? That will help up understand how you can achieve using arrays in hierarchicalCategories

Thanks in advance,

Hi @chloe.liban,
The records in my dataset are like that
{
“ID”: 600,
“imgPortada”: “files/publicaciones/4/600/4-600-1597772225535”,
“titulo”: “Aceto balsamico premium”,
“compraMinima”: 1,
“stock”: 0,
“precio”: 268.33,
“views”: 0,
“estado”: “ACTIVA”,
“createdAt”: “2020-08-18 14:36:44”,
“minPrecio”: 233.33,
“maxPrecio”: 0,
“marca”: {
“ID”: 23,
“nombre”: “casalta”,
“estado”: “ACTIVO”
},
“unidadesMedida”: {
“ID”: 1,
“nombre”: “Unidad”,
“siglas”: “U.”,
“tipo”: “Unidad”,
“estado”: “ACTIVO”
},
“precios”: ,
“vendedor”: {
“ID”: 4,
“empresa”: “IfElseSL”,
“estado”: “ACTIVO”,
“ubicacion”: {
“lvl0”: “San Luis”,
“lvl1”: “San Luis > Capital”
}
},
“producto”: {
“ID”: 288,
“nombre”: "Acetos ",
“categoria”: {
“ID”: 23,
“lvl0”: “Almacén”,
“lvl1”: “Almacén > Aceites y Vinagres”
}
},
“marcaID”: 23,
“unidadMedidaID”: 1,
“descripcion”: “Des”,
“fechaDesde”: null,
“fechaHasta”: null,
“sucursales”: [
{
“ID”: 21,
“codigoPostal”: “5043”,
“direccion”: “calle siempre viva 123”,
“comentarios”: “Los dibujos animados no pueden ser 100% realista”,
“ubicacion”: {
“lvl0”: “San Luis”,
“lvl1”: “San Luis > Capital”
}
}
],
“ubicaciones”: {
“lvl0”: [
“San Luis”
],
“lvl1”: [
“San Luis > Capital”,
“San Luis > La Florida”,
“San Luis > Villa Mercedes”,
“San Luis > Alto Pelado”,
“San Luis > Alto Pencoso”,
“San Luis > Anchorena”
]
},
“objectID”: “600”
}

I want to use the values in “ubicaciones” for the hierarchicalMenu

Hi again!

Could you build up a demo in a codesandbox like proposed by jordan earlier? That would really help understand how you are building your implementation and what could be going wrong.

Thanks a lot!

Finally I can solve this problem my mistake was to set the facet value only on one replica of the index and not on all indices.
Thank you very much for your answers