[
https://issues.apache.org/jira/browse/SOLR-15735?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17838678#comment-17838678
]
Jason Gerlowski commented on SOLR-15735:
----------------------------------------
Hi [~ycallea]. Apologies for the confusion and bad experience here. I
absolutely agree that these generated SolrJ classes aren't yet where they need
to be.
Myself and a few others have been working on the "/solr" vs "/api" path prefix
issue (see SOLR-17044 and SOLR-17066). But we're not there yet. 9.x in
particular has some complications we won't have in Solr 10 - namely, that 9.x
users may customize the "root path" that Solr uses for its APIs. This makes it
tricky for SolrJ to inspect and manipulate the URL path correctly in all cases.
(This also goes for the V2Request workaround you mentioned above - it manages
the path correctly in the "normal" case but will fail on any clusters that have
customized the root path.)
In the interim, we've done our best to flag the path-prefix issue in the
Javadocs on these classes. e.g.
bq. All SolrRequest implementations rely on v2 APIs which may require a
SolrClient configured to use the '/api' path prefix, instead of '/solr'.
If you'd like to use 'ClusterApi.BalanceReplicas', you should be able to so
long as you use a (non-"cloud") SolrClient that uses "/api" as its path prefix
instead of "/solr". e.g.
{code}
final SolrClient v2Client = new
Http2SolrClient.Builder("http://someHostName:8983/api").build();
final var balanceRequest = new BalanceReplicas();
...set request params ...
final var balanceResponse = balanceRequest.process(v2Client);
{code}
Again, sorry for the trouble - but hopefully it helps to know that we're
actively working towards a better UX here!
> SolrJ should fully support Solr's v2 API
> ----------------------------------------
>
> Key: SOLR-15735
> URL: https://issues.apache.org/jira/browse/SOLR-15735
> Project: Solr
> Issue Type: Improvement
> Components: v2 API
> Reporter: Jason Gerlowski
> Priority: Major
> Labels: V2
>
> Having our v2 API exercised by our test suite would provide a needed boost of
> confidence and serve to flush out any existing gaps. Doing this though
> requires that the v2 API is exposed through SolrJ, since SolrJ is mostly what
> our tests are based on.
> This ticket serves as an umrella to track whatever works ends up being
> necessary for updating SolrJ to use the V2 API. At a minimum, this will need
> to include updating individual SolrRequest objects to use a v2 API, and
> ensuring that SolrClient's offer the same optimizations in routing, etc. to
> v2 requests as they do for v1.
> One open question that'll impact the scope of this work significantly is
> whether SolrJ must support v1 and v2 simultaneously, or whether individual
> SolrRequest implementations can be switched over to v2 without retaining v1
> support. (See discussion of this
> [here|https://issues.apache.org/jira/browse/SOLR-15141?focusedCommentId=17435576&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17435576]).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]