Best Way To Setup Facets/Attributes


We are an e-commerce store, and have 150+ attributes on our products (things like “Color”, “Size”, “Weight”, etc). We are trying to figure out the best way to get our data into Algolia so that our users can filter by “Color: Red”, “Size: Large”, etc.

In our database, we have products, and each product has a collection of “attributes & values”. So on a product, it could have “Color: Red, Size: Large, Weight: 2lbs”. Another product may have a completely different set of attributes “Certified: true, Voltage: 1300”, etc.

What is the best way for us to put our attributes into an indice in Algolia, so that we can accomplish our goal of letting users quickly filter products down?


When indexing your data in Algolia, each product will hold their own attributes. In your settings, you need to define all attributes in your settings attributesForFaceting. When searching Algolia will return all the facet available for the current result set. If you have one tee-shirt with only color attribute and one pants with only size attribute, your will get the 2 attributes for facet.

You can find more details in this guilde:

We have built-in integration for Shopify and Magento in case you’re using one of those software.