lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Ganyo <>
Subject RE: Using Filters in Lucene
Date Wed, 31 Jul 2002 18:23:46 GMT
Cool.  But instead of adding a new class, why not change Hits to inherit
from Filter and add the bits() method to it?  Then one could "pipe" the
output of one Query into another search without modifying the Queries...


> -----Original Message-----
> From: Doug Cutting []
> Sent: Monday, July 29, 2002 12:03 PM
> To: Lucene Users List
> Subject: Re: Using Filters in Lucene
> Peter Carlson wrote:
> > Would you suggest that search in selection type 
> functionality use filters or
> > redo the search with an AND clause?
> I'm not sure I fully understand the question.
> If you a condition that is likely to re-occur commonly in subsequent 
> queries, then using a Filter which caches its bit vector is 
> much faster 
> than using an AND clause.  However, you probably cannot 
> afford to keep a 
> large number of such filters around, as the cached bit vectors use a 
> fair amount of memory--one bit per document in the index.
> Perhaps the ultimate filter is something like the attached class, 
> QueryFilter.  This caches the results of an arbitrary query in a bit 
> vector.  The filter can then be reused with multiple queries, and (so 
> long as the index isn't altered) that part of the query 
> computation will 
> be cached.  For example, RangeQuery could be used with this, 
> instead of 
> using DateFilter, which does not cache (yet).
> Caution: I have not yet tested this code.  If someone does try it, 
> please send a message to the list telling how it goes.  If this is 
> useful, I can document it better and add it to Lucene.
> Doug

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