
lucene at mikemccandless
Nov 4, 2009, 2:04 AM
Post #2 of 2
(102 views)
Permalink
|
|
Re: rewrite()ing BooleanQuery results in empty clauses
[In reply to]
|
|
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.work[at]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-unsubscribe[at]lucene.apache.org For additional commands, e-mail: java-user-help[at]lucene.apache.org
|