Fix for the search

- Due to the sanitization being fixed, the search results broke

- This is a quick copy of the fix implemented on develop by cvandeplas