AD0-E725 practice question 2 of 10
A Developer is tasked with creating a new index. The custom indexer is not automatically updating the product data. How should the Developer solve this issue?
Full set: 50 questionsThe Magento framework uses the Materialized View (MView) mechanism to track database changes for indexers. By defining subscriptions to specific database tables and columns in the mview.xml configuration file for the custom indexer, the developer instructs Magento to automatically create database triggers. These triggers monitor the source tables (e.g., product tables) for any changes (INSERT, UPDATE, DELETE). When a change occurs, the trigger records the primary key of the affected entity into a corresponding changelog table. This allows the indexer, when running in "Update on Save" mode, to efficiently process only the changed data, ensuring the index is updated automatically.
A. Use an event observer to monitor data changes. While observers react to events, they are not the standard or most efficient mechanism for tracking database changes for indexing, which the MView system is specifically designed for.
C. Implement custom database triggers. Manually creating database triggers is incorrect because it bypasses the Magento framework. The MView system is designed to manage the lifecycle of these triggers declaratively via XML configuration.
1. Adobe Commerce Developer Documentation
"Configure a custom indexer": This document explicitly states the role of mview.xml: "The mview.xml file is used to track database changes for a specific entity and to run the handler to update the index." It details how to define views
subscriptions
and tables to be monitored.
Source: Adobe Commerce Developer Documentation > Indexing > Custom indexers > Configure a custom indexer.
2. Adobe Commerce Developer Documentation
"How indexing works": This guide explains the core indexing mechanism
stating
"In Update on Save mode
database triggers are used to update the index tables immediately after the data is changed." It clarifies that this process is managed by the MView subscriptions.
Source: Adobe Commerce Developer Documentation > Indexing > How indexing works > Indexing mechanism.
Keep practicing
Take the free AD0-E725 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other AD0-E725 practice questions
- Question 1A Developer working on an Adobe Commerce Cloud project encounters an issue with the datab…
- Question 3An Adobe Commerce Developer is approached to disable several cron jobs from a customizati…
- Question 4An Adobe Commerce Developer is tasked to frequently send data to a third-party API. The A…
- Question 5A Developer creates daily cron jobs to automate a client’s business processes, including …
- Question 6A client wants to calculate tax differently when an order is billed for a range of partic…
- Question 7A client requests changes to their Pro Staging and Production environments. They supply a…
