Class DefaultSearchResults

    • Field Detail

      • EMPTY_RESULTS

        protected static final SearchResults EMPTY_RESULTS
    • Constructor Detail

      • DefaultSearchResults

        public DefaultSearchResults​(List<? extends SearchResult> results,
                                    int unfilteredResultsCount,
                                    String searchQuery)
      • DefaultSearchResults

        public DefaultSearchResults​(List<? extends SearchResult> results,
                                    int unfilteredResultsCount)
    • Method Detail

      • getRawResults

        public List getRawResults()
        Get the raw search results. Mostly necessary for testing, don't call this directly!
        Returns:
        the raw search results.
      • getUnfilteredResultsCount

        public int getUnfilteredResultsCount()
        Get the number of search results before being passed through any filter. (i.e. to get the total number of results before taking only the first ten)
        Specified by:
        getUnfilteredResultsCount in interface SearchResults
        Returns:
        the number of search results before filtering takes place
      • size

        public int size()
        Description copied from interface: SearchResults
        Get the number of search results included in this object.
        Specified by:
        size in interface SearchResults
        Returns:
        the number of search results returned
      • getAll

        public List<SearchResult> getAll()
        Description copied from interface: SearchResults
        Creates a new list containing all returned search results.
        Specified by:
        getAll in interface SearchResults
        Returns:
        a new list containing all returned search results
      • getSearchWords

        public List<String> getSearchWords()
        Specified by:
        getSearchWords in interface SearchResults
        Returns:
        a list of the words in the query string that were actually used in the search (raw query string with the stop words removed). May be an empty list if there were none.
      • getSearchQuery

        public String getSearchQuery()
        Specified by:
        getSearchQuery in interface SearchResults
        Returns:
        a query string used in the search. It is useful for diagnostic purpose.
      • isLastPage

        public boolean isLastPage()
        Specified by:
        isLastPage in interface SearchResults
        Returns:
        true if this is the last page of search results.