0
votes

I am adding 1000 documents to the IndexBatch and calling index() method some thing like below

var batch = IndexBatch.New(actions);

indexClient.Documents.Index(batch);

I kept this code in a loop where I need to upload around 50 Million documents to Azure Search. After it is executing around somewhere 15 to 20 times (15k to 20k documents) in the loop, it is failing and throwing exception which says below

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

Why I am getting this exception randomly.

Can you suggest the better approach to handle below scenarios

  1. How to make sure previous batch of documents got indexed before attempting to load another batch (Since I am running these statements at least 50K times in a loop)
  2. any errors caused because of the load of service.
1

1 Answers

0
votes

Is it possible to add a try / catch to this code so that you can validate that there are actually items in the batch? In the catch maybe add a breakpoint to investigate what is in the batch to see if that helps clear up what might be the issue?