Search in sources :

Example 6 with EventSearchQuery

use of org.opencastproject.index.service.impl.index.event.EventSearchQuery in project opencast by opencast.

the class SeriesIndexUtils method updateEventSeriesTitles.

public static void updateEventSeriesTitles(Series series, String organization, User user, AbstractSearchIndex searchIndex) throws SearchIndexException {
    if (!series.isSeriesTitleUpdated())
        return;
    SearchResult<Event> events = searchIndex.getByQuery(new EventSearchQuery(organization, user).withoutActions().withSeriesId(series.getIdentifier()));
    for (SearchResultItem<Event> searchResultItem : events.getItems()) {
        Event event = searchResultItem.getSource();
        event.setSeriesName(series.getTitle());
        searchIndex.addOrUpdate(event);
    }
}
Also used : EventSearchQuery(org.opencastproject.index.service.impl.index.event.EventSearchQuery) Event(org.opencastproject.index.service.impl.index.event.Event)

Aggregations

Event (org.opencastproject.index.service.impl.index.event.Event)6 EventSearchQuery (org.opencastproject.index.service.impl.index.event.EventSearchQuery)6 WebApplicationException (javax.ws.rs.WebApplicationException)3 SearchIndexException (org.opencastproject.matterhorn.search.SearchIndexException)3 ArrayList (java.util.ArrayList)2 GET (javax.ws.rs.GET)2 Path (javax.ws.rs.Path)2 Produces (javax.ws.rs.Produces)2 IndexServiceException (org.opencastproject.index.service.exception.IndexServiceException)2 SearchResultItem (org.opencastproject.matterhorn.search.SearchResultItem)2 SortCriterion (org.opencastproject.matterhorn.search.SortCriterion)2 SchedulerException (org.opencastproject.scheduler.api.SchedulerException)2 UnauthorizedException (org.opencastproject.security.api.UnauthorizedException)2 UrlSigningException (org.opencastproject.security.urlsigning.exception.UrlSigningException)2 NotFoundException (org.opencastproject.util.NotFoundException)2 RestQuery (org.opencastproject.util.doc.rest.RestQuery)2 JValue (com.entwinemedia.fn.data.json.JValue)1 IOException (java.io.IOException)1 ParseException (java.text.ParseException)1 Date (java.util.Date)1