My index changes ( updates every 15 minutes and delete every 2 minutes ) so using the filter is not going to work for me because the order of the Documents might change from the time the initial search is done to the time the filter is done, I'm currently using a crude method ( ... doc_id:(23 AND 78 .. ) ) and so to filter it works surprisingly well because I thought the query parser would cave but it's doing great even with sets as large as filtering within 2000 documents
-----Original Message----- From: Scott Ganyo [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 31, 2002 10:24 PM To: 'Lucene Users List' Subject: RE: Using Filters in Lucene 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... Scott > -----Original Message----- > From: Doug Cutting [mailto:[EMAIL PROTECTED]] > 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 > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
