Hi, We are using Lucene.net 2.1.0.3 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 (http://wiki.apache.org/jakarta-lucene/LuceneFAQ#Why_am_I_getting_a_TooManyClauses_exception.3F) - "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 CachingWrapperFilter<http://lucene.apache.org/java/docs/api/org/apache/lucene/search/CachingWrapperFilter.html>. 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 Query." But I am unable to understand it completely. Need help to understand and implement it. Preferable would be code-snippet. Cheers, HIMANSHU KARKI
