mirror of https://github.com/apache/lucene.git
SOLR-220 -- adding a nicer error message when you sort on an undefined field.
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@533560 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
25a185b7da
commit
d273f54151
|
@ -199,7 +199,13 @@ public class QueryParsing {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// getField could throw an exception if the name isn't found
|
// getField could throw an exception if the name isn't found
|
||||||
SchemaField f = schema.getField(part);
|
SchemaField f = null;
|
||||||
|
try{
|
||||||
|
f = schema.getField(part);
|
||||||
|
}
|
||||||
|
catch( SolrException e ){
|
||||||
|
throw new SolrException( 400, "can not sort on undefined field: "+part, e );
|
||||||
|
}
|
||||||
if (f == null || !f.indexed()){
|
if (f == null || !f.indexed()){
|
||||||
throw new SolrException( 400, "can not sort on unindexed field: "+part );
|
throw new SolrException( 400, "can not sort on unindexed field: "+part );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue