* The same thing goes for writes. This class simply delegates to the delegate passed into the constructor.
*
* @author Kelly Tisdell
*/
-public class DelegatingHttpSolrClient extends SolrClient {
+public class DelegatingHttpJettySolrClient extends SolrClient {
@Serial
private static final long serialVersionUID = 1L;
- protected final HttpSolrClient delegate;
+ protected final HttpJettySolrClient delegate;
protected final String defaultCollection;
protected final String defaultCollectionPath;
- public DelegatingHttpSolrClient(HttpSolrClient delegate) {
+ public DelegatingHttpJettySolrClient(HttpJettySolrClient delegate) {
Assert.notNull(delegate, "SolrClient cannot be null.");
this.delegate = delegate;
this.defaultCollection = null;
defaultCollectionPath = null;
}
- public DelegatingHttpSolrClient(HttpSolrClient delegate, String defaultCollection) {
+ public DelegatingHttpJettySolrClient(HttpJettySolrClient delegate, String defaultCollection) {
Assert.notNull(delegate, "SolrClient cannot be null.");
this.delegate = delegate;
if (StringUtils.isNotBlank(defaultCollection)) {
@@ -643,9 +643,8 @@ public SolrDocumentList getById(Collection
* The adminServer is just a reference to a SolrClient component for connecting to Solr. In newer
@@ -102,16 +102,16 @@ public class SolrConfiguration implements InitializingBean {
public SolrConfiguration(SolrClient solrServer, SolrClient reindexServer, SolrClient adminServer) throws IllegalStateException {
//get primary and reindex names from http urls
- if (HttpSolrClient.class.isAssignableFrom(solrServer.getClass())) {
- this.setPrimaryName(determineCoreName((HttpSolrClient) solrServer));
- } else if (DelegatingHttpSolrClient.class.isAssignableFrom(solrServer.getClass())) {
- this.setPrimaryName(((DelegatingHttpSolrClient) solrServer).getDefaultCollection());
+ if (HttpJettySolrClient.class.isAssignableFrom(solrServer.getClass())) {
+ this.setPrimaryName(determineCoreName((HttpJettySolrClient) solrServer));
+ } else if (DelegatingHttpJettySolrClient.class.isAssignableFrom(solrServer.getClass())) {
+ this.setPrimaryName(((DelegatingHttpJettySolrClient) solrServer).getDefaultCollection());
}
- if (HttpSolrClient.class.isAssignableFrom(reindexServer.getClass())) {
- this.setReindexName(determineCoreName((HttpSolrClient) reindexServer));
- } else if (DelegatingHttpSolrClient.class.isAssignableFrom(reindexServer.getClass())) {
- this.setReindexName(((DelegatingHttpSolrClient) reindexServer).getDefaultCollection());
+ if (HttpJettySolrClient.class.isAssignableFrom(reindexServer.getClass())) {
+ this.setReindexName(determineCoreName((HttpJettySolrClient) reindexServer));
+ } else if (DelegatingHttpJettySolrClient.class.isAssignableFrom(reindexServer.getClass())) {
+ this.setReindexName(((DelegatingHttpJettySolrClient) reindexServer).getDefaultCollection());
}
this.setServer(solrServer);
@@ -121,7 +121,7 @@ public SolrConfiguration(SolrClient solrServer, SolrClient reindexServer, SolrCl
/**
* Sets up Solr using multiple clients, one primary, one for reindexing, and one admin to reduce down time during
- * indexing. This constructor should be used when setting up HttpSolrClient since no collection names are
+ * indexing. This constructor should be used when setting up HttpJettySolrClient since no collection names are
* being provided. Namespace can be specified if managing multiple document sets within the same cores.
*
* The adminServer is just a reference to a SolrClient component for connecting to Solr. In newer
@@ -146,23 +146,23 @@ public SolrConfiguration(
String namespace
) throws IllegalStateException {
this.setNamespace(namespace);
- if (HttpSolrClient.class.isAssignableFrom(solrServer.getClass())) {
- this.setPrimaryName(determineCoreName((HttpSolrClient) solrServer));
- } else if (DelegatingHttpSolrClient.class.isAssignableFrom(solrServer.getClass())) {
- if (((DelegatingHttpSolrClient) solrServer).getDefaultCollection() == null) {
- this.setReindexName(determineCoreName(((DelegatingHttpSolrClient) solrServer).getDelegate()));
+ if (HttpJettySolrClient.class.isAssignableFrom(solrServer.getClass())) {
+ this.setPrimaryName(determineCoreName((HttpJettySolrClient) solrServer));
+ } else if (DelegatingHttpJettySolrClient.class.isAssignableFrom(solrServer.getClass())) {
+ if (((DelegatingHttpJettySolrClient) solrServer).getDefaultCollection() == null) {
+ this.setReindexName(determineCoreName(((DelegatingHttpJettySolrClient) solrServer).getDelegate()));
} else {
- this.setReindexName(((DelegatingHttpSolrClient) solrServer).getDefaultCollection());
+ this.setReindexName(((DelegatingHttpJettySolrClient) solrServer).getDefaultCollection());
}
}
- if (HttpSolrClient.class.isAssignableFrom(reindexServer.getClass())) {
- this.setReindexName(determineCoreName((HttpSolrClient) reindexServer));
- } else if (DelegatingHttpSolrClient.class.isAssignableFrom(solrServer.getClass())) {
- if (((DelegatingHttpSolrClient) reindexServer).getDefaultCollection() == null) {
- this.setReindexName(determineCoreName(((DelegatingHttpSolrClient) reindexServer).getDelegate()));
+ if (HttpJettySolrClient.class.isAssignableFrom(reindexServer.getClass())) {
+ this.setReindexName(determineCoreName((HttpJettySolrClient) reindexServer));
+ } else if (DelegatingHttpJettySolrClient.class.isAssignableFrom(solrServer.getClass())) {
+ if (((DelegatingHttpJettySolrClient) reindexServer).getDefaultCollection() == null) {
+ this.setReindexName(determineCoreName(((DelegatingHttpJettySolrClient) reindexServer).getDelegate()));
} else {
- this.setReindexName(((DelegatingHttpSolrClient) reindexServer).getDefaultCollection());
+ this.setReindexName(((DelegatingHttpJettySolrClient) reindexServer).getDefaultCollection());
}
}
@@ -173,7 +173,7 @@ public SolrConfiguration(
/**
* Sets up Solr using multiple clients, one primary, one for reindexing, and one admin to reduce down time during
- * indexing. This constructor should be used when setting up LBHttpSolrClients because primaryCoreName and
+ * indexing. This constructor should be used when setting up LBHttpJettySolrClients because primaryCoreName and
* reindexCoreName need to be provided to SolrConfiguration.
*
* The adminServer is just a reference to a SolrClient component for connecting to Solr. In newer
@@ -208,7 +208,7 @@ public SolrConfiguration(
/**
* Sets up Solr using multiple clients, one primary, one for reindexing, and one admin to reduce down time during
- * indexing. This constructor should be used when setting up LBHttpSolrClients because primaryCoreName and
+ * indexing. This constructor should be used when setting up LBHttpJettySolrClients because primaryCoreName and
* reindexCoreName need to be provided to SolrConfiguration. Namespace can be specified if managing multiple
* document sets within the same cores.
*
@@ -431,8 +431,8 @@ public SolrClient getServer() {
/**
* Sets the primary SolrClient instance to communicate with Solr. This is typically one of the following:
* org.apache.solr.client.solrj.embedded.EmbeddedSolrClient,
- * org.apache.solr.client.solrj.impl.HttpSolrClient,
- * org.apache.solr.client.solrj.impl.LBHttpSolrClient,
+ * org.apache.solr.client.solrj.impl.HttpJettySolrClient,
+ * org.apache.solr.client.solrj.impl.LBHttpJettySolrClient,
* or org.apache.solr.client.solrj.impl.CloudSolrClient
*
* @param server SolrClient
@@ -441,9 +441,8 @@ public SolrClient getServer() {
public void setServer(SolrClient server) throws IllegalStateException {
if (server != null && CloudSolrClient.class.isAssignableFrom(server.getClass())) {
CloudSolrClient cs = (CloudSolrClient) server;
- if (StringUtils.isBlank(cs.getDefaultCollection())) {
- cs.setDefaultCollection(getPrimaryName());
- }
+ // Note: In Solr 10+, CloudSolrClient is immutable and defaultCollection must be set via builder
+ // We can only validate here, not set
if (reindexServer != null) {
//If we already have a reindex server set, make sure it's not the same instance as the primary
@@ -491,9 +490,8 @@ public SolrClient getReindexServer() {
public void setReindexServer(SolrClient server) throws IllegalStateException {
if (server != null && CloudSolrClient.class.isAssignableFrom(server.getClass())) {
CloudSolrClient cs = (CloudSolrClient) server;
- if (StringUtils.isBlank(cs.getDefaultCollection())) {
- cs.setDefaultCollection(getReindexName());
- }
+ // Note: In Solr 10+, CloudSolrClient is immutable and defaultCollection must be set via builder
+ // We can only validate here, not set
if (primaryServer != null) {
//If we already have a reindex server set, make sure it's not the same instance as the primary
@@ -792,7 +790,7 @@ public String getReindexCollectionName() {
return null;
}
- protected String determineCoreName(HttpSolrClient httpSolrClient) {
+ protected String determineCoreName(HttpJettySolrClient httpSolrClient) {
String url = httpSolrClient.getBaseURL();
return url.substring(url.lastIndexOf('/') + 1);
}
diff --git a/core/broadleaf-framework/src/main/java/org/broadleafcommerce/core/search/service/solr/SolrHelperService.java b/core/broadleaf-framework/src/main/java/org/broadleafcommerce/core/search/service/solr/SolrHelperService.java
index 263738a345..2d952e5b08 100644
--- a/core/broadleaf-framework/src/main/java/org/broadleafcommerce/core/search/service/solr/SolrHelperService.java
+++ b/core/broadleaf-framework/src/main/java/org/broadleafcommerce/core/search/service/solr/SolrHelperService.java
@@ -18,7 +18,7 @@
package org.broadleafcommerce.core.search.service.solr;
import org.apache.solr.client.solrj.SolrClient;
-import org.apache.solr.client.solrj.SolrQuery;
+import org.apache.solr.client.solrj.request.SolrQuery;
import org.apache.solr.client.solrj.response.QueryResponse;
import org.apache.solr.common.SolrDocument;
import org.apache.solr.common.SolrInputDocument;
diff --git a/core/broadleaf-framework/src/main/java/org/broadleafcommerce/core/search/service/solr/SolrHelperServiceImpl.java b/core/broadleaf-framework/src/main/java/org/broadleafcommerce/core/search/service/solr/SolrHelperServiceImpl.java
index a8656378bb..8001d8b74b 100644
--- a/core/broadleaf-framework/src/main/java/org/broadleafcommerce/core/search/service/solr/SolrHelperServiceImpl.java
+++ b/core/broadleaf-framework/src/main/java/org/broadleafcommerce/core/search/service/solr/SolrHelperServiceImpl.java
@@ -26,9 +26,9 @@
import org.apache.commons.logging.LogFactory;
import org.apache.commons.text.StringEscapeUtils;
import org.apache.solr.client.solrj.SolrClient;
-import org.apache.solr.client.solrj.SolrQuery;
-import org.apache.solr.client.solrj.SolrQuery.ORDER;
-import org.apache.solr.client.solrj.SolrQuery.SortClause;
+import org.apache.solr.client.solrj.request.SolrQuery;
+import org.apache.solr.client.solrj.request.SolrQuery.ORDER;
+import org.apache.solr.client.solrj.request.SolrQuery.SortClause;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.impl.CloudSolrClient;
import org.apache.solr.client.solrj.request.CollectionAdminRequest;
diff --git a/core/broadleaf-framework/src/main/java/org/broadleafcommerce/core/search/service/solr/SolrSearchServiceExtensionHandler.java b/core/broadleaf-framework/src/main/java/org/broadleafcommerce/core/search/service/solr/SolrSearchServiceExtensionHandler.java
index 87afce7f3d..52b2ebd7b7 100644
--- a/core/broadleaf-framework/src/main/java/org/broadleafcommerce/core/search/service/solr/SolrSearchServiceExtensionHandler.java
+++ b/core/broadleaf-framework/src/main/java/org/broadleafcommerce/core/search/service/solr/SolrSearchServiceExtensionHandler.java
@@ -17,7 +17,7 @@
*/
package org.broadleafcommerce.core.search.service.solr;
-import org.apache.solr.client.solrj.SolrQuery;
+import org.apache.solr.client.solrj.request.SolrQuery;
import org.apache.solr.client.solrj.response.QueryResponse;
import org.apache.solr.common.SolrDocument;
import org.broadleafcommerce.common.extension.ExtensionHandler;
diff --git a/core/broadleaf-framework/src/main/java/org/broadleafcommerce/core/search/service/solr/SolrSearchServiceImpl.java b/core/broadleaf-framework/src/main/java/org/broadleafcommerce/core/search/service/solr/SolrSearchServiceImpl.java
index c643400661..33cf71450c 100644
--- a/core/broadleaf-framework/src/main/java/org/broadleafcommerce/core/search/service/solr/SolrSearchServiceImpl.java
+++ b/core/broadleaf-framework/src/main/java/org/broadleafcommerce/core/search/service/solr/SolrSearchServiceImpl.java
@@ -22,7 +22,7 @@
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.solr.client.solrj.SolrQuery;
+import org.apache.solr.client.solrj.request.SolrQuery;
import org.apache.solr.client.solrj.SolrRequest.METHOD;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.response.QueryResponse;
diff --git a/pom.xml b/pom.xml
index df4e070753..9ef10c444d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -644,6 +644,23 @@