lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kelvin Tan" <>
Subject Filtering results
Date Tue, 05 Feb 2002 13:11:13 GMT
I would like to exclude certain documents from my search and naturally chose
to extend Filter.

I'm not too clear on the proper usage of Terms, TermEnum and TermDocs, and
though DateFilter has an example of how to implement a Filter, I'm none the
wiser on the proper way of filtering.

My document objects contain a field (called IDENTIFIER) which I would like
to retrieve the value of, in order to compare it a list of allowed values to
determine if the document should be excluded. Initially, I tried to
implement it by iterating through all documents (reader.doc(i)), then
retrieving the value of IDENTIFIER (doc.get(IDENTIFIER)). It works, the
trouble is that I've no way of accessing the document number from within
IndexReader (which is needed to set the BitSet within the bits() method). It
seems to be available from only within TermEnum and TermDocs...

Of course, I probably haven't performed the filtering correctly, so would
appreciate any help on it...

Kelvin Tan

Relevanz Pte Ltd

180B Bencoolen St.
The Bencoolen, #04-01

Tel: 238 6229
Fax: 337 4417

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

View raw message