Interface SearchService
- All Known Implementing Classes:
SearchServiceImpl
- Author:
- paul
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiongetFields
(Class<? extends Identifiable> resultType) Obtain a list of fields that can be searched on for the given result type.Set
<Class<? extends Identifiable>> Returns a set of supported result types.<T extends Identifiable,
U extends IdentifiableValueObject<T>>
SearchResult<U> loadValueObject
(SearchResult<T> searchResult) Convert aSearchResult
to its VO flavour.List
<SearchResult<? extends IdentifiableValueObject<?>>> loadValueObjects
(Collection<SearchResult<?>> searchResults) Convert a collection ofSearchResult
to their VO flavours.search
(SearchSettings settings) search
(SearchSettings settings, SearchContext context) The results are sorted in order of decreasing score, organized by class.
-
Method Details
-
getFields
Obtain a list of fields that can be searched on for the given result type. -
search
SearchService.SearchResultMap search(SearchSettings settings, SearchContext context) throws SearchException The results are sorted in order of decreasing score, organized by class. The following objects can be searched for, depending on the configuration of the input object.- Genes
- ExpressionExperiments
- CompositeSequences (probes)
- ArrayDesigns (platforms)
- Characteristics (e.g., Ontology annotations)
- BioSequences
- BibliographicReferences (articles)
- Parameters:
settings
- settingscontext
-- Returns:
- Map of Class to SearchResults. The results are already filtered for security considerations.
- Throws:
SearchException
-
search
- Throws:
SearchException
-
getSupportedResultTypes
Set<Class<? extends Identifiable>> getSupportedResultTypes()Returns a set of supported result types.This is mainly used to perform a search for everything via
invalid reference
SearchSettings#getResultTypes()
-
loadValueObject
<T extends Identifiable,U extends IdentifiableValueObject<T>> SearchResult<U> loadValueObject(SearchResult<T> searchResult) throws IllegalArgumentException Convert aSearchResult
to its VO flavour.The resulting search result preserve the result ID, score and highlighted text, and
invalid reference
SearchResult#getResultType()
invalid reference
SearchResult#getResultObject()
The conversion logic is mainly defined by the corresponding
BaseVoEnabledService
that match the result type. SeegetSupportedResultTypes()
for a set of supported result types this o function can handle.- Throws:
IllegalArgumentException
- if the passed search result is not supported for VO conversion
-
loadValueObjects
List<SearchResult<? extends IdentifiableValueObject<?>>> loadValueObjects(Collection<SearchResult<?>> searchResults) throws IllegalArgumentException Convert a collection ofSearchResult
to their VO flavours.Note that since the results might contain a mixture of different result types, the implementation can take advantage of grouping result by types in order to use
BaseVoEnabledService.loadValueObjects(Collection)
, which is generally more efficient than loading each result individually.- Parameters:
searchResults
- a collection ofSearchResult
, which may contain a mixture of differentIdentifiable
result objects- Returns:
- converted search results as per
loadValueObject(SearchResult)
- Throws:
IllegalArgumentException
- if any of the supplied search results cannot be converted to VO- See Also:
-