Class DefaultSearchResults
java.lang.Object
com.atlassian.confluence.search.v2.DefaultSearchResults
- All Implemented Interfaces:
SearchResults
,Iterable<SearchResult>
- Direct Known Subclasses:
LuceneSearchResults
Default implementation of SearchResults
- Since:
- 5.9
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultSearchResults
(List<? extends SearchResult> results, int unfilteredResultsCount) DefaultSearchResults
(List<? extends SearchResult> results, int unfilteredResultsCount, SearchWithToken nextPageSearch) DefaultSearchResults
(List<? extends SearchResult> results, int unfilteredResultsCount, SearchWithToken nextPageSearch, List<String> searchWords) DefaultSearchResults
(List<? extends SearchResult> results, int unfilteredResultsCount, SearchWithToken nextPageSearch, List<String> searchWords, String searchQuery) DefaultSearchResults
(List<? extends SearchResult> results, int unfilteredResultsCount, String searchQuery) -
Method Summary
Modifier and TypeMethodDescriptiongetAll()
Creates a new list containing all returned search results.Get the raw search results.int
Get the number of search results before being passed through any filter.boolean
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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
EMPTY_RESULTS
-
-
Constructor Details
-
DefaultSearchResults
public DefaultSearchResults(List<? extends SearchResult> results, int unfilteredResultsCount, String searchQuery) -
DefaultSearchResults
-
DefaultSearchResults
public DefaultSearchResults(List<? extends SearchResult> results, int unfilteredResultsCount, SearchWithToken nextPageSearch, List<String> searchWords) -
DefaultSearchResults
public DefaultSearchResults(List<? extends SearchResult> results, int unfilteredResultsCount, SearchWithToken nextPageSearch, List<String> searchWords, String searchQuery) -
DefaultSearchResults
public DefaultSearchResults(List<? extends SearchResult> results, int unfilteredResultsCount, SearchWithToken nextPageSearch)
-
-
Method Details
-
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 interfaceSearchResults
- 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 interfaceSearchResults
- Returns:
- the number of search results returned
-
iterator
Description copied from interface:SearchResults
Gets an iterator to run through the returned search results.- Specified by:
iterator
in interfaceIterable<SearchResult>
- Specified by:
iterator
in interfaceSearchResults
- Returns:
- an iterator over the search results
-
getAll
Description copied from interface:SearchResults
Creates a new list containing all returned search results.- Specified by:
getAll
in interfaceSearchResults
- Returns:
- a new list containing all returned search results
-
getSearchWords
- Specified by:
getSearchWords
in interfaceSearchResults
- 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
- Specified by:
getSearchQuery
in interfaceSearchResults
- Returns:
- a query string used in the search. It is useful for diagnostic purpose.
-
getNextPageSearch
- Specified by:
getNextPageSearch
in interfaceSearchResults
- Returns:
- a ISearch that can be used to retrieve the next page of results.
-
isLastPage
public boolean isLastPage()- Specified by:
isLastPage
in interfaceSearchResults
- Returns:
- true if this is the last page of search results.
-