lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Rooney <ben.roo...@blastradius.com>
Subject Re: QueryFilter vs CachingWrapperFilter vs RangeQuery
Date Tue, 07 Dec 2004 21:03:13 GMT
erik, thanks for the reply

i get the filter know and understand how the caching works.  however the
caching is only on the filtering level which means i can cache results
that are filtered.  but if i do a basic search against the index and
want to cache that, do i need to create my own caching mechanism or does
the SearchIndexer cache the results already?  if it caches them already,
then to clear the cache, is it again removing any references to the
SearchIndexer instance?

thanks again,
ben


On Tue, 2004-07-12 at 15:18 -0500, Erik Hatcher wrote:

> On Dec 7, 2004, at 3:06 PM, Ben Rooney wrote:
> > i'm trying to understand the difference/effects between QueryFilter vs
> > CachingWrapperFilter and when you would use one vs the other and how
> > they work exactly.
> 
> QueryFilter caches the results (bit set of documents) of a query by 
> IndexReader.
> 
> CachingWrapperFilter does not actually do any filtering of its own, but 
> merely wraps the results of another non-caching filter, such as 
> DateFilter.  CachingWrapperFilter was added to disconnect caching from 
> filtering.  QueryFilter is the exception as it came first and already 
> does caching.  If you're using QueryFilter, there is no need to concern 
> yourself with CachingWrapperFilter.
> 
> > also, when exactly will the cache be cleared.  looking at the source
> > code, it appears when the IndexReader is released it would be cleared.
> > does this mean i should keep a reference to the SearchIndexer until i
> > want the results to be cleared?  for example, in a class file the
> > executes the search, i would keep a static reference to SearchIndexer
> > and then when i want to invalidate the cache, set it to null or create 
> > a
> > new instance of it?
> 
> How you keep a reference to the IndexSearcher instance is up to the 
> design of your system.  But, yes, you do need to keep a reference to it 
> for the cache to work properly.  If you use a new IndexSearcher 
> instance (I'm simplifying here, you could have an IndexReader instance 
> yourself too, but I'm ignoring that possibility) then the filtering 
> process occurs for each search rather than using the cache.
> 
> 	Erik
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
> 

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