More intelligent searches in Geo::Coder::Free

I'm keen to work on more "intuitive" searches for Geo::Coder::Free. It occurred to me, for example, when looking for a local favourite watering hole of mine, that I wouldn't be likely to search for "Rock Bottom Restaurant, Norfolk Ave, Bethesda, MD, USA". Instead, I'd be much more likely to search for "Rock Bottom, Bethesda, MD, USA'.

So I've added support for that. As a proof of concept, I only work on Restaurants, however the Whos On First data includes a (admittedly unsupported field) of sg:classifier which I should be able to use for a more wide support. What that means is that is if a business type is included in the name of the business, I can remove it and anything after that and add it to the database. In simple terms that allows "Foo Hairdressers and Barber's shop" to be indexed as "Foo". And because you don't always know the street name, it's indexed both with and without.

I'm sure there will be plenty of cases were the above scenario doesn't work - I'll monitor Apache logs - but as a start it works surprisingly well, as shown by

curl ',+Bethesda,+MD,+USA'

Leave a comment

About Nigel Horne

user-pic I blog about my projects.