mirror of https://github.com/apache/lucene.git
SOLR-528: Better error message when defaultSearchField is bogus or not indexed
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@646135 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
fd4981f444
commit
b6fe0f58d0
|
@ -331,6 +331,9 @@ Bug Fixes
|
|||
field using bogus fieldtype and multiple copyFields to a non-multiValue
|
||||
field. (Shalin Shekhar Mangar via hossman)
|
||||
|
||||
23. SOLR-528: Better error message when defaultSearchField is bogus or not
|
||||
indexed. (Lars Kotthoff via hossman)
|
||||
|
||||
Other Changes
|
||||
1. SOLR-135: Moved common classes to org.apache.solr.common and altered the
|
||||
build scripts to make two jars: apache-solr-1.3.jar and
|
||||
|
|
|
@ -511,7 +511,13 @@ public final class IndexSchema {
|
|||
} else {
|
||||
defaultSearchFieldName=node.getNodeValue().trim();
|
||||
// throw exception if specified, but not found or not indexed
|
||||
if (defaultSearchFieldName!=null) getIndexedField(defaultSearchFieldName);
|
||||
if (defaultSearchFieldName!=null) {
|
||||
SchemaField defaultSearchField = getFields().get(defaultSearchFieldName);
|
||||
if ((defaultSearchField == null) || !defaultSearchField.indexed()) {
|
||||
String msg = "default search field '" + defaultSearchFieldName + "' not defined or not indexed" ;
|
||||
throw new SolrException( SolrException.ErrorCode.SERVER_ERROR, msg );
|
||||
}
|
||||
}
|
||||
log.info("default search field is "+defaultSearchFieldName);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue