1

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?

Kevin Cohen
  • 1,211
  • 2
  • 15
  • 22
  • What version of the SDK are you using? In the call to `FindFailedActionsToRetry`, what type is `id`? – Bruce Johnston Aug 18 '17 at 21:12
  • 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 Aug 18 '17 at 21:15

1 Answers1

2

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.

Bruce Johnston
  • 8,344
  • 3
  • 32
  • 42
  • Wao, took me a long time to find that. Thanks a lot. I was getting 404 which is not retriable as you mentioned. Thanks for the help! – Kevin Cohen Aug 18 '17 at 21:20
  • Ah, sorry for suggesting this method. I forgot that `FindFailedActionsToRetry` takes retry-ability into account. – Eugene Shvets Aug 19 '17 at 01:38