for ( int i = k = 0; i < terms; i++ ) {
indexIterator = indexReader.nextIterator();
frequency = indexIterator.frequency();
if ( ! index.hasPositions ) count += frequency;
for ( int j = frequency; j-- != 0; ) {
indexIterator.nextDocument();
if ( index.hasPositions ) count += indexIterator.count();
}
if ( i == terms - 1 ) i++; // To fool the next
if ( count >= blockSize && k < numberOfLocalIndices - 1 || i == terms ) {