Table of contents :

One Index or Multiple Indexes?

100-days-of-algolia-015

Table of contents :

Choosing between one Algolia index and multiple indexes affects search quality, operational complexity, analytics, and deployment safety. For WooCommerce agencies, the right decision usually depends on whether the records share the same search experience, ranking strategy, permissions, and lifecycle.

What an Algolia index represents

An Algolia index is a searchable collection of records with its own configuration. That configuration can include searchable attributes, ranking criteria, custom ranking, synonyms, facets, typo tolerance, rules, and replicas.

For a WooCommerce product catalog, an index record might contain a product ID, title, description, categories, attributes, price, stock status, image URL, and variation data. The index should contain the information required by the search interface rather than being a direct copy of the entire WordPress database.

Use one index when the search experience is shared

A single index is usually the best default when all records belong to the same catalog and users search them through the same experience. This is common for a standard WooCommerce storefront.

  • Products use the same searchable fields.
  • Products share the same ranking and relevance requirements.
  • All shoppers can search the same catalog.
  • Facets such as brand, category, price, and stock status apply consistently.
  • The storefront needs one unified result set.

For example, a store selling clothing can place shirts, shoes, and accessories in one index. Category, brand, size, color, and price can be represented as facets, while product type or category can be used to refine results. A shopper can search for black running shoes without the application having to query separate indexes and merge the responses.

Use multiple indexes when the data or rules are genuinely different

Separate indexes are appropriate when combining the records would create conflicting search behavior or access requirements. Common cases include:

  • Different catalogs: A retailer operates separate consumer, wholesale, or regional catalogs with different products and prices.
  • Different permissions: Some products are visible only to logged-in customers, business accounts, or specific membership tiers.
  • Different languages: Localized records require separate searchable content, language-specific synonyms, or language-specific ranking behavior.
  • Different domains: Products, blog posts, documentation, and support articles need different schemas and relevance settings.
  • Different data lifecycles: A temporary campaign catalog or event inventory should not share operational settings with the main catalog.
  • Different ranking strategies: A product search may prioritize sales and margin, while a parts lookup may prioritize exact model or SKU matches.

For example, a B2B WooCommerce site may maintain one index for public products and another for customer-specific products. The application can select the permitted index after authentication instead of exposing restricted records in a shared index.

Do not create indexes merely to represent filters

Categories, brands, product types, stock states, and price ranges generally belong in one index as facets or filters. Creating an index for every category or brand makes synchronization and configuration management harder without improving relevance.

For example, separate indexes such as products-shoes, products-shirts, and products-accessories are usually unnecessary if shoppers need to search across the entire catalog. A single products index with a faceted categories attribute provides a more flexible experience.

Use replicas for alternate ranking, not duplicate business data

Algolia replicas are designed for alternate ranking strategies over the same records. A WooCommerce store might use:

  • A standard replica that ranks by textual relevance and then business-specific custom ranking.
  • A price-ascending replica for a “price: low to high” sort.
  • A price-descending replica for a “price: high to low” sort.
  • A newest-products replica sorted by publication date.

Replicas should be connected to a primary index and kept synchronized by Algolia. They are different from independently maintained indexes: the records come from the same source, while ranking and sorting settings vary.

When implementing sorting in InstantSearch or a custom frontend, the application selects the appropriate replica rather than downloading all records and sorting them in PHP or JavaScript.

Separate indexes for environments

Development, staging, and production should not normally share an index. A staging deployment can contain incomplete products, test prices, unpublished content, or destructive synchronization changes.

Use an environment-specific naming convention such as:

acme_dev_products
acme_staging_products
acme_prod_products

Keep the environment name in configuration rather than hard-coding it throughout the plugin or theme. The same convention should apply to replicas and auxiliary indexes.

For example, a production index might be named acme_prod_products_price_asc, while its staging counterpart is acme_staging_products_price_asc. Deployment automation can then apply settings and synonyms to the correct environment without manual renaming.

Plan the record model before splitting the catalog

Multiple indexes do not remove the need for a consistent record model. Each index should have a deliberate schema and a clear source of truth in WooCommerce.

For a product index, define decisions such as:

  • Whether each variable product is one record or each variation is a separate record.
  • Which product IDs and variation IDs are used as stable object identifiers.
  • How parent categories and attributes are represented.
  • How visibility, stock, pricing, and customer-specific data are enforced.
  • How deleted, trashed, or excluded products are removed from Algolia.

If variations need independent filtering by size, color, or SKU, indexing variations separately may be appropriate. If shoppers should see one product card with selectable options, a parent product record with nested variation data may provide a better interface. The choice should be consistent across every index that represents the same catalog.

Consider analytics and operational cost

Multiple indexes can make analytics harder to interpret. Searches and clicks may be distributed across index names, making it more difficult to compare conversion behavior unless the implementation uses consistent event metadata and reporting conventions.

They also increase operational work. Each index may require its own:

  • Settings and ranking configuration.
  • Synonyms, rules, and redirects.
  • Replication and deletion logic.
  • Monitoring and record-count checks.
  • Access controls and deployment configuration.

Agencies should document which indexes are authoritative, how records are synchronized, and which settings are managed as code. A configuration file or deployment script is safer than manually applying different settings in the Algolia dashboard.

A practical decision process

  1. Start with the search journey. Determine whether users need one unified result set or separate experiences.
  2. Check access rules. If records have different visibility requirements, do not rely only on frontend filters to protect them.
  3. Identify ranking differences. Use replicas when the records are the same but sorting or ranking changes.
  4. Identify schema differences. Use separate indexes when fields, facets, or searchable attributes do not meaningfully overlap.
  5. Separate environments. Never let test synchronization jobs write into the production index.
  6. Estimate maintenance. Include synchronization, settings, analytics, monitoring, and deployment work in the design.

Recommended WooCommerce default

For most single-store WooCommerce implementations, use one production product index, add replicas for supported sort orders, and model categories, brands, attributes, stock, and price as searchable or filterable fields. Add separate indexes only for distinct catalogs, permissions, languages, domains, or ranking models. Maintain separate development and staging indexes, and manage naming and settings through environment-aware configuration.

Trending posts
You might also like