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

ASF subversion and git services commented on SOLR-17044:
--------------------------------------------------------

Commit eeb172231887a4e3c4eebd7e81ecbd16372036e6 in solr's branch 
refs/heads/main from Jason Gerlowski
[ https://gitbox.apache.org/repos/asf?p=solr.git;h=eeb17223188 ]

SOLR-17044: Expose api "version" on SolrRequest objects (#2456)

Solr uses different API roots for its v1 and v2 APIs: "/solr" for v1,
and "/api" for v2.  Adding a method for each SolrRequest to indicate
which API version it belongs to will allow SolrJ to build the full
request path more reliably without relying on fragile 'instanceof'
checks.

> Improve API path specifying in SolrJ
> ------------------------------------
>
>                 Key: SOLR-17044
>                 URL: https://issues.apache.org/jira/browse/SOLR-17044
>             Project: Solr
>          Issue Type: Improvement
>          Components: SolrJ, v2 API
>            Reporter: Jason Gerlowski
>            Assignee: Jason Gerlowski
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 3h 10m
>  Remaining Estimate: 0h
>
> Currently, URL-driven SolrClients receive a URL that typically ends in 
> "/solr".  Requiring users to specify this context-root in their URLs has made 
> sense historically, since all v1 paths start with "/solr".  But this has 
> become limiting as Solr's v2 APIs (which use the "/api" context root) become 
> more mature. 
> SolrJ has some string manipulation in a few spots to try to accomodate this, 
> but it's patchy and relatively brittle (relying on overly specific 
> 'instanceof' checks, etc.).  We should come up with a more reliable way to 
> ensure that SolrClient's can make both v1 and v2 requests.
> Here's one idea for how we could approach this:
> # Create a new SolrRequest method to specify the initial path segment (i.e. 
> /solr vs /api) on a per-request basis.  We could either do this directly 
> (e.g. "getRootPath()"), or indirectly (e.g. "isV2()").
> # Modify SolrClients to consider both the new method and the existing 
> "getPath" when sending requests.
> # Add logic to SolrJ to strip "/solr" from any provided base URLs, and 
> document that SolrClient URLs no longer require the "/solr" context-root 
> suffix.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to