SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    May 2008
    Location
    South Florida
    Posts
    80
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to build a local search engine

    Hello, I'm doing a project in Ruby on Rails where I need to implement a local search engine. I have a database of businesses and their addresses (street city state zip) and I need to figure out how to do a distance based search.

    A visitor to the site should be able to search by street address or zip code, and receive results of the businesses that are close to the query address, sorted by proximity, along with a google map.

    Are there any API's or services out there that will do the calculations? How do I begin to implement such a system?

  2. #2
    SitePoint Enthusiast
    Join Date
    Jan 2010
    Location
    Cleveland, OH
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would go to rubygems.org and search for available gems, or github.com for available plugins.

  3. #3
    SitePoint Enthusiast
    Join Date
    May 2008
    Location
    South Florida
    Posts
    80
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you have any names in mind? I've been looking around for a solution, I checked rubygems and github but didn't come up with anything.

    Programmatically, how would you implement location based search, given only a zip code or street address? I'd imagine I'd have to tie in to a service like google maps. I skimmed through the API but so far haven't found anything helpful since the search has to be performed on my database, rather than Google's index.

    Any more ideas would be great, thanks.

  4. #4
    SitePoint Enthusiast
    Join Date
    Jan 2010
    Location
    Cleveland, OH
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think this gem would help you. http://rubygems.org/gems/geokit Based on the documentation http://geokit.rubyforge.org/ it has Active Record distance based finders that will let you find all the points in your db within a 50-mile radius.

    There is an example app on github using the geokit and google-maps gems. http://github.com/johnsonch/google_maps_and_geokit_demo

    I've not used either of these before, and will not be able to comment on how to use them, but they seem like they will help with what you are trying to do.

    Please let me know if this is what you were looking for.

  5. #5
    SitePoint Enthusiast
    Join Date
    May 2008
    Location
    South Florida
    Posts
    80
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    OMG this is perfect thank you!


Tags for this Thread

Bookmarks

Posting Permissions

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