On Wednesday 11 January 2006 03:54, Chris Hostetter wrote: > > I thought the purpose of this method was for applications to specify the > largest possible BooleanQuery that could be created in their application > (either progromaticaly, via QueryParser, or as a result of rewriting a > non-primative). > > Changing this to be non-static would (besides breaking existing > applications) leave apps with no way to limit the number of clauses > generated "under the covers". > > > : Date: Tue, 10 Jan 2006 18:36:33 -0800 (PST) > : From: Otis Gospodnetic <[EMAIL PROTECTED]> > : Reply-To: java-dev@lucene.apache.org, > : Otis Gospodnetic <[EMAIL PROTECTED]> > : To: java-dev@lucene.apache.org > : Subject: BooleanQuery: static setMaxClauseCount(int)? > : > : Hi, > : > : Is there a reason this method is static? > : > : public static void setMaxClauseCount(int maxClauseCount) > : If not, I'll change it. > : > : Thanks, > : Otis
For most normal uses, the maximum clause count for a query is an attribute of BooleanQuery. However, it's quite possible that the maximum clause count should be applied to other queries, for example a SpanOrQuery. For that reason the surround query language has a BasicQueryFactory class that limits the number of TermQueries and SpanTermQueries used for the top level query: contrib/surround/src/java/org/apache/lucene/queryParser/surround/query/BasicQueryFactory.java In Lucene, an object like this might be used during Query.rewrite(). But when I wrote the surround language, I did not see a way of passing a BasicQueryFactory around during rewrite(), so I used a completely different way to expand queries in the surround language. The maximum clause count only needs to be "local" to Query.rewrite(), so it might be necessary to move setMaxClauseCount() from BooleanQuery to Query lateron, for example when the "Advanced" query language discussed recently runs into this problem. Regards, Paul Elschot --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]