I am using the following code to send documents to Solr:
final UpdateRequest request = new UpdateRequest();
request.setAction(UpdateRequest.ACTION.COMMIT, false, false);
request.add(docsList);
UpdateResponse response = request.process(solrClient);
The response returned from the last line does not seem to be very helpful in determining how I can identify documents failed in a batch request.
Does anyone know how this can be done?
You're looking for the getStatus() method as:
That will return some of the error as per SolrEception like:
That won't tell you what document failed, however I suggest to identify a subset of error codes that require to get the doc number that failed and in those cases you could re-index document by document and stop when you get an error. In such case it would be better to use small batches.