gerlowskija commented on code in PR #3238:
URL: https://github.com/apache/solr/pull/3238#discussion_r2047698897


##########
solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java:
##########
@@ -1001,25 +999,30 @@ protected NamedList<Object> sendRequest(SolrRequest<?> 
request, List<String> inp
 
     boolean sendToLeaders = false;
 
-    if (request instanceof IsUpdateRequest) {
-      sendToLeaders = ((IsUpdateRequest) request).isSendToLeaders() && 
this.isUpdatesToLeaders();
+    if (request.getRequestType() == SolrRequestType.UPDATE) {
+      sendToLeaders = this.isUpdatesToLeaders();
 
-      // Check if we can do a "directUpdate" ...
       if (sendToLeaders && request instanceof UpdateRequest) {
-        if (inputCollections.size() > 1) {
-          throw new SolrException(
-              SolrException.ErrorCode.BAD_REQUEST,
-              "Update request must be sent to a single collection "
-                  + "or an alias: "
-                  + inputCollections);
-        }
-        String collection =
-            inputCollections.isEmpty()
-                ? null
-                : inputCollections.get(0); // getting first mimics HttpSolrCall
-        NamedList<Object> response = directUpdate((AbstractUpdateRequest) 
request, collection);
-        if (response != null) {
-          return response;
+        var updateRequest = (UpdateRequest) request;

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to