lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ravikumar Govindarajan <ravikumar.govindara...@gmail.com>
Subject Overall doc-count in TermStats, during flush...
Date Wed, 20 Mar 2013 12:12:20 GMT
This is an internal code I came across in lucene today and unable to
decipher it.

FreqProxTermsWriterPerField.java

void flush(String fieldName, FieldsConsumer consumer,  final
SegmentWriteState state)
{
.............
FixedBitSet visitedDocs = new FixedBitSet(state.segmentInfo.getDocCount());
  for (int i = 0; i < numTerms; i++)
  {
    .............
    visitedDocs.set(docID);
    .........
    termsConsumer.finishTerm(text, new TermStats(docFreq, writeTermFreq ?
totTF : -1)); *//We plan to pass the state.segmentInfo.getDocCount() in
TermStats, above. Is it      *
*    wrong to do this here?*
  }
//Once all terms are over
termsConsumer.finish(writeTermFreq ? sumTotalTermFreq : -1, sumDocFreq,
visitedDocs.cardinality()); *//Why are we doing cardinality() instead of
getDocCount() here?*
*//Can there be un-visited docs during a flush?*
}
*
*
Can someone help me understand this?

--
Ravi

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message