use of org.obiba.mica.search.CountStatsDtoBuilders.DatasetCountStatsBuilder in project mica2 by obiba.
the class DatasetQuery method processHits.
@Override
public void processHits(QueryResultDto.Builder builder, Searcher.DocumentResults results, QueryScope scope, CountStatsData counts) {
DatasetResultDto.Builder resBuilder = DatasetResultDto.newBuilder();
DatasetCountStatsBuilder datasetCountStatsBuilder = counts == null ? null : DatasetCountStatsBuilder.newBuilder(counts);
Consumer<Dataset> addDto = getDatasetConsumer(scope, resBuilder, datasetCountStatsBuilder);
List<Dataset> published = getPublishedDocumentsFromHitsByClassName(results, Dataset.class);
published.forEach(addDto::accept);
builder.setExtension(DatasetResultDto.result, resBuilder.build());
}
Aggregations