Indexing
Attributes

Sync

5min

Attribute sync is responsible for sending attribute data to Klevu.

The type of API request depends on the next_action column in the klevu_indexing_attribute database table. If that column is set to Add then an add request will be sent, if it is empty no request will be sent.

The population of klevu_indexing_attribute database table is controlled by attribute discovery and update. Attribute sync does not determine the action to be performed.

If an attribute has been registered with Klevu for indexing that does not mean it is automatically sent to Klevu. It means it can be sent to Klevu. Entity data indexed to Klevu is defined in the indexing pipelines YAML files.

Attribute sync is triggered:

  • via cron
  • via CLI

\Klevu\Indexing\Service\AttributeSyncOrchestratorService responsible for attribute sync. All the above methods of triggering attribute sync use this service.

Cron

As with all cron tasks added by version 4.x of the Klevu integration, attribute sync cron tasks use the dedicated klevu cron group, allowing granular configuration of scheduling and run options.

We recommend using the native Magento cron to run these jobs, configuring schedules if necessary, rather than a custom server-side cron implementation of the CLI command.

Attributes sync runs every 10 minutes by default. This can be configured in the Magento admin, Stores > Configuration > Klevu > Data Sync > Indexing > Attribute Indexing Sync Frequency. The default setting can be found here module-m2-indexing/etc/config.xml The configuration for the cron can be found here module-m2-indexing/etc/crontab.xml

module-m2-indexing/etc/crontab.xml


CLI

klevu:indexing:attribute-sync

The sync can also be triggered via CLI and has 2 optional parameters

  • api-keys - [optional] comma-separated list of API keys to sync
  • attribute-types - [optional] comma-separated list of attribute types to sync, options:
    • KLEVU_PRODUCT
    • KELVU_CATEGORY

Increasing the verbosity of the command will give you more information using -v, -vv, or -vvv

e.g

Shell