use of org.obiba.mica.web.model.MicaSearch.JoinQueryResultDto in project mica2 by obiba.
the class JoinQueryExecutor method doQueries.
private JoinQueryResultDto doQueries(QueryType type, JoinQuery joinQuery, CountStatsData.Builder countBuilder, QueryScope scope) {
boolean queriesHaveFilters = Stream.of(variableQuery, datasetQuery, studyQuery, networkQuery).anyMatch(DocumentQueryInterface::hasQueryBuilder);
if (queriesHaveFilters) {
DocumentQueryIdProvider datasetIdProvider = new DocumentQueryIdProvider();
variableQuery.setDatasetIdProvider(datasetIdProvider);
datasetQuery.setDatasetIdProvider(datasetIdProvider);
List<String> joinedIds = executeJoin(type);
CountStatsData countStats = countBuilder != null ? getCountStatsData(type) : null;
if ((joinQuery.searchOnNetworksOnly() && QueryType.NETWORK.equals(type)) || (joinedIds != null && joinedIds.size() > 0)) {
getDocumentQuery(type).query((joinQuery.searchOnNetworksOnly() && QueryType.NETWORK.equals(type)) ? Collections.emptyList() : joinedIds, countStats, scope);
}
} else {
execute(type, scope, countBuilder);
}
log.debug("Building result");
JoinQueryResultDto resultDto = buildQueryResult(joinQuery);
log.debug("Finished query");
return resultDto;
}
Aggregations