Apache Solr open-source search software
LUCENE-746: Fix error message in AnalyzingQueryParser.getPrefixQuery.
Michael Busch75473edb02ad
diff --git a/CHANGES.txt b/CHANGES.txtindex 8c4d73d5ace..5c9ef9c4fae 100644--- a/CHANGES.txt+++ b/CHANGES.txt@@ -344,6 +344,9 @@ Documentationclasses, as well as an unified view. Also add an appropriate menustructure to the website. (Michael Busch)+ 2. LUCENE-746: Fix error message in AnalyzingQueryParser.getPrefixQuery.+ (Ronnie Kolehmainen via Michael Busch)+Build1. LUCENE-908: Improvements and simplifications for how the MANIFESTdiff --git a/contrib/miscellaneous/src/java/org/apache/lucene/queryParser/analyzing/AnalyzingQueryParser.java b/contrib/miscellaneous/src/java/org/apache/lucene/queryParser/analyzing/AnalyzingQueryParser.javaindex 4518eaa0cc5..7d4cbd872dc 100644--- a/contrib/miscellaneous/src/java/org/apache/lucene/queryParser/analyzing/AnalyzingQueryParser.java+++ b/contrib/miscellaneous/src/java/org/apache/lucene/queryParser/analyzing/AnalyzingQueryParser.java@@ -212,10 +212,11 @@ public class AnalyzingQueryParser extends org.apache.lucene.queryParser.QueryParif (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"));}}