Search code examples
azure-cognitive-search

How can I use change detection when indexing a SQL view with an Azure Search indexer?


Have Azure search targeting a table now but we need to change it to target a view instead. After some reading realized cannot use the change tracking to do incremental indexer build, does it mean each time the indexer need to be fully rebuild then? The view contains several million rows, each time a rebuild will cost around half an hour, questions,

  • Is there a better way to do this to minimize the data latency
  • During the indexer rebuild, would it impacting the search calls

Thanks.


Solution

  • You can use the high watermark change detection policy (documented here) with a SQL view. This ensures that when your indexer runs, only rows that have changed according to some high watermark column are indexed.

    During the indexer rebuild, would it impacting the search calls

    Maybe. Indexing does consume some resources and may impact search latency. It depends on your pricing tier, topology (number of replicas and partitions), and workload. If you use a change detection policy and the number of changed rows indexed during each run of the indexer is relatively small, it probably won't have much of an impact.