${hostname}__${site-id}__products__${locale}
${hostname}__${site-id}__categories__${locale}
${hostname}__${site-id}__contents__${locale}
(optional)

Locales for indexing
custom preference or the localesForIndexing
job step parameter.
Indexing many locales can affect runtime.
Configure your searchable attributes
When setting up and configuring your index, the first step is to decide which attributes you want to use for searching. Add them by going to Configuration > Searchable attributes. For more information, see Searchable attributes. To begin with, consider adding the following attributes:name
, short_description
, and long_description
.

Configure your facets
First, define the attributes you want to be available as facets in the Configuration > Facets tab on the Algolia dashboard. We recommend to add at least the following attributes:- The Algolia cartridges support all the currencies your site uses. The
price
attribute relates to each currency. For example, if your site is using USD and EUR, addprice.USD
andprice.EUR
. __primary_category.0
,__primary_category.1
,__primary_category.2
- Facets relevant to your products, such as
brand
,size
, andcolor
.
The actual facets depend on your attribute names and your record model.
For example, if you choose the product-level record model, some facets would become
variants.price.USD
, variants.size
, variants.color
.
__primary_category
attributes.
These attributes are suitable for hierarchical faceting
in Algolia, such as Women > Dresses > Evening Dresses
: __primary_category.0
, __primary_category.1
, and __primary_category.2
.
With faceting, Algolia offers capabilities that are similar to Salesforce product variation grouping.
Configure results grouping
Results are grouped by default when you use the product-level record model. For the variant-level record model, if your catalog is large, it’s common practice to group related variants in the results by displaying one result per base product. To do that:- Add the
masterID
attribute to the list of Additional Product Attributes. - Enable the
distinct
feature on themasterID
attribute.
If you enable results grouping,
you should add color swatches so users can see the different color variations.
Configure your replicas
You can use replicas to let your users sort search results in different ways, such as sorting by price in ascending and descending order. To create the replicas for sorting on price:- Select your products index and go to Replicas.
-
Create two replicas:
hostname__site-id__products__price_USD_asc
hostname__site-id__products__price_USD_desc
This adds two new indices to your app. -
Configure each replica to sort by price.