void retrieveHeterogenousHits() {
            int numHitsToRetrieve = (int)(hits * parameters.additionalHitsFactor);

            final int maxNumHitsToRetrieve = 1000;
            numHitsToRetrieve = Math.min(numHitsToRetrieve,maxNumHitsToRetrieve);

            try {
                query.setWindow(nextOffset,numHitsToRetrieve);
                partitionedResult.addHits(retrieveHits());
            }
            finally {
                restoreWindow();
                nextOffset += numHitsToRetrieve;
            }
        }
Groups hits according to document type.
For each group, the desired number of hits can be specified.

@author Tony Vaagenes
container-search/src/main/java/com/yahoo/prelude/searcher/MultipleResultsSearcher.java