alessandrobenedetti commented on a change in pull request #476:
URL: https://github.com/apache/solr/pull/476#discussion_r786770913
##########
File path: solr/core/src/java/org/apache/solr/update/DocumentBuilder.java
##########
@@ -258,6 +246,48 @@ public static Document toDocument(SolrInputDocument doc,
IndexSchema schema, boo
return out;
}
+ private static boolean addOriginalField( Object originalFieldValue,
SchemaField sfield, boolean forInPlaceUpdate, Document out, Set<String>
usedFields) {
+ addField(out, sfield, originalFieldValue, forInPlaceUpdate);
+ // record the field as having a value
+ usedFields.add(sfield.getName());
+ return true;
+ }
+
+ private static boolean addCopyFields(Object originalFieldValue, FieldType
originalFieldType, List<CopyField> copyFields, boolean forInPlaceUpdate, String
uniqueKeyFieldName, Document out, Set<String> usedFields) {
+ boolean used = false;
+ for (CopyField cf : copyFields) {
+ SchemaField destinationField = cf.getDestination();
+
+ final boolean destHasValues =
usedFields.contains(destinationField.getName());
+
+ // 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());
+ }
Review comment:
Yes, you'll get an exception telling that, just added the test!
--
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]