Class SearchSettings

    • 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
    • Constructor Detail

      • SearchSettings

        public SearchSettings()
    • 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,
                                                             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,
                                                                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,
                                                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
      • getQuery

        public String getQuery()
        Get this query, trimmed.
      • getRawQuery

        public String getRawQuery()
        Get the original query that was set by #setQuery(String), untrimmed.
      • isTermQuery

        public boolean isTermQuery()
        Indicate if the query refers to an ontology term.

        This is done by checking if this query starts with 'http://' for now, but there could be fancier checks performed in the future.

      • setTermUri

        @Deprecated
        public void setTermUri​(String termUri)
        Deprecated.
        URI can be set with #setQuery(String) instead.
        Set this term URI.
        Parameters:
        termUri - a valid term URI, or null or a blank string
      • isWildcard

        public boolean isWildcard()
        Check if the query is a wildcard query.
      • hasResultType

        public boolean hasResultType​(Class<?> cls)
        Check if this is configured to search a given result type.
      • 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,
                                                          Set<String> fields)