use ruby-1.9 hash style
only append search if not empty
add additional tests