AI-102 Question 378
Single answerYou are designing an Azure Cognitive Search solution for a retail company. The company wants to index product data stored in an Azure SQL Database and ensure the index is updated automatically whenever the source data changes. How should you configure the indexer to meet this requirement?
- A
Set the data source to the Azure SQL Database and configure a schedule for the indexer.
- B
Use an Azure Function to manually trigger the indexer each time data changes in the Azure SQL Database.
- C
Enable change detection by setting the HighWaterMarkChangeDetectionPolicy in the indexer configuration.
- D
Enable change detection by setting the SoftDeleteColumnDeletionDetectionPolicy in the indexer configuration.
Show answer and explanation
Correct answer: C
Explanation
To ensure automatic updates to the index when data changes in an Azure SQL Database, the HighWaterMarkChangeDetectionPolicy should be used. This policy tracks updates using a designated column (such as a timestamp) in the source data, allowing the indexer to detect and process changes efficiently.
- A. Incorrect.
Configuring a schedule ensures the indexer runs at regular intervals, but it does not provide real-time updates or automatic change detection.
- B. Incorrect.
Using an Azure Function to manually trigger the indexer can work but requires custom development and does not leverage built-in change detection features of the indexer.
- C. Correct.
HighWaterMarkChangeDetectionPolicy allows the indexer to track changes in the source data using a high-water mark column, which is specifically designed for change detection in Azure SQL Database.
- D. Incorrect.
SoftDeleteColumnDeletionDetectionPolicy is used to detect and handle soft-deleted records but does not handle general change detection in the source data.