lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <>
Subject Re: TermsFilter instead of "should" TermQueries
Date Sat, 08 May 2010 00:30:18 GMT
Well, you construct the filter by enumerating the terms you're
interested in and pass it along to the relevant search.

But it looks like you've figured that part out. If you're asking
how can you use a Filter and still have the terms replaced
by the filter contribute to scoring, you can't. But it's a reasonable
question to ask whether it changes the score enough to
matter given that this is only a problem when there are many

If this doesn't speak to your question, can you ask for more


On Fri, May 7, 2010 at 1:19 PM, Tomislav Poljak <> wrote:

> Hi,
> in API documentation for TermsFilter:
> it states:
> 'As a filter, this is much faster than the equivalent query (a
> BooleanQuery with many "should" TermQueries)'
> I would like to replace "should" TermQueries with TermsFilter to benefit
> in performance, but I'm trying to understand how this change/switch can
> work.
> I was under the impression that the BooleanQuery with many "should"
> TermQueries affects scoring like: each "should" term present in result,
> increases the result's score.
> If someone could explain how can a TermsFilter (which is like any filter
> a binary thing - result document is matched or not) be used to replace
> should clauses, I would really appreciate it.
> Tomislav
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message