mirror of https://github.com/apache/lucene.git
Adding the document id to error message when you send multiple values for a single valued field.
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@583320 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3de84b4857
commit
e9c5d47cf3
|
@ -179,8 +179,13 @@ public class DocumentBuilder {
|
||||||
|
|
||||||
// Make sure it has the correct number
|
// Make sure it has the correct number
|
||||||
if( sfield!=null && !sfield.multiValued() && field.getValueCount() > 1 ) {
|
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,
|
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() );
|
sfield.getName() + ": " +field.getValue() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue