Search code examples
azure-cognitive-search

Document Update policy in Azure Search Service


I have an Azure Search Service that have an indexer using a SQL view stored in our DB as the data source. This view shows tickets for past 6 months. What I want is that this indexer should delete documents when my view gets updated every day (cause of CreateDateTime < 6 months). I use High watermark policy on column LastUpdatedTime. I think this policy will ensure updating document when corresponding row gets updated. BUT I am not sure when that row (support case) goes out of the view, will it result in document getting deleted.

I would appreciate the help!


Solution

  • You're right in that when a row goes out of the view, the corresponding document doesn't get deleted by the indexer.

    One way to do this would be to select some older documents (say, with a 2 week buffer) but mark older documents as stale in your view, then use soft deletion policy feature to delete those documents.