trim search query string