When a person clicks on a link, I want to do this:
You are changing the wrong location property if you only want to change the search string. I think you want to do this:
location.search = "?search=" + encodeURIComponent( $("#someId").val());