Location extraction application

The architecture used for this example, has a location extraction application, which takes
a users request, separates the query from the location, and forwards it on to your search engine.



This allows you to simply link in your search engine without change, and it's optional as having a text
location or a lat/long point passed to your search engine.

The location extraction component for this example is written in PHP, but can be written in any language,
that suits your environment. We simply use the high lighter component, to find the best match from your
query, remove that address, and preserve the query.

A working example is viewable http://www.gissearch.com/products/query.php
The high light component of Solr was being rewritten at the time of creating this article, for that reason
I've not included the source of the PHP part. Honestly it's just a couple of regexp's.

To create an open search implementation you will need an XML descriptor file, http://www.gissearch.com/products/ypsearch.xml
This most important part is a URL descriptor which provides a link to your location extractor.

<Url type="text/html" method="GET" template="http://www.gissearch.com/products/ypsearch.php">


There will be a parameter "q=" passed to the ypsearch.php page, containing the user's input string.
To generate the icon, displayed in the search bar, you can use an online gif to icon base 64 conversion tool
http://software.hixie.ch/utilities/cgi/data/data

While this is just an example, it solve a significant portion of US queries, but it can be deployed internationally.
If you have any questions, comments feel free to contact me.

pjaol [at] pjaol.com