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


##########
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:
   Wondering 'tidy' did this. I'll put it back the way it was and run tidy.



##########
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:
   Wondering if 'tidy' did this. I'll put it back the way it was and run tidy.



-- 
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