Misc cleanups to the old Search.groovy to make it more robust and clean.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1537083 13f79535-47bb-0310-9956-ffa450edef68