Apache Solr open-source search software
SOLR-17996: improve documentation, etc.
David Smiley9baacc8d6d43
diff --git a/changelog/unreleased/SOLR-17996-requestWithBaseUrl.yml b/changelog/unreleased/SOLR-17996-requestWithBaseUrl.ymlindex 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, otherauthors:- name: David Smileydiff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/SolrRequest.java b/solr/solrj/src/java/org/apache/solr/client/solrj/SolrRequest.javaindex 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 requestWithBaseUrllong 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 APIdiff --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.javaindex 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);}