class MovieServiceImpl implements MovieService {

    @Scheduled(fixedRateString = "${searchIndex.fixedRate}")
    public void updateSearchIndex() {
        try {
            // Loads the recently updated movies and indexes them
            movieRepository.findByUpdated(true).forEach(movieIndexHelper::indexMovie);
        }
        catch (final Exception ex) {
            log.error("An error occured while loading movies to index: " + ex.getMessage(), ex);
        }
    }

}