[SPRINTFIX][#56746980] Cast the results of the request to an array before taking a count when getting all pages of an index

This resolves an issue where the count may come back as 1 for stdClass objects, resulting in any remaining pages being ignored.