Package ubic.gemma.core.search.source
Class CompositeSearchSource
- java.lang.Object
-
- ubic.gemma.core.search.source.CompositeSearchSource
-
- All Implemented Interfaces:
SearchSource
public class CompositeSearchSource extends Object implements SearchSource
A search source constituted of multiple other sources.Sources are used in the order they are passed to the
CompositeSearchSource(List)
constructor.This source checks if the
SearchSource
are accepted by each individual source withSearchSource.accepts(SearchSettings)
and subsequently delegate the operation.It also supports logging of the time spent by each source and the number of results found. This is done at the DEBUG level unless the value set by
setWarningThresholdMills(int)
orsetFastWarningThresholdMillis(int)
is exceeded in which case WARNING is used.- Author:
- poirigui
-
-
Constructor Summary
Constructors Constructor Description CompositeSearchSource(List<SearchSource> sources)
-
Method Summary
-
-
-
Constructor Detail
-
CompositeSearchSource
public CompositeSearchSource(List<SearchSource> sources)
-
-
Method Detail
-
setFastWarningThresholdMillis
public void setFastWarningThresholdMillis(int fastWarningThresholdMillis)
Threshold in milliseconds for a warning to be logged when searching withSearchSettings.SearchMode.FAST
.The default is 100 ms.
-
setWarningThresholdMills
public void setWarningThresholdMills(int warningThresholdMills)
Threshold in milliseconds for a warning to be logged.The default is 1000 ms.
-
accepts
public boolean accepts(SearchSettings settings)
Description copied from interface:SearchSource
Indicate if this source accepts the given search settings.- Specified by:
accepts
in interfaceSearchSource
-
searchArrayDesign
public Collection<SearchResult<ArrayDesign>> searchArrayDesign(SearchSettings settings) throws SearchException
- Specified by:
searchArrayDesign
in interfaceSearchSource
- Throws:
SearchException
-
searchBibliographicReference
public Collection<SearchResult<BibliographicReference>> searchBibliographicReference(SearchSettings settings) throws SearchException
- Specified by:
searchBibliographicReference
in interfaceSearchSource
- Throws:
SearchException
-
searchExperimentSet
public Collection<SearchResult<ExpressionExperimentSet>> searchExperimentSet(SearchSettings settings) throws SearchException
- Specified by:
searchExperimentSet
in interfaceSearchSource
- Throws:
SearchException
-
searchBioSequence
public Collection<SearchResult<BioSequence>> searchBioSequence(SearchSettings settings) throws SearchException
- Specified by:
searchBioSequence
in interfaceSearchSource
- Throws:
SearchException
-
searchBioSequenceAndGene
@Deprecated public Collection<SearchResult<?>> searchBioSequenceAndGene(SearchSettings settings, @Nullable Collection<SearchResult<Gene>> previousGeneSearchResults) throws SearchException
Deprecated.Description copied from interface:SearchSource
Search for biosequence and, unfortunately genes.I wanted to remove this, but there's some logic with indirect gene hit penalty that we might want to keep around.
- Specified by:
searchBioSequenceAndGene
in interfaceSearchSource
- Returns:
- a mixture of
BioSequence
andGene
matching the search settings. - Throws:
SearchException
-
searchCompositeSequence
public Collection<SearchResult<CompositeSequence>> searchCompositeSequence(SearchSettings settings) throws SearchException
- Specified by:
searchCompositeSequence
in interfaceSearchSource
- Throws:
SearchException
-
searchCompositeSequenceAndGene
@Deprecated public Collection<SearchResult<?>> searchCompositeSequenceAndGene(SearchSettings settings) throws SearchException
Deprecated.Description copied from interface:SearchSource
Search for composite sequences and, unfortunately, genes.FIXME: this should solely return
CompositeSequence
- Specified by:
searchCompositeSequenceAndGene
in interfaceSearchSource
- Returns:
- a mixture of
Gene
andCompositeSequence
matching the search settings - Throws:
SearchException
-
searchExpressionExperiment
public Collection<SearchResult<ExpressionExperiment>> searchExpressionExperiment(SearchSettings settings) throws SearchException
- Specified by:
searchExpressionExperiment
in interfaceSearchSource
- Throws:
SearchException
-
searchGene
public Collection<SearchResult<Gene>> searchGene(SearchSettings settings) throws SearchException
- Specified by:
searchGene
in interfaceSearchSource
- Throws:
SearchException
-
searchGeneSet
public Collection<SearchResult<GeneSet>> searchGeneSet(SearchSettings settings) throws SearchException
- Specified by:
searchGeneSet
in interfaceSearchSource
- Throws:
SearchException
-
searchBlacklistedEntities
public Collection<SearchResult<BlacklistedEntity>> searchBlacklistedEntities(SearchSettings settings) throws SearchException
- Specified by:
searchBlacklistedEntities
in interfaceSearchSource
- Throws:
SearchException
-
-