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