Index management
ÃÛ¶¹ÊÓƵ Commerce and Magento Open Source reindex automatically whenever one or more items change. Actions that trigger reindexing include price changes, creating catalog or shopping cart price rules, adding new categories, and so on. To optimize performance, Commerce accumulates data into special tables using indexers. As the data changes, the indexed tables must be updated—or reindexed. Commerce reindexes as a background process, and your store remains accessible during the processes.
Reindexing data speeds up processing, and reduces the time the customer has to wait. For example, if you change the price of an item from $4.99 to $3.99, Commerce reindexes the data to show the price change in the store. Without indexing, Commerce would have to calculate the price of every product on the fly; handling shopping cart price rules, bundle pricing, discounts, tier pricing, and so on. Loading the price for a product might take longer than the customer is willing to wait.
The indexers can be set to either update on save or on schedule. All indexes can use either option, except Customer Grid which only supports on save. When indexing on save, Commerce starts a reindex on save actions. The Index Management page completes the update and flushes the cache, with the reindex message appearing within a minute or two. When reindexing on a schedule, a reindex runs according to a schedule as a cron job. A system message appears if a cron job is not available to update any indexers that become invalid. Your store remains accessible during reindex processes.
When a reindex is needed, a notification appears at the top of the page. The index and message clears based on the reindex mode and potential actions that you take. For more detailed information about indexing , see the in the PHP Developer Guide.
{width="700" modal="regular"}
- Index Management has a slightly different presentation for flat product catalogs.
- To avoid problems when multiple Admin users update objects that trigger automatic reindexing, it is recommended that you set all indexers to run on schedule as cron jobs. Otherwise, every time an object is saved, any objects with interdependencies might cause a deadlock. Symptoms of a deadlock include high CPU usage and MySQL errors. As a best practice, it is recommended that you use scheduled indexing.
- (ÃÛ¶¹ÊÓƵ Commerce only) By default, admin actions, such as reindexing, are logged by the system and can be viewed in the Action Logs Report. Action logging can be configured in the Admin Actions Logging in your store’s advanced admin settings.
Best practices for reindexing
Reindexing and caching have different purposes in Commerce. Indexes track database information for increased search performance, faster data retrieval for storefronts, and more. Caches save loaded data, images, formats, and the like for increased performance loading and accessing the storefront.
- Typically, you want to reindex when updating data in Commerce.
- If you have a large store or multiple stores, you may want to set indexers like category and products to scheduled cron jobs due to the possibility of reindex looping. You may want to set the reindex on a schedule during non-peak hours.
- When reindexing, you do not need to also perform a flush cache.
- For fresh Commerce installations, you must flush the cache and reindex.
- Flushing caches and reindexing does not flush your computer’s web browser cache. Clear the browser cache after completing updates to your storefront.
Change the index mode
catalogsearch_fulltext
) indexer: The fulltext index must be rerun after any bulk permissions change or when the ‘permissions’ indexer is in ‘Scheduled’ mode.-
On the Admin sidebar, go to System > Tools > Index Management.
-
Select the checkbox for each indexer that you want to change.
-
Set Actions to one of the following:
Update on Save
Update by Schedule
Invalidate index
note important IMPORTANT Customer Grid can only be reindexed using Update on Save
. This index does not supportUpdate by Schedule
. -
Click Submit to apply the change to each selected indexer.
Index Management columns
table 0-row-2 1-row-2 2-row-2 3-row-2 4-row-2 5-row-2 6-row-2 layout-auto Column Description Indexer The name of the indexer. Description A description of the indexer. Mode Indicates the current update mode for each indexer. Options:
Update on Save - The index is set to update whenever an entity change is saved. These entities include products, categories, and customers. When the save action completes, a series of steps begins catching the changes and updating the index. The Index Management page updates and flushes the reindex message within a minute or two.
Update on Schedule - The index is set to update on schedule according to a cron job. The cron job includes the schedule interval for reindexing, writing updates to the index when run.Schedule Status Displays the schedule status updates. Status Displays one of the following:
Ready — The index is up to date.
Suspended - Reindexing is paused.
Processing - Reindexing is currently running.
Reindex Required - A change has been made that requires reindexing, but the indexers cannot be updated automatically. Check to see if cron is available and configured correctly.Updated Indicates the date and time that an index was last updated.
Reindex using the command line
Commerce provides additional reindex options using the command line. For complete details and command options, see Reindex in the Configuration Guide.
Index trigger events
Reindexing triggers
Change configuration settings
Add store group
Add, edit, or delete attribute (for searching and filtering)
Add store group
Add, edit, or delete attribute (for searching and filtering)
Change product-to-category relations
Add, edit, or delete categories
Add or delete stores
Delete store groups
Delete websites
Add or delete stores
Delete store groups
Delete websites
Add store group
Add, delete, or update attribute (for searching and filtering)
Index actions and controls
Actions that Cause a Full Reindex
Events that trigger full reindexing
Create a web store view
Create, or delete an attribute that is any of the following:
- Searchable or visible in advanced search
- Filterable
- Filterable in search
- Used for sorting
Change an existing attribute to be any of the preceding.
Enable flat category storefront options
Create a web store view
Create, or delete an attribute that is any of the following:
- Searchable or visible in advanced search
- Filterable
- Filterable in search
- Used for sorting
Change an existing attribute to be any of the preceding.
Enable flat category storefront options
Stock Options
- Display Out of Stock ProductsProduct Stock Options
- Manage StockWhen any of the following Catalog Inventory options change in the system configuration:
Stock Options
- Display Out of Stock ProductsProduct Stock Options
- Manage StockPrice
- Catalog Price ScopeDelete a store
Delete a website