On Wednesday, November 26, 2003, at 11:44 AM, Doug Cutting wrote:Erik Hatcher wrote:I concur and have just modified QueryParser to throw a ParseException instead when a TooManyClauses exception is thrown.
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
}
}
But it passes.
Nevermind.... my test is not for prefix or wildcard query, but it does show that TooManyClauses can be thrown from QueryParser.parse, which I still feel deserves a ParseException.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]