lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alan Woodward (JIRA)" <>
Subject [jira] [Commented] (SOLR-7127) Add method to CloudSolrClient to create per-collection clients
Date Sat, 21 Feb 2015 21:25:11 GMT


Alan Woodward commented on SOLR-7127:

I'd missed get/setIdField(), which I guess is something that you might want to change (although
that really ought to be part of the Router config, but hey - one issue at a time...)

How about instead of returning a vanilla SolrClient, we return a CollectionSolrClient, which
is an extension of CloudSolrClient with all the setters overridden to throw UnsupportedOperationException.
 That also makes it easier to track whether or not we should close resources, etc.

> Add method to CloudSolrClient to create per-collection clients
> --------------------------------------------------------------
>                 Key: SOLR-7127
>                 URL:
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Alan Woodward
>            Assignee: Alan Woodward
>            Priority: Minor
>         Attachments: SOLR-7127.patch, SOLR-7127.patch
> CloudSolrClient isn't thread-safe if you're making requests to multiple collections,
because defaultCollection is mutable.  This can be a pain if you're trying to index into multiple
collections from a single queue of documents.
> This issue adds a .getCollectionClient(String) method to CloudSolrClient that returns
a child client directed at that collection.  Under the hood it's another CloudSolrClient sharing
it's resources with the parent client, but with a separate default collection set.  The method
returns a SolrClient, however, so you can't then change the collection unless you explicitly
cast it.
> Sort of related to what I wanted to do on SOLR-6894, but this is more focussed.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message