joel-bernstein commented on code in PR #1651:
URL: https://github.com/apache/solr/pull/1651#discussion_r1201070607


##########
solr/core/src/java/org/apache/solr/update/DocumentBuilder.java:
##########
@@ -322,13 +325,18 @@ private static boolean addCopyFields(
       // Dense Vector Fields can only be copied to same field type
       if (originalFieldType instanceof DenseVectorField
           && !(destinationField.getType() instanceof DenseVectorField)) {
-        throw new SolrException(
-            SolrException.ErrorCode.BAD_REQUEST,
-            "The copy field destination must be a DenseVectorField: " + 
destinationField.getName());
+        if (schema.getCopySources(destinationField.getName()).contains("*")) {
+          continue;
+        } else {
+          throw new SolrException(
+              SolrException.ErrorCode.BAD_REQUEST,
+              "The copy field destination must be a DenseVectorField: "
+                  + destinationField.getName());
+        }
       }
 
       // check if the copy field is a multivalued or not
-      if (!destinationField.multiValued() && destHasValues) {

Review Comment:
   Learned something new:
   
   https://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.22.2
   
   The '&' behaves like a boolean logical operator in with boolean operands. So 
'&&' is the same as '&' in this case. I'm 90% sure I didn't fat finger this. 
tidy didn't seem to make this change, possibly intellj did.



-- 
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: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to