Search code examples
azureazure-cognitive-searchazure-search-.net-sdk

Azure search FindFailedActionsToRetry returning empty actions?


I was testing the FindFailedActionsToRetry function on c# client for azure search and I am not getting expected results.

In my function I try to index the batch and i have a try-catch that handles IndexBatchException. Inside the catch I do:

var retryBatch = e.FindFailedActionsToRetry(batch, id => id["Identifier"].ToString());

The first time I index I get: 999 out of the 1000 documents failed to index (which is expected).

Then I try to index the batch again but instead of getting the same indexbatchexception thrown out (because I purposedly set merge as the action of the original 1k documents), I get another exception:

The request is invalid. Details: actions : No indexing actions found in the request. Please include between 1 and 1000 indexing actions in your request.

Any ideas why the FindFailedActionsToRetry function is not returning correct results? or maybe im doing something wrong?

EDIT

To show more context, when I expand the retrybatch object I created which contains an IndexBatch object, I can see Actions. I then Expand further, click on results view, and I get: Enumeration yielded no results

The original batch That I sent the first time did have resutls. In fact, I could see: Action,document. Action,document, etc.

Why am I not seing any results?


Solution

  • You are provoking an indexing failure in a way that is not transient and therefore not retriable. FindFailedActionsToRetry is smart enough to detect this. Take a look at the ShouldRetry method in the code.