you also want to check here for `Object.keys(getSearchResults(doc)).length` in case it's a search that returns no results.

Note: typically, I return an array from `getSearchResults`, so it's less cumbersome to check this condition, but this is ok too.