Monday, November 24, 2014

Geospatial Search with SOLR and Solarium

In a recent series of articles I looked in detail at Apache’s SOLR and Solarium.


To recap; SOLR is a search service with a raft of features - such as faceted search and result highlighting - which runs as a web service. Solarium is a PHP library which allows you to integrate with SOLR - whether local or remote - interacting with it as if it were a native component of your application. If you’re unfamiliar with either, then my series is over here, and I’d urge you to take a look.


In this article, I’m going to look at another part of SOLR which warrants its own discussion; Geospatial search.


An Example


I’ve put together a simple example application to accompany this article. You can get it from Github, or see it in action here.


Before we delve into that, let’s look at some of the background.



Sometimes, the things you want to search for have geographical locations. Often, that provides vital context. It’s all very well me being able to search for “Italian restaurants”, but I’m hungry - a restaurant on another continent, as good as it might be, is of no help. Rather, it would be far more useful to be able to run a search which asks “show me Italian restaurants, but within 5 miles”. Or alternatively, “show me the ten closest Italian restaurants”. That’s where Geospatial search comes in.


Continue reading %Geospatial Search with SOLR and Solarium%




by Lukas White via SitePoint

No comments:

Post a Comment