You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Jeff Rodenburg <je...@gmail.com> on 2006/04/15 18:20:02 UTC

Why is BooleanQuery.maxClauseCount static?

What was the thinking behind making the BooleanQuery maxClauseCount a
static?  Or, I guess more to the point, why not an instance setting as well?

Not trying to point out a flaw, just curious about the original thinking
behind the setting.  I have a situation where I have a set of BooleanQueries
that use a high number of clauses, but another set that needs a low number
of clauses (different indexes searched, and efficiencies dictate the
high/low clause range.)


cheers,
jeff

Re: Why is BooleanQuery.maxClauseCount static?

Posted by Jeff Rodenburg <je...@gmail.com>.
Thanks Paul.  In my case, I don't have nested queries but rather separate
queries running against different indexes -- some with very high clause
counts, and some with very low clause counts.  These are executing in a web
environment with the same memory space and process, so concurrency can
sometimes cause problems when both types of queries need to execute
simultaneously.

-- j

On 4/15/06, Paul Elschot <pa...@xs4all.nl> wrote:
>
> On Saturday 15 April 2006 18:20, Jeff Rodenburg wrote:
> > What was the thinking behind making the BooleanQuery maxClauseCount a
> > static?  Or, I guess more to the point, why not an instance setting as
> well?
> >
> > Not trying to point out a flaw, just curious about the original thinking
> > behind the setting.  I have a situation where I have a set of
> BooleanQueries
> > that use a high number of clauses, but another set that needs a low
> number
> > of clauses (different indexes searched, and efficiencies dictate the
> > high/low clause range.)
>
> The reason is to have simplicity in dealing with the case of a single
> BooleanQuery using many terms. This was done to avoid spurious
> OutOfMemory problems for queries that happen to expand to a lot
> of terms, and for that it works well.
>
> With nested BooleanQuerys it wouldn't even make sence to have an
> instance setting, because in that case the maximum number of clauses
> should be associated with the top level query only.
>
> Regards,
> Paul Elschot.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Re: Why is BooleanQuery.maxClauseCount static?

Posted by Paul Elschot <pa...@xs4all.nl>.
On Saturday 15 April 2006 18:20, Jeff Rodenburg wrote:
> What was the thinking behind making the BooleanQuery maxClauseCount a
> static?  Or, I guess more to the point, why not an instance setting as well?
> 
> Not trying to point out a flaw, just curious about the original thinking
> behind the setting.  I have a situation where I have a set of BooleanQueries
> that use a high number of clauses, but another set that needs a low number
> of clauses (different indexes searched, and efficiencies dictate the
> high/low clause range.)

The reason is to have simplicity in dealing with the case of a single
BooleanQuery using many terms. This was done to avoid spurious
OutOfMemory problems for queries that happen to expand to a lot
of terms, and for that it works well.

With nested BooleanQuerys it wouldn't even make sence to have an
instance setting, because in that case the maximum number of clauses
should be associated with the top level query only.

Regards,
Paul Elschot.

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org