On 5/18/2012 8:50 AM, Mark Miller wrote:
On May 18, 2012, at 10:26 AM, Shawn Heisey wrote:
On 5/18/2012 1:42 AM, Jamel ESSOUSSI wrote:
I have an incorrect schema -->   a missing field :

and when I add a documents (UpdateResponse ur = solrServer.add(docs), I have
not be able to catch exception in solrj and the UpdateResponse cannot handle
result in UpdateResponse.

I use solr-core3.6, solr-solrj3.6 and solr.war4.0
Which SolrServer implementation are you using?  If you are using 
ConcurrentUpdateSolrServer (or its httpclient 3.x predecessor, 
StreamingUpdateSolrServer), your program will never be able to detect when an 
error occurs.
That is not strictly true. There is an error handling method you can override - 
currently it simply logs an exception. It's not an ideal solution, you won't have 
fine grained doc ->  error detection, but you can in fact detect that an error 
has occurred.

That's definitely an option, but I haven't seen any documentation telling people how to do it, and I haven't reasoned out how to do it. I think it would be better if error handling were built in, even if you can't connect it to a specific request and it's turned off by default.

I have already submitted a patch on SOLR-3284 that causes ConcurrentUpdateSolrServer to throw an exception on a subsequent request if a prior update failed. If you are only doing one update request, you would have to follow it with a commit in order to receive the error. My patch makes this new behavior the default, but it's a one-line change if that's considered too disruptive.

Thanks,
Shawn

Reply via email to