Jorge: Another thing to consider: CloudSolrClient is a much better choice in cloud environments that CUSC. What you're seeing isn't right, no doubt but using the other class may: 1> not require a work-around 2> be much more efficient.
In a sharded situation, CloudSolrClient will route all the documents to the correct leader, leading to better performance. That class scales nearly linearly in terms of indexing throughput with the number of shards.... FWIW, Erick On Sat, Jun 27, 2015 at 2:32 AM, Jorge Luis Betancourt González <jlbetanco...@uci.cu> wrote: > Thanks for the prompt reply Shawn. I've created an issue about this [1] from > the code the collection parameter is clearly ignored unless is a commit or > the UpdateParams.WAIT_SEARCHER parameter is set in the params of the request, > which is an indication of a commit/optimize. > > The queue only contain UpdateRequest objects which doesn't hold any data > about the collection. > > Regards, > > ----- Original Message ----- > From: "Shawn Heisey" <apa...@elyograg.org> > To: solr-user@lucene.apache.org > Sent: Friday, June 26, 2015 5:10:24 PM > Subject: ConcurrentUpdateSolrClient ignoring the collection param in some > methods > > On 6/26/2015 2:27 PM, Jorge Luis Betancourt González wrote: >> I'm trying to use the ConcurrentUpdateSolrClient class, that has some >> methods that accept and aditional parameter to indicate the collection, some >> of this methods are add(String collection, SolrInputDocument doc), >> request(SolrRequest, String collection). With HttpSolrClient this works >> flawlessly, but with ConcurrentUpdateSolrClient the request gets made >> against the URL specified in the constructor. >> >> In the case of the commit(String collection) method, works without any >> trouble and the commit gets fired against the desired collection. > > This is definitely a bug. Can you open an issue in Jira? > > Looking into how an update request actually gets added to the background > queue in ConcurrentUpdateSolrClient, it appears that the "collection" > information is ignored before the request is added to the queue. > > As a workaround until the bug can be fixed, instead of this: > > client.add("status", doc); > > Use this (assuming that your update handler is indeed /update, which it > normally will be): > > UpdateRequest req = new UpdateRequest("/status/update"); > req.add(doc); > req.process(_client); > > Thanks, > Shawn