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
SearchSourceare 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:SearchSourceIndicate if this source accepts the given search settings.- Specified by:
acceptsin interfaceSearchSource
-
searchArrayDesign
public Collection<SearchResult<ArrayDesign>> searchArrayDesign(SearchSettings settings) throws SearchException
- Specified by:
searchArrayDesignin interfaceSearchSource- Throws:
SearchException
-
searchBibliographicReference
public Collection<SearchResult<BibliographicReference>> searchBibliographicReference(SearchSettings settings) throws SearchException
- Specified by:
searchBibliographicReferencein interfaceSearchSource- Throws:
SearchException
-
searchExperimentSet
public Collection<SearchResult<ExpressionExperimentSet>> searchExperimentSet(SearchSettings settings) throws SearchException
- Specified by:
searchExperimentSetin interfaceSearchSource- Throws:
SearchException
-
searchBioSequence
public Collection<SearchResult<BioSequence>> searchBioSequence(SearchSettings settings) throws SearchException
- Specified by:
searchBioSequencein interfaceSearchSource- Throws:
SearchException
-
searchBioSequenceAndGene
@Deprecated public Collection<SearchResult<?>> searchBioSequenceAndGene(SearchSettings settings, @Nullable Collection<SearchResult<Gene>> previousGeneSearchResults) throws SearchException
Deprecated.Description copied from interface:SearchSourceSearch 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:
searchBioSequenceAndGenein interfaceSearchSource- Returns:
- a mixture of
BioSequenceandGenematching the search settings. - Throws:
SearchException
-
searchCompositeSequence
public Collection<SearchResult<CompositeSequence>> searchCompositeSequence(SearchSettings settings) throws SearchException
- Specified by:
searchCompositeSequencein interfaceSearchSource- Throws:
SearchException
-
searchCompositeSequenceAndGene
@Deprecated public Collection<SearchResult<?>> searchCompositeSequenceAndGene(SearchSettings settings) throws SearchException
Deprecated.Description copied from interface:SearchSourceSearch for composite sequences and, unfortunately, genes.FIXME: this should solely return
CompositeSequence- Specified by:
searchCompositeSequenceAndGenein interfaceSearchSource- Returns:
- a mixture of
GeneandCompositeSequencematching the search settings - Throws:
SearchException
-
searchExpressionExperiment
public Collection<SearchResult<ExpressionExperiment>> searchExpressionExperiment(SearchSettings settings) throws SearchException
- Specified by:
searchExpressionExperimentin interfaceSearchSource- Throws:
SearchException
-
searchGene
public Collection<SearchResult<Gene>> searchGene(SearchSettings settings) throws SearchException
- Specified by:
searchGenein interfaceSearchSource- Throws:
SearchException
-
searchGeneSet
public Collection<SearchResult<GeneSet>> searchGeneSet(SearchSettings settings) throws SearchException
- Specified by:
searchGeneSetin interfaceSearchSource- Throws:
SearchException
-
searchBlacklistedEntities
public Collection<SearchResult<BlacklistedEntity>> searchBlacklistedEntities(SearchSettings settings) throws SearchException
- Specified by:
searchBlacklistedEntitiesin interfaceSearchSource- Throws:
SearchException
-
-