use of org.obiba.mica.search.CountStatsDtoBuilders.StudyCountStatsBuilder in project mica2 by obiba.
the class StudyQuery method processHits.
@Override
public void processHits(QueryResultDto.Builder builder, Searcher.DocumentResults results, QueryScope scope, CountStatsData counts) throws IOException {
StudyResultDto.Builder resBuilder = StudyResultDto.newBuilder();
StudyCountStatsBuilder studyCountStatsBuilder = counts == null ? null : StudyCountStatsBuilder.newBuilder(counts);
Consumer<BaseStudy> addDto = getStudyConsumer(scope, resBuilder, studyCountStatsBuilder);
List<BaseStudy> publishedStudies = getPublishedDocumentsFromHitsByClassName(results, BaseStudy.class);
publishedStudies.forEach(addDto::accept);
builder.setExtension(StudyResultDto.result, resBuilder.build());
}
Aggregations