The TooManyClauses exception is due to the prefix query being rewritten to
a boolean query that exceeds the boolean queries maximum number of clauses.
Its an unchecked exception from the search method that you should probably
explicitly catch and then return a helpful message to the user maybe
suggesting they refine their search?

        try
        {
            Hits h = searcher.search(query, filter, sort);

        }
        catch (TooManyClauses e)
        {
            // return a msg to user that the query was too general
        }

Regards

Paul I.



                                                                           
             "Daniel Pfeifer"                                              
             <[EMAIL PROTECTED]                                             
             radedoubler.com>                                           To 
                                       <java-user@lucene.apache.org>       
             24/01/2006 13:52                                           cc 
                                                                           
                                                                   Subject 
             Please respond to         Two strange things in Lucene        
             [EMAIL PROTECTED]                                             
                apache.org                                                 
                                                                           
                                                                           
                                                                           
                                                                           




Today I've been alerted by one of my collegues that our Lucene-based
indexing solution no longer refreshes the searchers and thus we never
get any new indexed documents.

Since I didn't find anything in the log from log4j I did a "kill -3" on
the process and found two very interesting things:

Almost all multisearcher threads were in this state:

"MultiSearcher thread #1" daemon prio=10 tid=0x0000000001900960
nid=0x81442c waiting for monitor entry
[0xfffffd7d269ff000..0xfffffd7d269ffb50]
             at java.util.Vector.size(Vector.java:270)
             - waiting to lock <0xfffffd7f0114ea28> (a java.util.Vector)
             at
org.apache.lucene.search.BooleanQuery$BooleanWeight.<init>(BooleanQuery.
java:95)
             at
org.apache.lucene.search.BooleanQuery.createWeight(BooleanQuery.java:220
)
             at
org.apache.lucene.search.BooleanQuery$BooleanWeight.<init>(BooleanQuery.
java:97)
             at
org.apache.lucene.search.BooleanQuery.createWeight(BooleanQuery.java:220
)
             at org.apache.lucene.search.Query.weight(Query.java:85)
             at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:85)
             at
org.apache.lucene.search.MultiSearcherThread.run(ParallelMultiSearcher.j
ava:251)

And, additionally I found another stacktrace in the stdout-log which I
find interesting:

Exception in thread "MultiSearcher thread #1"
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.PrefixQuery.rewrite(PrefixQuery.java:50)
             at
org.apache.lucene.search.BooleanQuery.rewrite(BooleanQuery.java:243)
             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:85)
             at
org.apache.lucene.search.MultiSearcherThread.run(ParallelMultiSearcher.j
ava:251)


Has anyone ever seen these errors and knows why they might occour?

Thanks in advance,
Daniel Pfeifer

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to