alessandrobenedetti commented on a change in pull request #476:
URL: https://github.com/apache/solr/pull/476#discussion_r786754601
##########
File path: solr/core/src/java/org/apache/solr/update/DocumentBuilder.java
##########
@@ -151,63 +153,49 @@ public static Document toDocument(SolrInputDocument doc,
IndexSchema schema, boo
String name = field.getName();
SchemaField sfield = schema.getFieldOrNull(name);
- boolean used = false;
+ List<CopyField> copyFields = schema.getCopyFieldsList(name);
+ if( copyFields.size() == 0 ) copyFields = null;
+
// Make sure it has the correct number
- if( sfield!=null && !sfield.multiValued() && field.getValueCount() > 1 )
{
+ if( sfield!=null && !(sfield.getType() instanceof DenseVectorField) &&
!sfield.multiValued() && field.getValueCount() > 1 ) {
throw new SolrException( SolrException.ErrorCode.BAD_REQUEST,
- "ERROR: "+getID(doc, schema)+"multiple values encountered for non
multiValued field " +
- sfield.getName() + ": " +field.getValue() );
+ "ERROR: "+getID(doc, schema)+"multiple values encountered for
non multiValued field " +
+ sfield.getName() + ": " +field.getValue() );
}
- List<CopyField> copyFields = schema.getCopyFieldsList(name);
- if( copyFields.size() == 0 ) copyFields = null;
-
Review comment:
makes sense! 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]