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 PostingsEnum for documents that does not contain a term
Date Mon, 07 Aug 2017 20:41:08 GMT
Hi,
I am traversing posting list of a given term/word using the following code. I am accessing/processing
term frequency and document length.
Term term = new Term(field, word);
PostingsEnum postingsEnum = MultiFields.getTermDocsEnum(reader, field, term.bytes());

if (postingsEnum == null) return word + "(stopword)";

while (postingsEnum.nextDoc() != PostingsEnum.NO_MORE_DOCS) {
            final int freq = postingsEnum.freq();
            final long numTerms = norms.get(postingsEnum.docID());
            .......
}

Now I want to traverse the remaining documents. (documents that does *not* contain the term/word)

What is the best way to accomplish this?
Thanks,Ahmet 
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message