lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: filtering an IndexReader
Date Wed, 28 Dec 2005 11:00:21 GMT

On Dec 27, 2005, at 9:18 PM, Eric Schulte wrote:

> Good evening everyone,
> So, I apologize if this question has a simple answer (although I  
> hope it
> does). I am trying to apply a filter to an IndexReader, so that the  
> reader
> can only see documents that match the filter. The goal here is to  
> be able to
> implement the 'terms' and 'termDocs' methods, with the 'filter  
> approved'
> documents taken into consideration in putting together the stats.
> I don't believe the FilterIndexReader class can do this (If it can  
> I don't
> know how).
> Any ideas would be appreciated.
> To anyone on the general lucene mailing list sorry about the cross- 
> post.


I've not done something like this myself, but I did a quick perusal  
of the source code and tracked it into how it is used.  There are a  
few subclasses of FilterIndexReader out there.  To do anything useful  
with FilterIndexReader you must subclass it and provide your own  

TestFilterIndexReader has some clues that might help you:


I'm definitely interested in seeing how to go about implementing what  
you're after, so keep us posted.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message