Integrations / Magento 2

Overriding index settings

The Magento extension is responsible for writing various configuration settings to your Algolia indices.

What that means is that it is possible for Magento to overwrite changes that you make directly in the Algolia dashboard. It is good to understand which settings are impacted by this behavior.

Which settings are managed by Magento?

For each entity (data type) and store managed in Magento there is typically at least one associated index.

Magento manages these configurations for the following entities:

Products

Categories

Pages

Query Suggestions

Additional Sections

Any settings that are not in this list can be managed independently.

Managing settings in the Algolia dashboard

If a setting is not explicitly managed by Magento then it is possible to configure it in the Algolia Dashboard.

Keep in mind that some settings have default values.

Example

The index setting typoTolerance is set to true by default on any new index unless you explicitly set it to false. Since the Magento extension doesn’t manage this setting for product indices, it’s initially set to true.

However, the value of typoTolerance for product indices can be configured from the Algolia dashboard. Subsequent indexing operations from the Magento extension shouldn’t alter this value unless you explicitly configure Magento to do so.

Example: Setting typo tolerance to a non default value from the Algolia Dashboard

Customizing Magento index settings

You can customize how Magento writes index settings to Algolia:

  1. Advanced Algolia indices settings
  2. Backend events

Advanced Algolia indices settings

To have Magento enforce an index setting value other than the default, specify that value in the Magento admin panel under:

Stores → Configuration → Algolia Search → Advanced Algolia indices settings

This configuration page features a section for each entity that Magento manages.

Specify your desired configuration using JSON syntax.

Example

To specify an alternate value for the typoTolerance setting, add the following JSON configuration under “Products’ indices settings”:

1
{ "typoTolerance": false } 

Example: Setting typo tolerance to a non-default value from the  Magento admin panel

Backend events

For more programmatic control over how the Magento extension writes settings to the Algolia indices, create an observer class to handle one or more entity-specific index setting events.

Did you find this page helpful?