This is an automated email from the ASF dual-hosted git repository. dsmiley pushed a commit to branch branch_10_0 in repository https://gitbox.apache.org/repos/asf/solr.git
commit a401ad60bb5b0ac32964ef0e9696c05459cf83f3 Author: David Smiley <[email protected]> AuthorDate: Sun Nov 30 15:32:35 2025 -0500 SOLR-17996: improve documentation, etc. --- changelog/unreleased/SOLR-17996-requestWithBaseUrl.yml | 2 +- .../src/java/org/apache/solr/client/solrj/SolrRequest.java | 12 ++++++++++-- .../java/org/apache/solr/client/solrj/impl/LBSolrClient.java | 7 +++---- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/changelog/unreleased/SOLR-17996-requestWithBaseUrl.yml b/changelog/unreleased/SOLR-17996-requestWithBaseUrl.yml index 99c4c8c40e9..814187a7635 100644 --- a/changelog/unreleased/SOLR-17996-requestWithBaseUrl.yml +++ b/changelog/unreleased/SOLR-17996-requestWithBaseUrl.yml @@ -1,5 +1,5 @@ # See https://github.com/apache/solr/blob/main/dev-docs/changelog.adoc -title: New SolrJ SolrRequest.requestWithBaseUrl, new HttpSolrClientBase.requestWithBaseUrl +title: New SolrJ SolrRequest.requestWithBaseUrl, new HttpSolrClientBase.processWithBaseUrl. Existing callers will require updates due to a signature change. type: other # added, changed, fixed, deprecated, removed, dependency_update, security, other authors: - name: David Smiley diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/SolrRequest.java b/solr/solrj/src/java/org/apache/solr/client/solrj/SolrRequest.java index b3a4eee893e..22cd231552e 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/SolrRequest.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/SolrRequest.java @@ -293,13 +293,21 @@ public abstract class SolrRequest<T> implements Serializable { } /** + * Send this request to a {@link SolrClient} and return the response + * + * @param client the SolrClient to communicate with + * @param baseUrl the base URL, e.g. {@code Http://localhost:8983/solr} + * @param collection the collection to execute the request against + * @return the response + * @throws SolrServerException if there is an error on the Solr server + * @throws IOException if there is a communication error * @lucene.experimental */ - public final T processWithBaseUrl(HttpSolrClientBase client, String url, String collection) + public final T processWithBaseUrl(HttpSolrClientBase client, String baseUrl, String collection) throws SolrServerException, IOException { // duplicative with process(), except for requestWithBaseUrl long startNanos = System.nanoTime(); - var namedList = client.requestWithBaseUrl(url, this, collection); + var namedList = client.requestWithBaseUrl(baseUrl, this, collection); long endNanos = System.nanoTime(); T typedResponse = createResponse(namedList); // SolrResponse is pre-V2 API diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBSolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBSolrClient.java index 920b3c49821..2bfa5ad5f00 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBSolrClient.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBSolrClient.java @@ -614,10 +614,9 @@ public abstract class LBSolrClient extends SolrClient { private NamedList<Object> doRequest( SolrClient solrClient, String baseUrl, String collection, SolrRequest<?> solrRequest) throws SolrServerException, IOException { - // Some implementations of LBSolrClient.getClient(...) return a HttpJettySolrClient that may not - // be - // pointed at the desired URL (or any URL for that matter). We special case that here to ensure - // the appropriate URL is provided. + // Some implementations of LBSolrClient.getClient(...) return a HttpSolrClientBase that may not + // be pointed at the desired URL (or any URL for that matter). We special-case that here to + // ensure the appropriate URL is provided. if (solrClient instanceof HttpSolrClientBase hasReqWithUrl) { return hasReqWithUrl.requestWithBaseUrl(baseUrl, solrRequest, collection); }
