Interface SearchService


public interface SearchService
Provides search capabilities, possibly to the engage tools, possibly to other services.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Identifier for service registration and location
  • Method Summary

    Modifier and Type
    Method
    Description
    org.opencastproject.job.api.Job
    add(org.opencastproject.mediapackage.MediaPackage mediaPackage)
    Adds the media package to the search index.
    void
    addSynchronously(org.opencastproject.mediapackage.MediaPackage mediaPackage)
    Immediately adds the mediapackage to the search index.
    org.opencastproject.job.api.Job
    delete(String mediaPackageId)
    Removes the media package identified by mediaPackageId from the search index.
    org.opencastproject.job.api.Job
    deleteSeries(String seriesId)
    Removes the series identified by seriseId from the search index.
    boolean
    deleteSynchronously(String mediaPackageId)
    Immediately removes the given mediapackage from the search service.
    org.opencastproject.mediapackage.MediaPackage
    get(String mediaPackageId)
    Gets the MediaPackage for an event, based on its mediapackage ID.
    Collection<org.apache.commons.lang3.tuple.Pair<org.opencastproject.security.api.Organization,org.opencastproject.mediapackage.MediaPackage>>
    getSeries(String seriesId)
    Returns a list of Organization,MediaPackage pairs of mediapackages within a series.
    search(org.elasticsearch.search.builder.SearchSourceBuilder searchSource)
    Searches the index based on a SearchSourceBuilder's query
  • Field Details

  • Method Details

    • add

      org.opencastproject.job.api.Job add(org.opencastproject.mediapackage.MediaPackage mediaPackage) throws SearchException, org.opencastproject.mediapackage.MediaPackageException, org.opencastproject.security.api.UnauthorizedException, org.opencastproject.serviceregistry.api.ServiceRegistryException
      Adds the media package to the search index.
      Parameters:
      mediaPackage - the media package
      Throws:
      SearchException - if an error occurs while adding the media package
      org.opencastproject.mediapackage.MediaPackageException - if an error occurs accessing the media package
      org.opencastproject.security.api.UnauthorizedException - if the current user is not authorized to add this media package to the search index
      org.opencastproject.serviceregistry.api.ServiceRegistryException - if the job for adding the mediapackage can not be created
    • getSeries

      Collection<org.apache.commons.lang3.tuple.Pair<org.opencastproject.security.api.Organization,org.opencastproject.mediapackage.MediaPackage>> getSeries(String seriesId)
      Returns a list of Organization,MediaPackage pairs of mediapackages within a series. Note that the Organization should always be the same since series should not cross organizational bounds.
      Parameters:
      seriesId - the series ID to query
      Returns:
      A list of Organization,MediaPackage pairs of mediapackages within the series.
    • addSynchronously

      void addSynchronously(org.opencastproject.mediapackage.MediaPackage mediaPackage) throws SearchException, IllegalArgumentException, org.opencastproject.security.api.UnauthorizedException
      Immediately adds the mediapackage to the search index.
      Parameters:
      mediaPackage - the media package
      Throws:
      SearchException - if the media package cannot be added to the search index
      IllegalArgumentException - if the mediapackage is null
      org.opencastproject.security.api.UnauthorizedException - if the user does not have the rights to add the mediapackage
    • delete

      org.opencastproject.job.api.Job delete(String mediaPackageId) throws SearchException, org.opencastproject.security.api.UnauthorizedException, org.opencastproject.util.NotFoundException
      Removes the media package identified by mediaPackageId from the search index.
      Parameters:
      mediaPackageId - id of the media package to remove
      Returns:
      true if the episode was found and deleted
      Throws:
      SearchException - if an error occurs while removing the media package
      org.opencastproject.security.api.UnauthorizedException - if the current user is not authorized to remove this mediapackage from the search index
      org.opencastproject.util.NotFoundException
    • deleteSeries

      org.opencastproject.job.api.Job deleteSeries(String seriesId) throws SearchException, org.opencastproject.security.api.UnauthorizedException, org.opencastproject.util.NotFoundException
      Removes the series identified by seriseId from the search index. Does *not* remove the associated events from the index!
      Parameters:
      seriesId - id of the series to remove
      Returns:
      true if the series was found and deleted
      Throws:
      SearchException - if an error occurs while removing the series
      org.opencastproject.security.api.UnauthorizedException - if the current user is not authorized to remove this series from the search index
      org.opencastproject.util.NotFoundException
    • deleteSynchronously

      boolean deleteSynchronously(String mediaPackageId) throws SearchException
      Immediately removes the given mediapackage from the search service.
      Parameters:
      mediaPackageId - the mediapackage
      Returns:
      true if the mediapackage was deleted
      Throws:
      SearchException - if deletion failed
    • get

      org.opencastproject.mediapackage.MediaPackage get(String mediaPackageId) throws org.opencastproject.util.NotFoundException, SearchException, org.opencastproject.security.api.UnauthorizedException
      Gets the MediaPackage for an event, based on its mediapackage ID.
      Parameters:
      mediaPackageId - The ID of the mediapackage in question
      Returns:
      The MediaPackage
      Throws:
      org.opencastproject.util.NotFoundException - If the mediapackage is not found.
      SearchException - If an error occurs while searching for the mediapackage.
      org.opencastproject.security.api.UnauthorizedException - if the current user is not authorized to view this mediapackage.
    • search

      SearchResultList search(org.elasticsearch.search.builder.SearchSourceBuilder searchSource) throws SearchException
      Searches the index based on a SearchSourceBuilder's query
      Parameters:
      searchSource - The SearchSourceBuilder defining the search query
      Returns:
      A SearchResultList of the search's results
      Throws:
      SearchException - If an error occurs while searching the index.