Correctly escape query term in search