Interface SearchResults
-
- All Superinterfaces:
Iterable<SearchResult>
- All Known Implementing Classes:
DefaultSearchResults
,LuceneSearchResults
public interface SearchResults extends Iterable<SearchResult>
The results of a search.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description List<SearchResult>
getAll()
Creates a new list containing all returned search results.SearchWithToken
getNextPageSearch()
default String
getSearchQuery()
List<String>
getSearchWords()
int
getUnfilteredResultsCount()
Get the number of search results before any filter was applied.boolean
isLastPage()
Iterator<SearchResult>
iterator()
Gets an iterator to run through the returned search results.int
size()
Get the number of search results included in this object.-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
getUnfilteredResultsCount
int getUnfilteredResultsCount()
Get the number of search results before any filter was applied. For example, if you ran a filter to limit the number of results returned, this would give the total number of hits for your query before the limit was taken into account.- Returns:
- the number of search results available before filtering was performed
-
size
int size()
Get the number of search results included in this object.- Returns:
- the number of search results returned
-
iterator
Iterator<SearchResult> iterator()
Gets an iterator to run through the returned search results.- Specified by:
iterator
in interfaceIterable<SearchResult>
- Returns:
- an iterator over the search results
-
getAll
List<SearchResult> getAll()
Creates a new list containing all returned search results.- Returns:
- a new list containing all returned search results
-
getSearchWords
List<String> getSearchWords()
- 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
default String getSearchQuery()
- Returns:
- a query string used in the search. It is useful for diagnostic purpose.
-
getNextPageSearch
SearchWithToken getNextPageSearch()
- Returns:
- a ISearch that can be used to retrieve the next page of results.
-
isLastPage
boolean isLastPage()
- Returns:
- true if this is the last page of search results.
-
-