AnsweredAssumed Answered

Retrieving total items from a FilteringResultSet

Question asked by mkolas on Jul 25, 2014
We're using SearchService#query in order to run a paginated search, which returns a FilteringResultSet. To do so, we're using setMaxItems() and setSkipCount() on SearchParameters to make sure that we get the correct page of search results back. We would like to also retrieve the total number of items for the search, so that we know how many pages to show on our interface. Unfortunately, it seems like the only way to retrieve that total number of items is to reference the class's internal unfiltered ResultSet, which is private. There is a getter, getUnFilteredResultSet(), but it is package-private. Seems like an odd choice to me, but it is what it is.

What is the preferred method for getting the total number of items from a filtered search? Am I possibly missing some sort of useful class, or is our approach to a paginated search incorrect?