1
votes

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?

1
What version of the SDK are you using? In the call to FindFailedActionsToRetry, what type is id? - Bruce Johnston
I am using 3.0.3. I started by using the findfailedactionstoretry with no Type so I just said "Identifier" which is my key field in azure search. That didn't work so I used the Typed version which also didn't work. id is a Document - Kevin Cohen

1 Answers

2
votes

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.