Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7598087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:19:15+00:00 2026-05-30T22:19:15+00:00

I have a site with content that is searchable using a search bar that

  • 0

I have a site with content that is searchable using a search bar that is powered by Sphinx Search (only mentioned because I will end up using Sphinx’s geo-search functionality).

Table fields include:

Id, title, description, tags, geolocation

How can I go about determining if any part of a string contains a reference to a geographic location? The solution I am looking for will likely be performed in PHP and I will then search using Sphinx as I normally would.

For example, if someone searches for any of the following:

Car parts in California

Car parts near San Francisco

90210 car parts

Then I would like to be able to return a list of all entries that match car parts within a certain radius of the desired location.

I am open to any suggestions as to how to make this problem simpler.

Note: the geolocation substring entry by the user is optional. Therefore, the solution needs to determine it’s existence and then act accordingly.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T22:19:16+00:00Added an answer on May 30, 2026 at 10:19 pm

    There are a couple of APIs you could use for this:

    http://www.datasciencetoolkit.org/ <– look at Geodict

    http://developer.yahoo.com/geo/placemaker/guide/web-service.html

    http://developers.metacarta.com/api/ <– look at Query Parser

    … they perform all the “heavy lifting” for you 🙂

    Alternativly, could make your own with sphinx itself!

    Download a copy of geonames database http://www.geonames.org/

    Stick it in a database table, and make a sphinx index on it.

    Then take your query string and run a SPH_MATCH_ANY query against the ‘geo’ table.

    Then look though the sphinx resultset, and extract any place matches – to make a new query without the placename.

    This sphinx index will also return you geocoordinates you can use for the real query 🙂

    (you could optimise it a bit to specifically notice the ‘in/near’ and either just remove them, or use them to explicitly identify the placename)

    Good luck!

    (the zip-code handling – could also be done in the same way – put the zip codes in the sphinx index too. there are downloadable copies available online. Or could be handled as special case – looking for a number)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a site which is searchable using Lucene. I've noticed from logs that
I have a site content type that was used for a handful of lists
I have one site that is displaying html content that needs to be displayed
Let's say I have a web site for hosting community generated content that targets
I'm working on a site that allows users to purchase digital content and have
I have a site that has some areas of content that need to be
I'm building a PHP page that will load some off site content into a
I have a site that get content from other sites with some JSON and
I have a site that is Ajaxed, content that is Ajax is from other
I have lots of content that needs to be published on a web site

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.