max result is now set to 40, and queries are repeated with different
indexes until at least 5 results are returned.