lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ahmet Arslan <iori...@yahoo.com.INVALID>
Subject intersection of two posting lists
Date Fri, 08 May 2015 15:53:33 GMT
Hello All,

I am traversing posting list of a single term by following code. (not sure if there is a better
way)
Now I need to handle/aggregate multiple terms. Traverse intersection of multiple posting lists
and obtain summed freq() of multiple terms per document. What is the easiest way to obtain
these statistics? Is there an api/method to do that?

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

while (postingsEnum.nextDoc() != PostingsEnum.NO_MORE_DOCS) {
postingsEnum.freq();
postingsEnum.docID()}

Thanks,
Ahmet

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