On 2/4/2013 11:42 AM, Mikhail Khludnev wrote:
I don't know how post.jar built on, but FWIW, http://lucene.apache.org/solr/api-4_0_0-BETA/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrServer.html sounds like what you need.
Just an FYI - unless you override the handleError method in that class in a suitable way, the concurrent server object will not inform you that an error has occurred. The app will *log* errors, but will always report success to the code that makes the update request.
There are no examples that I know of for how to override handleError so the app can detect errors. There may not be any way to detect which update request actually caused an error without modifying Solr source code. I have filed SOLR-3284 to deal with these problems. I haven't had time to work on a new patch for that issue.
At the moment, if you want multiple threads *and* try/catch based error handling, you'll have to create those threads yourself and use HttpSolrServer. If you don't care about errors, the concurrent server object will do just fine.
Thanks, Shawn