I don't think this quite works. getSearchTermFromURI returns the urlencoded string which can include %20 or + for space. We need to urldecode the string.