Return nested JSON as facet response

Hi,

I’m inserting data into my Algolia index in the following format:

 "category": {
        "details": {
          "major": 8,
          "minor": 10
        },
        "description": "MEDICINES (PL)"
      },

but the facet results are

{
    "category.description": {
        "CLEANING PRODUCTS": 11,
        "MEDICINES (PL)": 2,
    },
    "category.details.major": {
        "3": 3,
        "4": 4,
    },
    "category.details.minor": {
        "1": 17,
        "2": 2,
    }
}

How do I return my facets as nested JSON similar to how they’re originally indexed?

Thanks.

Algolia supports nested facet values as a hierarchical menu:

That may be your best approach for this design.