Class SearchSettings

java.lang.Object
ubic.gemma.model.common.search.SearchSettings

public class SearchSettings extends Object
Configuration options for searching.
Author:
paul
  • Field Details

    • 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:
  • Method Details

    • 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 - query
      arrayDesign - 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 - query
      taxon - 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 - query
      taxon - 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.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • builder

      public static SearchSettings.SearchSettingsBuilder builder()
    • getQuery

      public String getQuery()
      Processed query for performing a search.
    • getResultTypes

      public Set<Class<? extends Identifiable>> getResultTypes()
      Entities to retrieve.
    • getPlatformConstraint

      @Nullable public ArrayDesign getPlatformConstraint()
    • getExperimentConstraint

      @Nullable public ExpressionExperiment getExperimentConstraint()
    • getTaxonConstraint

      @Nullable public Taxon getTaxonConstraint()
    • isUseDatabase

      public boolean isUseDatabase()
      Use the database for finding results.
    • isUseOntology

      public boolean isUseOntology()
      Use the ontology and ontology inference for finding results.

      Results from the Gene Ontology (GO) are not included in this setting, use setUseGeneOntology(boolean) for that purpose.

    • isUseGeneOntology

      public boolean isUseGeneOntology()
      Include results from the Gene Ontology (GO).
    • isUseFullTextIndex

      public boolean isUseFullTextIndex()
      Use the full-text index for finding results.
    • getMaxResults

      public int getMaxResults()
      Limit for the number of results per result type.

      The default is relatively large and given by DEFAULT_MAX_RESULTS_PER_RESULT_TYPE. Any value less than one indicate no limit.

    • isFillResults

      public boolean isFillResults()
      Indicate if result objects (i.e. SearchResult.getResultObject() should be filled, otherwise only the class and ID will be populated.
    • getMode

      public SearchSettings.SearchMode getMode()
      Indicate the search mode to use.

      Defaults to balanced.

    • setQuery

      public void setQuery(String query)
      Processed query for performing a search.
    • setResultTypes

      public void setResultTypes(Set<Class<? extends Identifiable>> resultTypes)
      Entities to retrieve.
    • setPlatformConstraint

      public void setPlatformConstraint(@Nullable ArrayDesign platformConstraint)
    • setExperimentConstraint

      public void setExperimentConstraint(@Nullable ExpressionExperiment experimentConstraint)
    • setTaxonConstraint

      public void setTaxonConstraint(@Nullable Taxon taxonConstraint)
    • setUseDatabase

      public void setUseDatabase(boolean useDatabase)
      Use the database for finding results.
    • setUseOntology

      public void setUseOntology(boolean useOntology)
      Use the ontology and ontology inference for finding results.

      Results from the Gene Ontology (GO) are not included in this setting, use setUseGeneOntology(boolean) for that purpose.

    • setUseGeneOntology

      public void setUseGeneOntology(boolean useGeneOntology)
      Include results from the Gene Ontology (GO).
    • setUseFullTextIndex

      public void setUseFullTextIndex(boolean useFullTextIndex)
      Use the full-text index for finding results.
    • setMaxResults

      public void setMaxResults(int maxResults)
      Limit for the number of results per result type.

      The default is relatively large and given by DEFAULT_MAX_RESULTS_PER_RESULT_TYPE. Any value less than one indicate no limit.

    • setFillResults

      public void setFillResults(boolean fillResults)
      Indicate if result objects (i.e. SearchResult.getResultObject() should be filled, otherwise only the class and ID will be populated.
    • setMode

      public void setMode(SearchSettings.SearchMode mode)
      Indicate the search mode to use.

      Defaults to balanced.

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • withQuery

      public SearchSettings withQuery(String query)
      Processed query for performing a search.
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withResultTypes

      public SearchSettings withResultTypes(Set<Class<? extends Identifiable>> resultTypes)
      Entities to retrieve.
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withPlatformConstraint

      public SearchSettings withPlatformConstraint(@Nullable ArrayDesign platformConstraint)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withExperimentConstraint

      public SearchSettings withExperimentConstraint(@Nullable ExpressionExperiment experimentConstraint)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withTaxonConstraint

      public SearchSettings withTaxonConstraint(@Nullable Taxon taxonConstraint)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withUseDatabase

      public SearchSettings withUseDatabase(boolean useDatabase)
      Use the database for finding results.
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withUseOntology

      public SearchSettings withUseOntology(boolean useOntology)
      Use the ontology and ontology inference for finding results.

      Results from the Gene Ontology (GO) are not included in this setting, use setUseGeneOntology(boolean) for that purpose.

      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withUseGeneOntology

      public SearchSettings withUseGeneOntology(boolean useGeneOntology)
      Include results from the Gene Ontology (GO).
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withUseFullTextIndex

      public SearchSettings withUseFullTextIndex(boolean useFullTextIndex)
      Use the full-text index for finding results.
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withMaxResults

      public SearchSettings withMaxResults(int maxResults)
      Limit for the number of results per result type.

      The default is relatively large and given by DEFAULT_MAX_RESULTS_PER_RESULT_TYPE. Any value less than one indicate no limit.

      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withFillResults

      public SearchSettings withFillResults(boolean fillResults)
      Indicate if result objects (i.e. SearchResult.getResultObject() should be filled, otherwise only the class and ID will be populated.
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withMode

      public SearchSettings withMode(SearchSettings.SearchMode mode)
      Indicate the search mode to use.

      Defaults to balanced.

      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).