On Monday 23 October 2006 21:16, Erick Erickson wrote:
> Use TermDocs.seek(Term) to get to the term. That'll position your TermDocs
> variable at a list, ordered by document ID of the ocurrences of a term. Then
> TermDocs.skipTo(doc ID) will get you to the list of terms for that document
> (you have to know what Lucene DocId you care about here.).
> 
> Now TermDocs.next() will increment through and you can count. Something
> like.
> 
> TermDocs td = IndexReader.termDocs();
> td.seek(new Term("field", "value"));
> td.skipto(docId);

and then td.freq() should give the answer without counting.

Regards,
Paul Elschot

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to