Search code examples
azureazure-cognitive-search

Refresh an Azure search index


I've been exploring Azure Search recently as I'd like to use it in some of our apps. I've created an index, imported the data and have began querying the data using both the Search Explorer and the REST APIs. All well and good.

I changed the underlying data to test out the fuzzy searching capabilities. However, I was getting incorrect results as the data being returned was still the old data. I eventually found how I forcibly refresh the underlying data from the Azure portal, but is there a way to do this using a REST API, or to automate this in some way. I don't want to have to keep manually refreshing the Azure Search Index going forwards.


Solution

  • An indexer normally runs once, immediately after it is created. You can run it again on demand using the portal, the REST API, or the .NET SDK. You can also configure an indexer to run periodically on a schedule.

    Source data will change over time, and you want the Azure Cognitive Search indexers to automatically process the changed data. Schedule indexers in Azure Cognitive Search, where you can set a custom interval (between 5 minutes and 24 hours).