LexiconEntry le = null;
// for each run in the list
int counter = 0;
//for one term: for each set of postings for that term
while (run.hasNext()) {
PostingInRun posting = run.next();
lastTermWritten = posting.getTerm();
if (posting.getDf() > maxDF)
maxDF = posting.getDf();
//final int _runMapID = TaskID.forName(_run.getMapNo()).getId();
//final int runNumber = run.getRunNo();
final int docOffset = getDocumentOffset(_run.getSplitNo(), _run.getRunNo());
lastDocument = posting.append(bos, lastDocument, docOffset);
if (le == null)
le = posting.getLexiconEntry();
else
posting.addToLexiconEntry(le);
lastFreq += posting.getTF();
lastDocFreq += posting.getDf();
counter++;
}
le.setTermId(currentTerm++);
((BasicLexiconEntry)le).setOffset(startOffset, startBitOffset);
lexStream.writeNextEntry(lastTermWritten, le);