On Tuesday 16 November 2004 21:35, Joe Krause wrote: > Hey Folks, I just inherited a deployed Lucene based application that > started throwing the following exception: > > org.apache.lucene.search.BooleanQuery$TooManyClauses ... > I did some research regarding this error and found out that the default > number of clauses a BooleanQuery can contain are 1024 (a limitation, but > one that seems reasonable to work with). I outputted the contents of the > org.apache.lucene.search.Query object and the > org.apache.lucene.search.Sort objects right before I sent them to the > org.apache.lucene.search.IndexSearcher - to see if there are too many > clauses being accidentally produced. This is what I get: > > 2004-11-16 12:09:40,302 DEBUG com.multivision.util.search.HitIndex - > Query = +(affiliate:teeth market:teeth dma_rank:teeth program:teeth > station:teeth text:teeth) +air_date:[0401010000 TO 0411162359] > > 2004-11-16 12:09:40,302 DEBUG com.multivision.util.search.HitIndex - > Sort = "air_date"!,"dma_rank" > > So there appears to be far fewer than 1024 clauses. Is there any other > reasons why I would be getting this exception? I am new to Lucene, so at > this point I am stumped.
The range query: +air_date:[0401010000 TO 0411162359] is almost certainly causing your problems. It expands further to all terms in the range. Several solutions to this have been discussed earlier, ao. splitting dates into day and time components. Once you approach 1000 days, you'll get the same problem again, so you might want to use a filter for the dates. See DateFilter and the archives on YYYYMMDD. Regards, Paul Elschot. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]