Clean search query before storing it in the db