Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

slightly more verbose output for TooManyClauses exception

Daniel Nabera0288da46d09
diff --git a/src/java/org/apache/lucene/search/BooleanQuery.java b/src/java/org/apache/lucene/search/BooleanQuery.java
index 4a20c52658a..47fcf7dd85e 100644
--- a/src/java/org/apache/lucene/search/BooleanQuery.java
+++ b/src/java/org/apache/lucene/search/BooleanQuery.java
@@ -41,7 +41,12 @@ public class BooleanQuery extends Query {
* a PrefixQuery, FuzzyQuery, WildcardQuery, or RangeQuery
* is expanded to many terms during search.
*/
- public static class TooManyClauses extends RuntimeException {}
+ public static class TooManyClauses extends RuntimeException {
+ public TooManyClauses() {}
+ public String getMessage() {
+ return "maxClauseCount is set to " + maxClauseCount;
+ }
+ }
/** Return the maximum number of clauses permitted, 1024 by default.
* Attempts to add more than the permitted number of clauses cause {@link