You could certainly redirect users that way, but since you are going off of the IP of the requester, search bots would only be able to index the location URLs that are relative to each bot's location, not the location of end users. Is that what you really want?
Alternativley, you might consider using a <meta name="robots" content="noindex">
tag in your HTML to prevent search bots from indexing pages you do not want them to index. So it might make sense to let bots index /search/location-1
and /search/location-2
individually but ignore /search
if you do not use a redirect on it.