Search in sources :

Example 1 with DatasetCountStatsBuilder

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());
}
Also used : DatasetCountStatsBuilder(org.obiba.mica.search.CountStatsDtoBuilders.DatasetCountStatsBuilder) Dataset(org.obiba.mica.dataset.domain.Dataset) DatasetResultDto(org.obiba.mica.web.model.MicaSearch.DatasetResultDto)

Aggregations

Dataset (org.obiba.mica.dataset.domain.Dataset)1 DatasetCountStatsBuilder (org.obiba.mica.search.CountStatsDtoBuilders.DatasetCountStatsBuilder)1 DatasetResultDto (org.obiba.mica.web.model.MicaSearch.DatasetResultDto)1