public void checkInvertedIndexStream(Index index, int[] documentLengths) throws Exception
{
final int numDocs = index.getCollectionStatistics().getNumberOfDocuments();
TIntIntHashMap calculatedDocLengths = new TIntIntHashMap();
InvertedIndexInputStream iiis = (InvertedIndexInputStream) index.getIndexStructureInputStream("inverted");
assertNotNull(iiis);
int ithTerm = -1;
while(iiis.hasNext())
{
ithTerm++;
final IterablePosting ip = iiis.getNextPostings();
int count = 0;
final int expected = iiis.getNumberOfCurrentPostings();
while(ip.next() != IterablePosting.EOL)
{
//System.err.println("Got id " + ip.getId());
assertTrue("Got too big a docid ("+ip.getId()+") from inverted index input stream for term at index " + ithTerm, ip.getId() < numDocs);
count++;