int docid = 0;
final PostingIndexInputStream piis = (PostingIndexInputStream) index.getIndexStructureInputStream("direct");
assertNotNull("No direct index input stream found", piis);
while(piis.hasNext())
{
IterablePosting ip = piis.next();
int doclen = 0; int docpointers = 0;
docid += piis.getEntriesSkipped();
//System.err.println("getEntriesSkipped=" + piis.getEntriesSkipped());
//System.err.println("docid=" + docid);
while(ip.next() != IterablePosting.EOL)
{
//System.err.println("termid" +ip.getId() + " f=" + ip.getFrequency());
termIds.add(ip.getId());
tokens += ip.getFrequency();
doclen += ip.getFrequency();
pointers++; docpointers++;
if (numberOfTerms > 0)
assertTrue("Got too big a termid ("+ip.getId()+") from direct index input stream, numTerms=" + numberOfTerms, ip.getId() < maxTermId);
}
if (documentPointers.length > 0)
assertEquals("Numebr of pointers for docid " + docid + " is incorrect", documentPointers[docid], docpointers);
assertEquals("Document length for docid "+docid+" is incorrect", documentLengths[docid], doclen);
docid++;