/** * Groups the matching entries by some fields. * * @param studyStr study id in string format. Could be one of [id|user@aliasProject:aliasStudy|aliasProject:aliasStudy|aliasStudy]. * @param query Query object. * @param fields A field or a comma separated list of fields by which the results will be grouped in. * @param options QueryOptions object. * @param sessionId Session id of the user logged in. * @return A QueryResult object containing the results of the query grouped by the fields. * @throws CatalogException CatalogException */ public QueryResult groupBy(@Nullable String studyStr, Query query, String fields, QueryOptions options, String sessionId) throws CatalogException { if (StringUtils.isEmpty(fields)) { throw new CatalogException("Empty fields parameter."); } return groupBy(studyStr, query, Arrays.asList(fields.split(",")), options, sessionId); }