On Sun, Feb 15, 2009 at 10:50 AM, Joel Halbert <j...@su3analytics.com> wrote:
> When constructing a query, using a series of terms e.g.
>
> Term1=X, Term2=Y etc...
>
> does it make sense, like in sql, to place to most restrictive term query
> first?
>
> i.e. if I know that the query will be mainly constrained by the value of
> Term1, does having this as the first in the query make the execution of
> the query any faster than if it were the second term?

No.  Lucene internally reorders terms and tries to optimize stuff like
this whenever possible.  Disjunctions (ORs) use a priority queue to
skip on the lowest term (by docid) and conjunctions (ANDs) reorder
once by the highest first document (a very rough proxy for estimating
term density).

-Yonik
http://www.lucidimagination.com

---------------------------------------------------------------------
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