lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Himanshu Karki <>
Subject BooleanQuery.maxClauseCount exception
Date Tue, 13 Oct 2009 07:25:54 GMT

We are using version for our website. With the latest index files of size
around 62GB it is hitting the 'BooleanQuery.maxClauseCount' exception while doing the search
sometimes and surely when search is being done by wildcard queries.

I had browsed JIRA for the reported issues and found that it is the 'memory-trade off'. My
website runs perfectly fine when I replace 1024 (Default value) with  'Int.MaxValue'. But
to make it more optimal,  I would prefer the below solution as mentioned in LuceneFAQ (

"Use a filter to replace the part of the query that causes the exception. For example, a RangeFilter
can replace a RangeQuery on date fields and it will never throw the TooManyClauses exception
-- You can even use ConstantScoreRangeQuery to execute your RangeFilter as a Query. Note that
filters are slower than queries when used for the first time, so you should cache them using
Using Filters in place of Queries generated by QueryParser can be achieved by subclassing
QueryParser and overriding the appropriate function to return a ConstantScore version of your

But I am unable to understand it completely. Need help to understand and implement it. Preferable
would be code-snippet.



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message