To be able to provide fast results, the Algolia Engine pre-computes part of the sort order in advance during indexing. Each index supports only one sort order, so every additional sort creates another (replica) index. Standard replicas (default) can increase storage more than virtual replicas.
- https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas
- https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/in-depth/replicas-impact-on-pricing
In Magento, this means that the extension creates:
- One products index per store.
- One replica of the products index per store per additional sort order (starting with 3 that are created by default, 2 for "Sort by price", and 1 for "Sort by date").
To calculate the amount of records this generates, let’s have a look at the following example:
Our Magento store has 2 store views (2 languages for example) and each store view has 100 products. Both stores have the default sorts on price - lowest to highest , price - highest to lowest and date - newest to oldest, resulting in a total of 3 sorts per store.
Using the scenario above, the extension will need to index:
| Relevance sorting | 100 * 2 | 200 |
| Additional Sorting Strategies | 100 * 2 * 3 | 600 |
| Total records | 800 |
If the customer group feature is enabled, each customer group will result in an extra replica index for each pricing sorting. Following the example above, and adding a total of 5 customer groups will result in:
| Relevance sorting | 100 * 2 | 200 |
| Pricing sorting | 100 * 2 * 2 * 5 | 2000 |
| Date sorting | 100 * 2 * 1 | 200 |
| Total records | 2400 |
The number of indexed records can be lowered by either removing some sorting strategies or by converting them to using virtual replicas. (Virtual replicas do require some additional storage but this is marginal relative to the number of records.)
You can configure this setting by navigating to Stores > Algolia Search > InstantSearch Results Page > Sorting.