Hey Folks, I just inherited a deployed Lucene based application that
started throwing the following exception:
org.apache.lucene.search.BooleanQuery$TooManyClauses
at
org.apache.lucene.search.BooleanQuery.add(BooleanQuery.java:79)
at
org.apache.lucene.search.BooleanQuery.add(BooleanQuery.java:71)
at
org.apache.lucene.search.RangeQuery.rewrite(RangeQuery.java:99)
at
org.apache.lucene.search.BooleanQuery.rewrite(BooleanQuery.java:243)
at
org.apache.lucene.search.IndexSearcher.rewrite(IndexSearcher.java:166)
at org.apache.lucene.search.Query.weight(Query.java:84)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:117)
at org.apache.lucene.search.Hits.getMoreDocs(Hits.java:64)
at org.apache.lucene.search.Hits.<init>(Hits.java:51)
at org.apache.lucene.search.Searcher.search(Searcher.java:41)
at
com.multivision.util.search.HitIndex.search(HitIndex.java:121)
at
com.multivision.util.search.HitSearchAgent.search(HitSearchAgent.java:83
)
at com.multivision.model.HitModel.list(HitModel.java:80)
at
com.multivision.actions.client.hits.SearchAction.action(SearchAction.jav
a:81)
at
com.multivision.actions.ClientAuthenticated.doExecute(ClientAuthenticate
d.java:45)
at
com.multivision.actions.MultivisionAction.execute(MultivisionAction.java
:41)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr
ocessor.java:421)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
226)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
...
It wasn't doing this two weeks ago, but it started doing it this week. I
deleted the index directory and reindexed all the files, but that
doesn't seem to help.
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.
Thanks for your help!
Joe Krause
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]