Great question — answering as the UphillTech team:
Yelp and many other directory sites are probably using IP geolocation and then generating a URL based on that location. When Googlebot requests the site it will get the version based on its IP address, maybe get a city and service page, crawls and indexes the content and other links. Google won't necessarily index a search results page, or any dynamically generated content unless there is a static version of it. Or at least an internal link so that that URL gets crawled. Could be a sitemap. That is the basic overview, it is slightly more complicated, but that is the basic answer: cache static pages, sitemaps, linking strategy.
Full answer by keepkalm: https://webmasters.stackexchange.com/a/143478 (CC BY-SA 4.0).
Need it done for your business? UphillTech.