Updated total hits count to exclude bad results and moved test to fix index refreshing issues