Algolia Unknown Attribute for Facets

Hi All,

Got a JSON in ALGOLIA index as -

{
      /* ... */
      "categories": [
        "Home Appliances",
        "Refrigerators"
      ],
      "averageStarRating": 4.35,
      "popularity": 7,
      "hierarchicalCategories": {
        "lvl0": "Home Appliances",
        "lvl1": "Home Appliances > Refrigerators"
      },
      "filters": {
        "Refrigerator Type": "Triple Door",
        "Capacity": "300"
      },
      "price": 32882,
      "objectID": "WPI697"
      /* ... */
    }

But, its not taking filters.Capacity as a facet.

Error:
"Unknown Attribute
We couldn't find the attribute filters.Capacity in a small sample of your records; there might be a typo."

Now, I got another JSON in the same index, as:

{
      /* ... */
      "category": {
        "name": "Laptops",
        "slug": "20001",
        "parentCategories": [
          "20000",
          "20001"
        ]
      },
      "categories": [
        "Computers",
        "Laptops"
      ],
      "averageStarRating": 5,
      "popularity": 9,
      "hierarchicalCategories": {
        "lvl0": "Computers",
        "lvl1": "Computers > Laptops"
      },
      "filters": {
        "HDD Size": "256 GB PCIe® NVMe™ M.2 SSD",
        "Processor": "7th Generation Intel® Core™ i5 processor",
        "Display Size": "33.78 cm (13.3) FHD IPS UWVA display",
        "RAM": "8 GB LPDDR3-1866 SDRAM (onboard)",
        "Graphics Processor": "Intel HD",
        "Operating System": "Windows 10 Pro 64"
      },
      "price": 109900,
      "objectID": "HPY4G65PA",
      /* ... */
    }

Its taking filters.HDD Size, filters.RAM, etc. as a facet.
The structure of both the JSON is the same, but the filters are dynamic.
Why is it not taking the first JSON filter as a facet?

Kindly help. Thanks in advance.

The orange box on the side of your attributes for faceting is only a warning.
It just means that we looked in a small amount of records and didn’t find this filter. It’s meant to help you quickly double check if there wasn’t a typo.
But here you’ve completely confirmed that there is none, so you can safely ignore the warning.

Thanks for the reply… It worked.

1 Like