[
https://issues.apache.org/jira/browse/SOLR-17866?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18014493#comment-18014493
]
David Smiley commented on SOLR-17866:
-------------------------------------
I find GenericSolrRequest to be "trappy" in that it's easy to overlook
setRequiresCollection. IMO collection-requiring requests are so fundamentally
different from node requests, IMO, they should be separated by the class
hierarchy. So I filed SOLR-17829 but I haven't convinced Jason. I actually
think it should go further: have a marker interface for this like
CollectionSolrRequest vs NodeSolrRequest instead of a boolean getter. Then the
SolrClient.request method that takes a collection would insist on a
CollectionSolrRequest, whereas the other would insist on a NodeSolrRequest.
I'm just riffing here; maybe this straw-man won't work.
> GenericSolrRequest.process(client,collection) ignores collection with some
> client impls
> ---------------------------------------------------------------------------------------
>
> Key: SOLR-17866
> URL: https://issues.apache.org/jira/browse/SOLR-17866
> Project: Solr
> Issue Type: Bug
> Affects Versions: 9.7, 9.8, 9.9
> Reporter: Chris M. Hostetter
> Priority: Major
>
> If you use the {{public final T process(SolrClient client, String
> collection)}} method of a {{GenericSolrRequest}} the {{collection}} param
> seems to be ignored (by default) for "single node" {{SolrClient}} impls.
> The problem does not seem to apply when using a "Cloud" based {{SolrClient}}
> impl.
> This behavior did not exist up to and including 9.6.1
> ----
> A (possible) work around is to call
> {{GenericSolrRequest.setRequiresCollection(true)}} anytime you know you
> intend to pass a non-null {{collection}} argument to the {{process(...)}}
> method
> (I have only verified this work around in a very small number of cases)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]