Class SearchServiceIndex

  • All Implemented Interfaces:
    org.opencastproject.elasticsearch.index.rebuild.IndexProducer

    public final class SearchServiceIndex
    extends org.opencastproject.elasticsearch.index.rebuild.AbstractIndexProducer
    implements org.opencastproject.elasticsearch.index.rebuild.IndexProducer
    A Elasticsearch-based SearchService implementation.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String INDEX_NAME  
    • Constructor Summary

      Constructors 
      Constructor Description
      SearchServiceIndex()
      Creates a new instance of the search service index.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void activate​(org.osgi.service.component.ComponentContext cc)
      Service activator, called via declarative services configuration.
      void addSynchronously​(org.opencastproject.mediapackage.MediaPackage mediaPackage)
      Immediately adds the mediapackage to the search index.
      boolean deleteSeriesSynchronously​(String seriesId)
      Immediately removes the given series from the search service.
      boolean deleteSynchronously​(String mediaPackageId)
      Immediately removes the given mediapackage from the search service.
      org.opencastproject.elasticsearch.index.rebuild.IndexRebuildService.Service getService()  
      void repopulate()  
      org.elasticsearch.action.search.SearchResponse search​(org.elasticsearch.search.builder.SearchSourceBuilder searchSource)  
      void setAuthorizationService​(org.opencastproject.security.api.AuthorizationService authorizationService)  
      void setEsIndex​(org.opencastproject.elasticsearch.index.ElasticsearchIndex esIndex)  
      void setOrganizationDirectoryService​(org.opencastproject.security.api.OrganizationDirectoryService organizationDirectory)
      Sets a reference to the organization directory service.
      void setPersistence​(SearchServiceDatabase persistence)  
      void setSecurityService​(org.opencastproject.security.api.SecurityService securityService)
      Callback for setting the security service.
      void setSeriesService​(org.opencastproject.series.api.SeriesService seriesService)  
      void setWorkspace​(org.opencastproject.workspace.api.Workspace workspace)  
      • Methods inherited from class org.opencastproject.elasticsearch.index.rebuild.AbstractIndexProducer

        logIndexRebuildBegin, logIndexRebuildBegin, logIndexRebuildError, logIndexRebuildError, logIndexRebuildError, logIndexRebuildProgress, logIndexRebuildProgress, logIndexRebuildProgress, logIndexRebuildProgress, logSkippingElement, logSkippingElement
    • Constructor Detail

      • SearchServiceIndex

        public SearchServiceIndex()
        Creates a new instance of the search service index.
    • Method Detail

      • getService

        public org.opencastproject.elasticsearch.index.rebuild.IndexRebuildService.Service getService()
        Specified by:
        getService in interface org.opencastproject.elasticsearch.index.rebuild.IndexProducer
      • activate

        public void activate​(org.osgi.service.component.ComponentContext cc)
                      throws IllegalStateException
        Service activator, called via declarative services configuration.
        Parameters:
        cc - the component context
        Throws:
        IllegalStateException
      • setEsIndex

        public void setEsIndex​(org.opencastproject.elasticsearch.index.ElasticsearchIndex esIndex)
      • search

        public org.elasticsearch.action.search.SearchResponse search​(org.elasticsearch.search.builder.SearchSourceBuilder searchSource)
                                                              throws org.opencastproject.search.api.SearchException
        Throws:
        org.opencastproject.search.api.SearchException
      • addSynchronously

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

        public boolean deleteSynchronously​(String mediaPackageId)
                                    throws org.opencastproject.search.api.SearchException
        Immediately removes the given mediapackage from the search service.
        Parameters:
        mediaPackageId - the media package identifier
        Returns:
        true if the mediapackage was deleted
        Throws:
        org.opencastproject.search.api.SearchException - if deletion failed
      • deleteSeriesSynchronously

        public boolean deleteSeriesSynchronously​(String seriesId)
                                          throws org.opencastproject.search.api.SearchException
        Immediately removes the given series from the search service.
        Parameters:
        seriesId - the series
        Throws:
        org.opencastproject.search.api.SearchException
      • repopulate

        public void repopulate()
                        throws org.opencastproject.elasticsearch.index.rebuild.IndexRebuildException
        Specified by:
        repopulate in interface org.opencastproject.elasticsearch.index.rebuild.IndexProducer
        Throws:
        org.opencastproject.elasticsearch.index.rebuild.IndexRebuildException
      • setSeriesService

        public void setSeriesService​(org.opencastproject.series.api.SeriesService seriesService)
      • setWorkspace

        public void setWorkspace​(org.opencastproject.workspace.api.Workspace workspace)
      • setAuthorizationService

        public void setAuthorizationService​(org.opencastproject.security.api.AuthorizationService authorizationService)
      • setSecurityService

        public void setSecurityService​(org.opencastproject.security.api.SecurityService securityService)
        Callback for setting the security service.
        Parameters:
        securityService - the securityService to set
      • setOrganizationDirectoryService

        public void setOrganizationDirectoryService​(org.opencastproject.security.api.OrganizationDirectoryService organizationDirectory)
        Sets a reference to the organization directory service.
        Parameters:
        organizationDirectory - the organization directory