Package ubic.gemma.model.common.search
Class SearchSettings
- java.lang.Object
-
- ubic.gemma.model.common.search.SearchSettings
-
- All Implemented Interfaces:
Serializable
public class SearchSettings extends Object implements Serializable
Configuration options for searching.- Author:
- paul
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SearchSettings.SearchMode
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_MAX_RESULTS_PER_RESULT_TYPE
How many results per result type are allowed.
-
Constructor Summary
Constructors Constructor Description SearchSettings()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SearchSettings
arrayDesignSearch(String query)
Convenience method to get pre-configured settings.static SearchSettings
bibliographicReferenceSearch(String query)
Convenience method to get pre-configured settings.static SearchSettings
compositeSequenceSearch(String query, ArrayDesign arrayDesign)
Convenience method to get pre-configured settings.static SearchSettings
expressionExperimentSearch(String query)
Convenience method to get pre-configured settings.static SearchSettings
expressionExperimentSearch(String query, Taxon taxon)
Convenience method to get pre-configured settings.static SearchSettings
geneSearch(String query, Taxon taxon)
Convenience method to get pre-configured settings.boolean
hasResultType(Class<?> cls)
Check if this is configured to search a given result type.Map<String,String>
highlight(String value, String field)
Highlight a given field.Map<String,String>
highlightDocument(org.apache.lucene.document.Document document, org.apache.lucene.search.highlight.Highlighter luceneHighlighter, org.apache.lucene.analysis.Analyzer analyzer)
Map<String,String>
highlightTerm(String termUri, String termLabel, String field)
Highlight a given ontology term.String
toString()
-
-
-
Field Detail
-
DEFAULT_MAX_RESULTS_PER_RESULT_TYPE
public static final int DEFAULT_MAX_RESULTS_PER_RESULT_TYPE
How many results per result type are allowed. This implies that if you search for multiple types of things, you can get more than this.- See Also:
- Constant Field Values
-
-
Method Detail
-
arrayDesignSearch
public static SearchSettings arrayDesignSearch(String query)
Convenience method to get pre-configured settings.- Parameters:
query
- query- Returns:
- search settings
-
bibliographicReferenceSearch
public static SearchSettings bibliographicReferenceSearch(String query)
Convenience method to get pre-configured settings.- Parameters:
query
- query- Returns:
- search settings
-
compositeSequenceSearch
public static SearchSettings compositeSequenceSearch(String query, @Nullable ArrayDesign arrayDesign)
Convenience method to get pre-configured settings.- Parameters:
query
- queryarrayDesign
- the array design to limit the search to- Returns:
- search settings
-
expressionExperimentSearch
public static SearchSettings expressionExperimentSearch(String query)
Convenience method to get pre-configured settings.- Parameters:
query
- query- Returns:
- search settings
-
expressionExperimentSearch
public static SearchSettings expressionExperimentSearch(String query, @Nullable Taxon taxon)
Convenience method to get pre-configured settings.- Parameters:
query
- querytaxon
- if you want to filter by taxon (can be null)- Returns:
- search settings
-
geneSearch
public static SearchSettings geneSearch(String query, @Nullable Taxon taxon)
Convenience method to get pre-configured settings.- Parameters:
query
- querytaxon
- the taxon to limit the search to (can be null)- Returns:
- search settings
-
hasResultType
public boolean hasResultType(Class<?> cls)
Check if this is configured to search a given result type.
-
highlight
@Nullable public Map<String,String> highlight(String value, String field)
Highlight a given field.
-
highlightTerm
@Nullable public Map<String,String> highlightTerm(String termUri, String termLabel, String field)
Highlight a given ontology term.This is a shorthand for
#getHighlighter()
andOntologyHighlighter.highlightTerm(String, String, String)
that deals with a potentially null highlighter.- Returns:
- a highlight, or null if no provider is set or the provider returns null
- See Also:
#setHighlighter(Highlighter)
-
highlightDocument
@Nullable public Map<String,String> highlightDocument(org.apache.lucene.document.Document document, org.apache.lucene.search.highlight.Highlighter luceneHighlighter, org.apache.lucene.analysis.Analyzer analyzer)
-
-