lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: Retrieve all terms
Date Thu, 19 May 2005 17:12:06 GMT

: > > Then, I want to retrieve all terms from the contents field, but
: > > only the ones from the documents matching the language=en.

I think what you want is to...

1) open an IndexReader r.
2) create a QueryFilter q wrapping a TermQuery for language:en
3) BitSet en = q.bits(r);
4) open a TermEnum using r.terms()
5) for each term, get a TermDocs positioned at that term.
5) for each doc in the TermDocs, if the corrisponding bit is set in "en"
   then print the term, and advance your TermEnum; if not, then advance
   your TermDoc.



-Hoss


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