You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Ahmet Arslan <io...@yahoo.com.INVALID> on 2015/05/08 17:53:33 UTC

intersection of two posting lists

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