How to implement a "smart" search by city, state and/or zip
I am working on a job board site and would like a similar search like the big sites. I.e. when you search a job by zip code and proximity (miles) it will bring up all jobs within that proximity according to zip code radius. And it should do the same for city.
Google has a free API for this, but there are limits to
how many distance requests per hour, per day, etc.
Zipcode is easiest, but covers too large an area,
so you'll need to resolve it down to address.
If you were to use a Google map, you could populate that
map with markers (locating each job). Then, the user only
enters their location, and the map centers on their location.
They visually see the markers and can pan/zoom, etc.
To not use a map, but search your database would require a
"fetch" for each one to compare to user's location. That's where
the limits of usage come into play.
And another question ... how large of an area does your jobs database cover?
Is this for a particular city, or the whole U.S.?
If I live in St. Paul, Minnesota, there might be 1000
jobs within my zipcode. No way to narrow that down
unless I change that resolution to street address.
You could utilize the "latitute" and "longitude" data that
they provide, but you would still need to convert your
street address to GPS location. So, you purchased the
zipcode database, and you still need to use Google or
Yahoo to do the address -> GPS conversion.
And how many jobs will be in your database list? Initially, probably about 1k to 5k jobs.
Google has a free API for this, but there are limits to
how many distance requests per hour, per day, etc. Thought about that, but want to implement something without any limits.
Zipcode is easiest, but covers too large an area,
so you'll need to resolve it down to address. I agree. I want the site to also search by proximity by miles (10, 25, 50 miles.. etc.)
If you were to use a Google map, you could populate that
map with markers (locating each job). Then, the user only
enters their location, and the map centers on their location.
They visually see the markers and can pan/zoom, etc. I want to have a straight forward list of jobs that come up after the user searches, similar to indeed, and monster.com.
To not use a map, but search your database would require a
"fetch" for each one to compare to user's location. That's where
the limits of usage come into play.
And another question ... how large of an area does your jobs database cover?
Is this for a particular city, or the whole U.S.? The whole US. Any employer who signs up will be able to post a job as long as the job is in the US.
How do sites like indeed.com and monster go about this? Do they purchase a database of zips and cities like the link myfayt posted?