FAQ
Hello,

I've filled an index with 1100 text files with the names "monisys1" to "monisys1100".

If I start a WildcardQuery
WildcardQuery query = new WildcardQuery(new Term("fileId","monisys*"));
Hits hits = searcher.search(query);
I get a "Too many clauses" exception, like I expected.

But when I use a filter to avoid this exception, this exception still occurs.
ConstantScoreQuery scoreQuery = new ConstantScoreQuery(new QueryWrapperFilter(new WildcardQuery(new Term("fileId","monisys*"))));
Hits hits = searcher.search(scoreQuery);

Did I miss something?

Thank you.

--René

--
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Search Discussions

  • Ganesh - yahoo at Jul 30, 2008 at 8:35 am
    Hi,

    Try using PrefixQuery? Is it still throws exception?

    Regards
    Ganesh

    ----- Original Message -----
    From: <[email protected]>
    To: <[email protected]>
    Sent: Wednesday, July 30, 2008 1:00 PM
    Subject: too many clause exception when using a filter

    Hello,

    I've filled an index with 1100 text files with the names "monisys1" to
    "monisys1100".

    If I start a WildcardQuery
    WildcardQuery query = new WildcardQuery(new
    Term("fileId","monisys*"));
    Hits hits = searcher.search(query);
    I get a "Too many clauses" exception, like I expected.

    But when I use a filter to avoid this exception, this exception still
    occurs.
    ConstantScoreQuery scoreQuery = new ConstantScoreQuery(new
    QueryWrapperFilter(new WildcardQuery(new Term("fileId","monisys*"))));
    Hits hits = searcher.search(scoreQuery);

    Did I miss something?

    Thank you.

    --René

    --
    Psssst! Schon vom neuen GMX MultiMessenger gehört?
    Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: [email protected]
    For additional commands, e-mail: [email protected]
    Send instant messages to your online friends http://in.messenger.yahoo.com

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: [email protected]
    For additional commands, e-mail: [email protected]
  • Zoeppi at Jul 30, 2008 at 10:11 am
    Hi,

    when I use the PrefixQuery instead of the WildcardQuery, I still get the exception.

    Regards
    --René


    -------- Original-Nachricht --------
    Datum: Wed, 30 Jul 2008 14:03:28 +0530
    Von: "Ganesh - yahoo" <[email protected]>
    An: [email protected]
    Betreff: Re: too many clause exception when using a filter
    Hi,

    Try using PrefixQuery? Is it still throws exception?

    Regards
    Ganesh

    ----- Original Message -----
    From: <[email protected]>
    To: <[email protected]>
    Sent: Wednesday, July 30, 2008 1:00 PM
    Subject: too many clause exception when using a filter

    Hello,

    I've filled an index with 1100 text files with the names "monisys1" to
    "monisys1100".

    If I start a WildcardQuery
    WildcardQuery query = new WildcardQuery(new
    Term("fileId","monisys*"));
    Hits hits = searcher.search(query);
    I get a "Too many clauses" exception, like I expected.

    But when I use a filter to avoid this exception, this exception still
    occurs.
    ConstantScoreQuery scoreQuery = new ConstantScoreQuery(new
    QueryWrapperFilter(new WildcardQuery(new Term("fileId","monisys*"))));
    Hits hits = searcher.search(scoreQuery);

    Did I miss something?

    Thank you.

    --René

    --
    Psssst! Schon vom neuen GMX MultiMessenger gehört?
    Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: [email protected]
    For additional commands, e-mail: [email protected]
    Send instant messages to your online friends http://in.messenger.yahoo.com

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: [email protected]
    For additional commands, e-mail: [email protected]
    --
    GMX Kostenlose Spiele: Einfach online spielen und Spaß haben mit Pastry Passion!
    http://games.entertainment.gmx.net/de/entertainment/games/free/puzzle/6169196

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: [email protected]
    For additional commands, e-mail: [email protected]
  • Steven A Rowe at Jul 30, 2008 at 5:03 pm
    Hi René,

    Since you're constructing the filter from a WildcardQuery or a PrefixQuery, both of which use a BooleanQuery to hold a TermQuery for each matching index term, you'll need to increase the number of clauses a BooleanQuery is allowed to hold, by calling static method BooleanQuery.setMaxClauseCount():

    <http://lucene.apache.org/java/2_3_2/api/org/apache/lucene/search/BooleanQuery.html#setMaxClauseCount(int)>

    Or, to avoid the clause limit issue altogether, you could use a PrefixFilter instead of a QueryWrapperFilter around a {Wildcard,Prefix}Query:

    <http://lucene.apache.org/java/2_3_2/api/org/apache/lucene/search/PrefixFilter.html>

    Steve
    On 07/30/2008 at 3:30 AM, [email protected] wrote:
    Hello,

    I've filled an index with 1100 text files with the names
    "monisys1" to "monisys1100".

    If I start a WildcardQuery
    WildcardQuery query = new WildcardQuery(new
    Term("fileId","monisys*")); Hits hits = searcher.search(query);
    I get a "Too many clauses" exception, like I expected.

    But when I use a filter to avoid this exception, this
    exception still occurs.
    ConstantScoreQuery scoreQuery = new
    ConstantScoreQuery(new QueryWrapperFilter(new
    WildcardQuery(new Term("fileId","monisys*"))));
    Hits hits = searcher.search(scoreQuery);

    Did I miss something?

    Thank you.

    --René

    --
    Psssst! Schon vom neuen GMX MultiMessenger gehört?
    Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger
    ---------------------------------------------------------------------
    To unsubscribe, e-mail: [email protected]
    For additional commands, e-mail: [email protected]
  • Chris Hostetter at Jul 31, 2008 at 7:05 pm
    : Or, to avoid the clause limit issue altogether, you could use a
    : PrefixFilter instead of a QueryWrapperFilter around a
    : {Wildcard,Prefix}Query:

    right ... the missconception here seems to be that if you use a Filter,
    all your Too Many Clauses problems are sovled -- but if that Filter is
    just a wrapper arround a query, the problem is still there.





    -Hoss


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: [email protected]
    For additional commands, e-mail: [email protected]

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedJul 30, '08 at 7:31a
activeJul 31, '08 at 7:05p
posts5
users4
websitelucene.apache.org

People

Translate

site design / logo © 2023 Grokbase