lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: Lucene filter questions
Date Tue, 26 Feb 2013 00:01:23 GMT
On Mon, Feb 25, 2013 at 2:19 PM, Wei Wang <welshwang@gmail.com> wrote:
> Cool. Thanks, Ian.
>
> I will try FieldCacheTermsFilter.
>
> A related question. Occasionally, we would like only use filtering
> conditions instead of ranking/scoring. Right now I use
> MatchAllDocsQuery with TermsFilter. Based on the code of
> MatchAllDocsQuery, it seems the class enumerates all doc IDs up to
> maxDoc. If we are able to interpret bitmap of filters directly, it may
> be more efficient.
>
> Can we use Filter to return list of docs or count of docs directly?

Use ConstantScoreQuery: it turns a Filter into a Query, where every
doc gets a score equal to the ConstantScoreQuery.setBoost (1.0 by
default).

Mike McCandless

http://blog.mikemccandless.com

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


Mime
View raw message