lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ahmet Arslan <>
Subject getting number of terms in a document/field
Date Fri, 06 Feb 2015 00:24:16 GMT
Hello Lucene Users,

I am traversing all documents that contains a given term with following code :

Term term = new Term(field, word);
Bits bits = MultiFields.getLiveDocs(reader);
DocsEnum docsEnum = MultiFields.getTermDocsEnum(reader, bits, field, term.bytes());

while (docsEnum.nextDoc() != DocsEnum.NO_MORE_DOCS) {


// how to retrieve term count for this document?
   xxxxx(docsEnum.docID(), field); 


How can I get field term count values for these documents using Lucene 4.10.3?

Is above code OK for traversing posting list of term?


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

View raw message