getHits() and totalHits() give different no. of results set

Hi All,

Am using elastic version 1.2.1, below is my searchquery, here the fromIndex refers to dynamic value which fetches result based on the page no,(10 results for each page) but when I try to iterate over the ResultSet, I got diff values for getHits() and totalHits(). For instance, I got 10 hits for each page and resultset shows different no of searchhits over the iterations, sometimes as 7, 8 and 9.

SearchRequestBuilder requestBuilder = client.prepareSearch()
.setSearchType(SearchType.QUERY_THEN_FETCH)
.setQuery(filterQuery)
.setFrom(fromIndex).setExplain(false)

Any suggestion would be helpful, thanks in advance.

Regards,
Anand

Moving this to the Elasticsearch category since it is not to do with User Groups