Optimize search query string.