When using a prefix or wildcard query (where this is most likely to occur) I don't think TooManyClauses is thrown under the parser, but rather when searching, as the query isn't rewritten until it's executed.
If that was the case, then this test would fail, right?
public void testBooleanQuery() throws Exception {
BooleanQuery.setMaxClauseCount(2);
try {
QueryParser.parse("one two three", "field", new WhitespaceAnalyzer());
fail("ParseException expected due to too many boolean clauses");
} catch (ParseException expected) {
// too many boolean clauses, so ParseException is expected
}
}
This test case is not a prefix or wildcard query that expands into a BooleanQuery. Most folks neither change the default max clause count nor attempt to parse queries with more than 1000 terms.
TooManyClauses is more typically thrown under Searcher.search(), which calls Query.weight() which calls Query.rewrite() which, for prefix and wildcard queries, constructs a new BooleanQuery and adds lots of terms to it.
Doug
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]