Agreed that this is a problem with Solr. If it was merely "bad input", Solr should be returning a 4xx error.

I don't know if we already have a Jira for this. If not, one should be filed.

There are two issues:

1. The status code should be 4xx with an appropriate message about "bad input".

2. The offset of the offending document should be reported so that the app can locate the problem to resolve it.

Give us the actual server stack trace so we can verify whether this was simply "user error" or some defect in Solr itself.

-- Jack Krupansky

-----Original Message----- From: Liram Vardi
Sent: Wednesday, July 30, 2014 9:25 AM
To: solr-user@lucene.apache.org
Subject: Identify specific document insert error inside a solrj batch request

Hi All,

I have a question regarding the use of HttpSolrServer (SolrJ).
I have a collection of SolrInputDocuments I want to send to Solr as a batch.
Now, let's assume that one of the docs inside this collection is corrupted (missing some "required" field). When I send the batch of docs to solr using HttpSolrServer.add(Collection< SolrInputDocument> docs) I am getting the following general exception:

"org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrException:
Server at http://172.23.3.91:8210/solr/template returned non ok status:500, message:Server Error"

When I check Solr log, I can identify exactly which is the corrupted document.

My question:
Is it possible to identify the problematic document at the client side? (for recovery purposes)

Thanks,
Liram

Reply via email to