The extension uses two primary data flows to synchronize Magento 2 data with Algolia:
1. Delta (Incremental) Indexing
Used for real-time updates when catalog or CMS data changes. It uses Magento's materialized views (mview) or Plugin/Observer interceptors to detect changes. These changes are enqueued as buildIndexList jobs, and records are updated in-place on the live index.
2. Full (Complete Rebuild) Indexing
Used to rebuild an entire entity index from scratch. This is typically triggered via CLI commands (e.g., algolia:reindex:products).
Note on Temporary Indexing: If enabled (via QueueHelper::useTmpIndex()), full indexing builds into a temporary index first. Once complete, the IndexMover atomically swaps the temporary index into production to prevent the live index from being in a partial state. If disabled (default), records are written directly to the live index.
Delta (incremental):
Catalog/CMS change
-> mview subscription or Plugin/Observer
-> executeList($ids) on the Magento indexer
-> BatchQueueProcessor.handleDeltaIndex()
-> buildIndexList queue jobs
-> IndexBuilder -> RecordBuilder -> AlgoliaConnector
-> records updated in-place on the live index
Full (complete rebuild):
CLI command (algolia:reindex:*) or executeFull() if enabled
-> BatchQueueProcessor.handleFullIndex()
-> buildIndexFull queue jobs
-> IndexBuilder -> RecordBuilder -> AlgoliaConnector
-> records written to the live index (default)
OR to a temporary index (if temp indexing enabled)
-> IndexMover atomically swaps temp -> production (when temp index used)