lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
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.

Eric,

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  
"filtering".

TestFilterIndexReader has some clues that might help you:

	<http://svn.apache.org/viewcvs.cgi/lucene/java/trunk/src/test/org/ 
apache/lucene/index/TestFilterIndexReader.java?view=markup>

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

	Erik


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