Moved search string parser to the server. (to avoid code duplication).