[ 
https://issues.apache.org/jira/browse/SOLR-7127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14333425#comment-14333425
 ] 

Mark Miller commented on SOLR-7127:
-----------------------------------

{quote}I did look at adding a 'collection' parameter to request, but the 
problem there is that you'd end up having to add an optional 'collection' 
parameter to the 25 or so sugar methods on SolrClient that eventually delegate 
through to request().{quote}

It's a bunch more simple sugar methods, but from a user point of view, things 
are very simple.

bq. I don't think this impl is that complicated though?

Seems a bit complicated to me that you have to spawn off special child objects 
to talk to multiple collections. 

As a user, rather than learning a peculiar new API or thinking about and 
juggling parent / child resource objects and lifecycles and separate API's, you 
really want to be able to just say, when you are adding an individual doc, 
doing an individual optimize, or sending an individual delete, use this 
collection instead of the default.

> Add method to CloudSolrClient to create per-collection clients
> --------------------------------------------------------------
>
>                 Key: SOLR-7127
>                 URL: https://issues.apache.org/jira/browse/SOLR-7127
>             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
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to