Bug patient search failed if there were leading or trailing spaces in se...

...arch term

https://www.pivotaltracker.com/story/show/70782258