Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New to the CF scene
    Join Date
    Nov 2011
    Location
    USA
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.

    What would I need to do this?

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,456
    Thanks
    8
    Thanked 1,084 Times in 1,075 Posts
    Is this U.S. only?

    And how many jobs will be in your database list?

    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.?


    .

  • #3
    Senior Coder
    Join Date
    Apr 2010
    Posts
    1,392
    Thanks
    67
    Thanked 102 Times in 101 Posts
    Been a sign maker for 7 years. My business:
    American Made Signs

  • #4
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,456
    Thanks
    8
    Thanked 1,084 Times in 1,075 Posts
    But here's the problem with just zipcodes.

    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.


    .

  • #5
    New to the CF scene
    Join Date
    Nov 2011
    Location
    USA
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Is this U.S. only?
    Yes, only in the US.

    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?

  • #6
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,456
    Thanks
    8
    Thanked 1,084 Times in 1,075 Posts
    They have their own huge servers, and probably a lot of custom/proprietary programming.
    Probably not PHP, but C++ or Windows server with ASP.net

    How much money are you willing to spend on this?
    Maybe you can subscribe to a service to handle the distances without limits.

  • #7
    Senior Coder
    Join Date
    Apr 2010
    Posts
    1,392
    Thanks
    67
    Thanked 102 Times in 101 Posts
    These scripts contain code for both radius searches and distance calculations.
    Meaning you can set them up to be 10 miles, 25 miles, etc
    Been a sign maker for 7 years. My business:
    American Made Signs

  • #8
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,456
    Thanks
    8
    Thanked 1,084 Times in 1,075 Posts
    myfayt ...

    But how does the script know where the user is located.
    They can't just enter a zipcode.

    My zipcode covers 10 miles in several directions.


    .
    Last edited by mlseim; 11-11-2011 at 10:43 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •