Correctly show the search result context (see #5914)