The following diagram illustrates the Website, Store Group, and Store View hierarchy provisioned by the Ayko_PennElcom setup patches. Because the UK and EU store groups contain a large number of country-specific store views, the most notable ones are listed to keep the visualization readable.
app/code/Ayko/PennElcom/Setup/Patch/Data/CreateWebsitesAndStoresAdditionsDefault.php.
Penn Elcom uses a custom module called Ayko_SmileElasticsuiteIndexDeduplication to handle index flattening across its massive list of store views.
Because Penn Elcom operates nearly 100 store views (primarily to handle localized URLs, menus, and country selections), maintaining a separate Elasticsearch index for every single store view would consume an enormous amount of server resources and dramatically slow down the indexing process.
The Ayko_SmileElasticsuiteIndexDeduplication module allows secondary store views within the same Store Group to share the index of the primary (default) store view.
Stores > Configuration > Elasticsuite > Indices Settings > Deduplication.IndexSettingsPlugin.php) intercepts the getIndexAliasFromIdentifier() method in Smile\ElasticsuiteCore\Helper\IndexSettings.Example:
If a user runs a search on the Andorra (ad_en) store view (which is an English store), the search request will actually query the United Kingdom (default) store's Elasticsearch index.
This effectively "flattens" the Elasticsearch indices at the Store Group level rather than the Store View level, preventing the need to duplicate identical product catalog data across dozens of indices.
A crucial part of the deduplication setup is that it only applies to English store views (specifically, stores where the locale is set to en_GB).
A setup patch (ConfigureDeDuplicationConfig.php) automatically disables deduplication for any store view that uses a non-English locale (such as German de_DE, French fr_FR, or Spanish es_ES).
Because deduplication is turned off for translated store views, they each receive their own dedicated Elasticsearch index. This ensures search works correctly in the local language:
eu_en (English) index.de_de) store view will query its own dedicated German Elasticsearch index, which contains fully translated product attributes and search terms, allowing native German search to function perfectly.To assist with the Algolia onboarding, here is a detailed breakdown of the Magento 2 scope levels and how they are typically used in the Penn Elcom setup.
| Level | Description | Usage at Penn Elcom |
|---|---|---|
| Global | The highest level in the hierarchy. Contains base settings, core product attributes, and shared configurations that apply universally. | Core catalog definitions (e.g., base SKUs, core attributes), global configuration, and integrations. |
| Website | Defines the business entity. Contains its own customer base, base currency, and pricing. Customers usually do not share accounts across different websites unless explicitly configured. | Segmented by major global regions (e.g., UK Website, EU Website, US Website, Australia Website). Separate websites allow for different base currencies and dedicated customer bases. |
| Store (Group) | Sits below the Website level. Primarily used to manage category structures. All Store Views within a Store Group share the same root category. | Used to maintain a single unified catalog structure and category tree for a given website (e.g., "EU Store" holds the root category for all EU nations). This is also the level where Elasticsearch index deduplication is applied. |
| Store View | The lowest level, used primarily for presentation. Affects the language, visual design, currency display format, and localized content on the frontend. | Highly segmented by specific country and language combinations (e.g., "Germany - EN/DE", "Spain - EN/ES"). Used to control specific URLs, localized translations, and regional selections. |