Configure and populate the new index. For this, you can either:
Find the instructions in the scripts/README.md file.
Import products
Select Add records -> upload file.
Drag and drop the JSON file that contains the demo products (composable/packages/commerce-generic/src/data/products.json).
Configure Searchable attributes and facets.
Go to your index's configuration.
RELEVANCE ESSENTIALS -> Searchable attributes: add the 'name' and 'category' fields.
FILTERING AND FACETING -> Facets: add the 'type', 'brand' and 'price' attributes.
Create replicas for different sorting options.
Select New... -> Replica.
Create 4 replicas, following this naming pattern: {PRIMARY_INDEX_NAME}_{SORTING_OPTION}. The SORTING_OPTION values should be: 'newest', 'priceDesc', 'priceAsc' and 'nameAsc'.
For each replica, configure sorting to match the name of the index. Go to Configuration -> RELEVANCE ESSENTIALS -> Ranking and Sorting, select '+ Add sort-by attribute', type the field name and then select Ascending or Descending sort.
Note that you can create different sorting options, but you'll have to modify the ALGOLIA_SORTING_OPTIONS constant in the application.
Finally, add the following environment variables to this application's .env file