From f30f04a3475ed9658ab9451d2b344e579790e800 Mon Sep 17 00:00:00 2001 From: "Chris M. Hostetter" Date: Fri, 9 Mar 2012 00:34:13 +0000 Subject: [PATCH] SOLR-3077: Better error messages when attempting to use blank field names git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1298667 13f79535-47bb-0310-9956-ffa450edef68 --- solr/CHANGES.txt | 4 ++++ solr/core/src/java/org/apache/solr/schema/IndexSchema.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index e095af90ab4..39a0f9249ef 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -674,6 +674,10 @@ Other Changes * SOLR-3140: Upgrade schema version to 1.5, where omitNorms defaults to "true" for all primitive (non-analyzed) field types such as int, float, date, bool, string.. (janhoy) +* SOLR-3077: Better error messages when attempting to use "blank" field names + (Antony Stubbs via hossman) + + Build ---------------------- * SOLR-2487: Add build target to package war without slf4j jars (janhoy) diff --git a/solr/core/src/java/org/apache/solr/schema/IndexSchema.java b/solr/core/src/java/org/apache/solr/schema/IndexSchema.java index eba2502a823..7cac8994e5b 100644 --- a/solr/core/src/java/org/apache/solr/schema/IndexSchema.java +++ b/solr/core/src/java/org/apache/solr/schema/IndexSchema.java @@ -920,7 +920,7 @@ public final class IndexSchema { /*** REMOVED -YCS if (defaultFieldType != null) return new SchemaField(fieldName,defaultFieldType); ***/ - throw new SolrException( SolrException.ErrorCode.BAD_REQUEST,"undefined field "+fieldName); + throw new SolrException( SolrException.ErrorCode.BAD_REQUEST,"undefined field: \""+fieldName+"\""); } /**