}
public static BlurResults convertToHits(BlurResultIterable hitsIterable, BlurQuery query,
AtomicLongArray facetCounts, ExecutorService executor, Selector selector, final Iface iface, final String table)
throws InterruptedException, ExecutionException, BlurException {
BlurResults results = new BlurResults();
results.setTotalResults(hitsIterable.getTotalResults());
results.setShardInfo(hitsIterable.getShardInfo());
if (query.minimumNumberOfResults > 0) {
Tracer trace = Trace.trace("convertToHits - skipTo", Trace.param("start", query.start));
hitsIterable.skipTo(query.start);
trace.done();
BlurIterator<BlurResult, BlurException> iterator = hitsIterable.iterator();
for (int count = 0; count < query.fetch && iterator.hasNext(); count++) {
results.addToResults(iterator.next());
}
}
if (results.results == null) {
results.results = new ArrayList<BlurResult>();
}