Index: BooleanQuery.java =================================================================== --- BooleanQuery.java (revision 413208) +++ BooleanQuery.java (working copy) @@ -17,6 +17,7 @@ */ import org.apache.lucene.index.IndexReader; +import org.apache.lucene.util.PriorityQueue; import org.apache.lucene.util.ToStringUtils; import java.io.IOException; @@ -63,8 +64,9 @@ * the operating system. */ public static void setMaxClauseCount(int maxClauseCount) { - if (maxClauseCount < 1) - throw new IllegalArgumentException("maxClauseCount must be >= 1"); + int maxv = PriorityQueue.MAX_QUEUE_SIZE; + if (maxClauseCount < 1 || maxClauseCount > maxv) + throw new IllegalArgumentException("maxClauseCount must be >= 1 and <= "+maxv); BooleanQuery.maxClauseCount = maxClauseCount; }