updated search string URL enconding, depending on whether a string or an object is passed as search argument