lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wei Wang <welshw...@gmail.com>
Subject Re: Lucene filter questions
Date Mon, 25 Feb 2013 19:19:41 GMT
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?

Wei

> I'm sure that Filters are thread safe.
>
> Lucene doesn't have a global caching mechanism as such.  But see
> FieldCache - you might get better performance from
> FieldCacheTermsFilter than from TermsFilter.  See also
> CachingWrapperFilter and QueryWrapperFilter.
>
>
> --
> Ian.
>
>
> On Mon, Feb 25, 2013 at 1:16 AM, Wei Wang <welshwang@gmail.com> wrote:
> > Hi,
> >
> > I am a Lucene user and I have a few questions about Lucene filters.
> > I appreciate it if someone can shed light on this.
> >
> > 1. Is Lucene filters such as TermsFilter thread-safe in general?
> >     The semantics of a Filter is fixed, unless a filter maintains some
> > private state information, theoretically it could be thread-safe and
> > the same Filter can be used by multiple queries at the same time.
> >
> > 2. Does Lucene has a global Caching mechanism for filters or even
> > queries? Or a user has to manage them by himself?
> >     It probably can better use resource if the cached filters/queries
> > are managed at a central place. I noticed FilterManager was removed
> > from Lucene 4. Is there another class replacing FilterManager?
> >
> > Thanks!
> > Wei
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > For additional commands, e-mail: java-user-help@lucene.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org

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