Don't make the same ES query twice if there are no results (bug 975102)