Interface SearchQuery

  • All Known Implementing Classes:
    BaseSearchQuery

    public interface SearchQuery
    A collection of search terms that will be used to query the search index. Each of the "set" and "add" methods will return the searchQuery itself, so calls can easily be chained together.
    • Method Detail

      • setQuery

        SearchQuery setQuery​(String query)
        Set the text of the query. This will be parsed using Lucene query syntax.
        Returns:
        this query
      • setStart

        SearchQuery setStart​(int start)
        Where in the ordered list of result documents should the response begin? That is, how many of the results should be skipped? (allows paging of results). The default is 0.
        Returns:
        this query
      • setRows

        SearchQuery setRows​(int rows)
        What is the maximum number of documents that will be returned from the query? A negative value means no limit. The default is -1.
        Returns:
        this query
      • addFields

        SearchQuery addFields​(String... names)
        Which fields should be returned from the query?
        Returns:
        this query
      • addFilterQuery

        SearchQuery addFilterQuery​(String filterQuery)
        Restrict the results by this query.
        Returns:
        this query
      • addFilterQueries

        SearchQuery addFilterQueries​(String... filterQueries)
        Restrict the results by these queries.
        Returns:
        this query
      • addFacetFields

        SearchQuery addFacetFields​(String... fields)
        What fields should be used to facet the results?
        Returns:
        this query
      • setFacetLimit

        SearchQuery setFacetLimit​(int cnt)
        The maximum number of facet counts that will be returned from the query. The default is 100. A negative value means no limit.
        Returns:
        this query
      • setFacetMinCount

        SearchQuery setFacetMinCount​(int cnt)
        Facet having fewer hits will be excluded from the list. The default is 0.
        Returns:
        this query
      • getQuery

        String getQuery()
        Returns:
        The text of the query. May be empty, but never null.
      • getStart

        int getStart()
      • getRows

        int getRows()
        Returns:
        A negative value means that no limit has been specified.
      • getFieldsToReturn

        Set<String> getFieldsToReturn()
        Returns:
        May return an empty set, but never null.
      • getFilters

        Set<String> getFilters()
        Returns:
        May return an empty set, but never null.
      • getFacetFields

        Set<String> getFacetFields()
        Returns:
        May return an empty set, but never null.
      • getFacetLimit

        int getFacetLimit()
        Returns:
        A negative value means that no limit has been specified.
      • getFacetMinCount

        int getFacetMinCount()
        Returns:
        A negative value means that no limit has been specified.