use of org.opencastproject.index.service.impl.index.group.GroupQueryBuilder in project opencast by opencast.
the class AbstractSearchIndex method getByQuery.
/**
* @param query
* The query to use to retrieve the groups that match the query
* @return {@link SearchResult} collection of {@link Group} from a query.
* @throws SearchIndexException
* Thrown if there is an error getting the results.
*/
public SearchResult<Group> getByQuery(GroupSearchQuery query) throws SearchIndexException {
logger.debug("Searching index using group query '{}'", query);
// Create the request builder
SearchRequestBuilder requestBuilder = getSearchRequestBuilder(query, new GroupQueryBuilder(query));
try {
return executeQuery(query, requestBuilder, new Fn<SearchMetadataCollection, Group>() {
@Override
public Group apply(SearchMetadataCollection metadata) {
try {
return GroupIndexUtils.toGroup(metadata);
} catch (IOException e) {
return chuck(e);
}
}
});
} catch (Throwable t) {
throw new SearchIndexException("Error querying series index", t);
}
}
Aggregations