We index documents in Solr using Solrnet in asp.net C # project. We have a requirement when Solr DIH cannot be used, so we index products in specific batches on Solr using the following code:
decimal cycleCount = ProductCount / batchSize; for (int i = 0; i <= Math.Round(cycleCount); i++) { var Products = Products(batchSize, languageId, storeId).ToList(); solrCustomWorker.Add(solrProducts); solrCustomWorker.Commit(); }
With the huge size of the document, it takes a lot of time (in most cases it takes several hours) to complete the whole process, and sometimes we have a need to stop this process between manual intervention.
However, I am not sure how to stop these indexing batch loops between them until they are complete. One cycle with a large volume of documents, takes a few seconds, and then is fixed. But considering the huge no. documents when performing full indexing takes several hours, and we can not stop this process between them.
Any idea is how I can stop this process between them. I canβt understand what needs to be done here?
Please offer.
Ankita
source share