Search code examples
c#.netazureazure-storageazure-cognitive-search

Azure Search Indexer run operation indicates 429 error


Indexer Run operation:

https://learn.microsoft.com/en-us/rest/api/searchservice/run-indexer

This is the operation I've used in my code, which for some reason gives me a HTTP 429 error. It's a bit odd as the error doesn't seem to happen for the first time, but only for subsequent ones.

What I am trying to do is that I have a Save method that pushes data into the table storage. Once saved successfully, I then call this Run Indexer operation so that the index would be aware of the newly saved data.

The Run Indexer operation will likely be called multiple times in a short period, as the Save operation happens quite frequently. I sort of feel that this might be one of the contributors to the cause of this issue. But there might be some other factors, which I am not too sure of either.

I wonder if it's the right approach to use this operation. I don't see there's any mention on that API doc regarding 429 Error though.

Anyway, I think, ultimately, what I want to achieve is that I can get the updated index after any new data is added or any existing data updated to the table storage.


Solution

  • Search services that use Free pricing tier can call Indexer Run API no more frequently than once every 3 minutes for each indexer. The error message returned with the 429 status code response explains this.

    If you can tolerate a delay between adding data to the table and when it becomes searchable, just make the indexer run on a schedule (minimal interval is 5 minutes).

    If you cannot tolerate a delay and need real-time index updates, insert the documents into the search index when adding them to the table.