Package org.opencastproject.search.impl
Class SearchServiceIndex
java.lang.Object
org.opencastproject.elasticsearch.index.rebuild.AbstractIndexProducer
org.opencastproject.search.impl.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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(org.osgi.service.component.ComponentContext cc) Service activator, called via declarative services configuration.voidaddSynchronously(org.opencastproject.mediapackage.MediaPackage mediaPackage) Immediately adds the mediapackage to the search index.booleandeleteSeriesSynchronously(String seriesId) Immediately removes the given series from the search service.booleandeleteSynchronously(String mediaPackageId) Immediately removes the given mediapackage from the search service.org.opencastproject.elasticsearch.index.rebuild.IndexRebuildService.ServicevoidindexMediaPackage(String mediaPackageId) voidrepopulate(org.opencastproject.elasticsearch.index.rebuild.IndexRebuildService.DataType type) org.elasticsearch.action.search.SearchResponsesearch(org.elasticsearch.search.builder.SearchSourceBuilder searchSource) voidsetAuthorizationService(org.opencastproject.security.api.AuthorizationService authorizationService) voidsetEsIndex(org.opencastproject.elasticsearch.index.ElasticsearchIndex esIndex) voidsetListProvidersService(org.opencastproject.list.api.ListProvidersService listProvidersService) voidsetOrganizationDirectoryService(org.opencastproject.security.api.OrganizationDirectoryService organizationDirectory) Sets a reference to the organization directory service.voidsetPersistence(SearchServiceDatabase persistence) voidsetSecurityService(org.opencastproject.security.api.SecurityService securityService) Callback for setting the security service.voidsetSeriesService(org.opencastproject.series.api.SeriesService seriesService) voidsetWorkspace(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, logSkippingElementMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opencastproject.elasticsearch.index.rebuild.IndexProducer
dataTypeSupported, getSupportedDataTypes
-
Field Details
-
INDEX_NAME
- See Also:
-
-
Constructor Details
-
SearchServiceIndex
public SearchServiceIndex()Creates a new instance of the search service index.
-
-
Method Details
-
getService
public org.opencastproject.elasticsearch.index.rebuild.IndexRebuildService.Service getService()- Specified by:
getServicein interfaceorg.opencastproject.elasticsearch.index.rebuild.IndexProducer
-
activate
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 indexIllegalArgumentException- if the media package isnullorg.opencastproject.security.api.UnauthorizedException- if the user does not have the rights to add the mediapackageSearchServiceDatabaseException
-
indexMediaPackage
public void indexMediaPackage(String mediaPackageId) throws org.opencastproject.search.api.SearchException, SearchServiceDatabaseException, org.opencastproject.security.api.UnauthorizedException, org.opencastproject.util.NotFoundException - Throws:
org.opencastproject.search.api.SearchExceptionSearchServiceDatabaseExceptionorg.opencastproject.security.api.UnauthorizedExceptionorg.opencastproject.util.NotFoundException
-
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:
trueif 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(org.opencastproject.elasticsearch.index.rebuild.IndexRebuildService.DataType type) throws org.opencastproject.elasticsearch.index.rebuild.IndexRebuildException - Specified by:
repopulatein interfaceorg.opencastproject.elasticsearch.index.rebuild.IndexProducer- Throws:
org.opencastproject.elasticsearch.index.rebuild.IndexRebuildException
-
setPersistence
-
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
-
setListProvidersService
public void setListProvidersService(org.opencastproject.list.api.ListProvidersService listProvidersService)
-