LUCENE-746: Fix error message in AnalyzingQueryParser.getPrefixQuery.

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@607832 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Busch 2008-01-01 12:49:44 +00:00
parent 90a735441f
commit 75473edb02
2 changed files with 7 additions and 3 deletions

View File

@ -344,6 +344,9 @@ Documentation
classes, as well as an unified view. Also add an appropriate menu
structure to the website. (Michael Busch)
2. LUCENE-746: Fix error message in AnalyzingQueryParser.getPrefixQuery.
(Ronnie Kolehmainen via Michael Busch)
Build
1. LUCENE-908: Improvements and simplifications for how the MANIFEST

View File

@ -212,10 +212,11 @@ public class AnalyzingQueryParser extends org.apache.lucene.queryParser.QueryPar
if (tlist.size() == 1) {
return super.getPrefixQuery(field, (String) tlist.get(0));
} else {
/* this means that the analyzer used consumed the only token we had,
* and we can't build a PrefixQuery */
/* this means that the analyzer used either added or consumed
* (common for a stemmer) tokens, and we can't build a PrefixQuery */
throw new ParseException("Cannot build PrefixQuery with analyzer "
+ getAnalyzer().getClass() + " - token was consumed");
+ getAnalyzer().getClass()
+ (tlist.size() > 1 ? " - token(s) added" : " - token consumed"));
}
}