diff --git a/src/java/org/apache/solr/update/DocumentBuilder.java b/src/java/org/apache/solr/update/DocumentBuilder.java index 435c7697803..1369ee78978 100644 --- a/src/java/org/apache/solr/update/DocumentBuilder.java +++ b/src/java/org/apache/solr/update/DocumentBuilder.java @@ -179,8 +179,13 @@ public class DocumentBuilder { // Make sure it has the correct number if( sfield!=null && !sfield.multiValued() && field.getValueCount() > 1 ) { + String id = ""; + SchemaField sf = schema.getUniqueKeyField(); + if( sf != null ) { + id = "["+doc.getFieldValue( sf.getName() )+"] "; + } throw new SolrException( SolrException.ErrorCode.BAD_REQUEST, - "ERROR: multiple values encountered for non multiValued field " + + "ERROR: "+id+"multiple values encountered for non multiValued field " + sfield.getName() + ": " +field.getValue() ); }