parses search query string into json