Package org.opencastproject.search.api
Interface SearchService
public interface SearchService
Provides search capabilities, possibly to the engage tools, possibly to other services.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionorg.opencastproject.job.api.Jobadd(org.opencastproject.mediapackage.MediaPackage mediaPackage) Adds the media package to the search index.voidaddSynchronously(org.opencastproject.mediapackage.MediaPackage mediaPackage) Immediately adds the mediapackage to the search index.org.opencastproject.job.api.JobRemoves the media package identified bymediaPackageIdfrom the search index.org.opencastproject.job.api.JobdeleteSeries(String seriesId) Removes the series identified byseriseIdfrom the search index.booleandeleteSynchronously(String mediaPackageId) Immediately removes the given mediapackage from the search service.org.opencastproject.mediapackage.MediaPackageGets theMediaPackagefor an event, based on its mediapackage ID.Collection<org.apache.commons.lang3.tuple.Pair<org.opencastproject.security.api.Organization, org.opencastproject.mediapackage.MediaPackage>> Returns a list ofOrganization,MediaPackagepairs of mediapackages within a series.search(org.elasticsearch.search.builder.SearchSourceBuilder searchSource) Searches the index based on aSearchSourceBuilder's query
-
Field Details
-
JOB_TYPE
Identifier for service registration and location- See Also:
-
-
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 packageorg.opencastproject.mediapackage.MediaPackageException- if an error occurs accessing the media packageorg.opencastproject.security.api.UnauthorizedException- if the current user is not authorized to add this media package to the search indexorg.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 ofOrganization,MediaPackagepairs 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,MediaPackagepairs 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 indexIllegalArgumentException- if the mediapackage isnullorg.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 bymediaPackageIdfrom the search index.- Parameters:
mediaPackageId- id of the media package to remove- Returns:
trueif the episode was found and deleted- Throws:
SearchException- if an error occurs while removing the media packageorg.opencastproject.security.api.UnauthorizedException- if the current user is not authorized to remove this mediapackage from the search indexorg.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 byseriseIdfrom the search index. Does *not* remove the associated events from the index!- Parameters:
seriesId- id of the series to remove- Returns:
trueif the series was found and deleted- Throws:
SearchException- if an error occurs while removing the seriesorg.opencastproject.security.api.UnauthorizedException- if the current user is not authorized to remove this series from the search indexorg.opencastproject.util.NotFoundException
-
deleteSynchronously
Immediately removes the given mediapackage from the search service.- Parameters:
mediaPackageId- the mediapackage- Returns:
trueif 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 theMediaPackagefor 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 aSearchSourceBuilder's query- Parameters:
searchSource- TheSearchSourceBuilderdefining the search query- Returns:
- A
SearchResultListof the search's results - Throws:
SearchException- If an error occurs while searching the index.
-