Custom schedule for Azure Search Indexer

243 Views Asked by At

I wanted to schedule Azure Search Indexer with a custom schedule as below.

  1. First Indexer should run every 2 hours from Sunday to Monday (not on Saturday) for delta updates.

  2. Second Indexer should run every Saturday for a full load of data.

Created an Azure Index and set up Indexer to load data to Index, but Azure Portal only allows to select a specified time frame (in minutes) to run Indexer on schedule.

1

There are 1 best solutions below

0
Carey Halton On

For your first indexer request, there is no way to run an indexer on a schedule only from Sunday to Monday without some sort of intervention. The options would be:

  1. Update the indexer to remove the schedule when you want it stop and re-add it when you want it to start again.
  2. Mark the indexer as disabled: true when you want it to stop and then change it back to disabled: false when you want it to start again.
  3. Don't use the built in indexer scheduling and instead create your own automation logic to run it on demand on specific day of the week dependent schedule that you prefer.

For your second indexer request, this is also not doable because the maximum interval we allow between indexer runs is 1 day, and as such do not support a 1 week gap. Your best option here is going to be to set up your own automation logic that runs weekly and runs the indexer on demand on the schedule that you prefer. Also note that for this use case, if you want to ensure that the indexer will always process the full load of data, you should make sure that the data source does not contain a change tracking policy. Some of our data sources are designed to implement a change tracking policy by default, so you would need to manually remove it if you the behavior you want is a full re-index each time you run it.

Relevant documentation: https://learn.microsoft.com/en-us/rest/api/searchservice/create-indexer#request-body