Hi, The TooManyClausesException is thrown by BooleanQuery.add(Clause). Because of this, it can only count clauses actually added to the BooleanQuery - terms thrown away by QueryParser before are not counted as they will not be in the final query. If a token in the query parser expands to multiple synonyms, multiple clauses are added and count against the limit.
Uwe ----- Uwe Schindler H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de eMail: u...@thetaphi.de > -----Original Message----- > From: Ian Lea [mailto:ian....@gmail.com] > Sent: Wednesday, October 05, 2011 11:32 AM > To: java-user@lucene.apache.org > Subject: Re: How is Number of Boolean Clauses calculated - Minimum Should > Match? > > It will work on the query, whether produced by a query parser or > constructed in code. I don't see that the number of clauses will > change if you are applying filters. Filters are not query clauses, > although it can get confusing if you start using stuff like > FilteredQuery or QueryWrapperFilter. > > > -- > Ian. > > > On Wed, Oct 5, 2011 at 8:42 AM, Em <mailformailingli...@yahoo.de> wrote: > > Hello list, > > > > in what way does BooleanQuery calculates the number of its clauses? Is > > this number based on the analyzed query or based on the raw query-string? > > > > Imagine you got a StopFilter or a SynonymFilter applied to a > > BooleanQuery during analyzing - the number of clauses could shrink or > > increase. > > > > I remind that in connection with the MinimumShouldMatch-param there may > > occur problems if you query fields with an applied StopFilter and some > > fields without. > > > > I tried to answer a question on mailinglists and noticed that I am > > relatively unsure about how MM is calculated in general and how > > especially in Solr (since I am not sure, I am a little bit confused when > > I made a code review). > > > > Thank you! > > > > Regards, > > Em > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > > For additional commands, e-mail: java-user-h...@lucene.apache.org > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org