int max = max( first, queryHits.totalHits );
Session sess = ( Session ) this.session;
int size = max - first + 1 < 0 ? 0 : max - first + 1;
List<EntityInfo> infos = new ArrayList<EntityInfo>( size );
DocumentExtractor extractor = new DocumentExtractor(
queryHits, searchFactoryImplementor, indexProjection, idFieldNames, allowFieldSelectionInProjection
);
for ( int index = first; index <= max; index++ ) {
//TODO use indexSearcher.getIndexReader().document( hits.id(index), FieldSelector(indexProjection) );
infos.add( extractor.extract( index ) );
}
Loader loader = getLoader( sess, searchFactoryImplementor );
return new IteratorImpl( infos, loader );
}
catch ( IOException e ) {