Search in sources :

Example 1 with StudyCountStatsBuilder

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());
}
Also used : StudyResultDto(org.obiba.mica.web.model.MicaSearch.StudyResultDto) StudyCountStatsBuilder(org.obiba.mica.search.CountStatsDtoBuilders.StudyCountStatsBuilder) BaseStudy(org.obiba.mica.study.domain.BaseStudy)

Aggregations

StudyCountStatsBuilder (org.obiba.mica.search.CountStatsDtoBuilders.StudyCountStatsBuilder)1 BaseStudy (org.obiba.mica.study.domain.BaseStudy)1 StudyResultDto (org.obiba.mica.web.model.MicaSearch.StudyResultDto)1