Search code examples
azureazure-cognitive-searchindexer

"the operation was canceled" error while creating Indexer to seed Azure search index


I am using Azure's SearchServiceClient to create indexer from my API. My data source for this indexer is a sql view which returns 2 million records and it is a long running query. On the call Indexers.CreateOrUpdateAsync to create indexer, I am getting this error - "the operation was canceled".

I tried adding 30 minute query timeout to indexer definition, but no luck. ({ "queryTimeout", "00:30:00" }. Reference -https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.search.models.indexingparameters.configuration?view=azure-dotnet#Microsoft_Azure_Search_Models_IndexingParameters_Configuration)no


Solution

  • The 'queryTimeout' parameter you are passing in looks correct, so it's possible you are hitting a timeout on the client side in the SDK rather than from the service. You should be able to configure the 'HttpClient' timeout on your SearchServiceClient to be longer. https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.search.searchserviceclient?view=azure-dotnet

    You may also want to consider working to reduce your sql query time for best indexer performance.