For 2.9, I believe there's hardly any runtime cost to the embedded
BooleanQuery instances that have no clauses -- when the scorer method
is invoked, it will return null, which will in turn translate into an
DocIdSet.EMPTY_DOCIDSET that ends the iteration immediately on the
first call to nextDoc.

But if you test this and find otherwise, please report back!

Mike

On Wed, Nov 4, 2009 at 3:28 AM, Shaun Senecal <ssenecal.w...@gmail.com> wrote:
> I am rewriting some BooleanQueries and the end result contains some empty
> queries.
>
> The initial query is of the form: Field1:foo* Field2:foo* Field3:foo*
> Field4:foo* Field5:foo* Field6:foo*
>
> The rewritten query is of the form: ConstantScore(Field1:foo*)
> ConstantScore(Field2:foo*) ConstantScore(QueryWrapperFilter())
> ConstantScore(QueryWrapperFilter()) ConstantScore(QueryWrapperFilter())
> ConstantScore(QueryWrapperFilter())
>
> The thing is, the BooleanQueries contained in the QueryWrapperFilter()s have
> no clauses present.  Would this affect the performance of the query at all?
> Is there a way I can prevent empty queries like these from being written if
> there is a performance penalty?
>
>
> Shaun
>

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

Reply via email to