1. A computer-implemented method performed by a data processing apparatus, comprising: receiving, by one or more processors, a search query and a geographic region associated with the search query, the geographic region having a central location and a bounding polygon; identifying, by the one or more processors, a plurality of candidate search results responsive to the search query, each candidate search result being associated with a geographic location; calculating, by the one or more processors and for each candidate search result, a central distance score, wherein the central distance score comprises a score based on a first geographic distance between the geographic location of the candidate search result and the central location of the geographic region; calculating, by the one or more processors and for each candidate search result, a polygon distance score, wherein the polygon distance score changes as a scoring function of a second geographic distance between the geographic location of the candidate search result and an edge of the bounding polygon of the geographic region nearest the geographic location of the candidate search result, wherein the scoring function uses the second geographic distance as an input and the polygon distance score is subject to a score limit; calculating, by the one or more processors and for each candidate search result, a respective location relevance score based on the central distance score and the polygon distance score for the candidate search result; and ranking, by the one or more processors, the plurality of candidate search results based at least in part on the calculated location relevance scores of the plurality of candidate search results.