lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <erik.hatc...@gmail.com>
Subject Re: Spatial Search on Postal Code
Date Fri, 04 Mar 2016 14:16:24 GMT
This is just like an implementation I recently worked on with a customer.  It’s very much
like this sort of thing ;) - 

    <http://nyulangone.org/doctors?query=&insurance=&location=10019&specialty=&condition=&treatment=&language=&gender=&sort=distance&originalCriteria=
<http://nyulangone.org/doctors?query=&insurance=&location=10019&specialty=&condition=&treatment=&language=&gender=&sort=distance&originalCriteria=>>

It’s implemented with Solr, leveraging the Lucidworks Fusion query pipelines to do these
steps:

   - &zipcode=NNNNN comes in to the query pipeline
   - a sub-query is made to a separate zipcodes index (built from a CSV file of zipcodes and
their corresponding representative lat/lon)
   - the matching lat/lon is used to build the appropriate geo-filtering and sorting parameters
to pass on to the main collection

Straightforward, clean, and effective for the needs.

—
Erik Hatcher, Senior Solutions Architect
http://www.lucidworks.com <http://www.lucidworks.com/>



> On Mar 4, 2016, at 7:09 AM, Manohar Sripada <manohar211@gmail.com> wrote:
> 
> Here's my requirement -  User enters postal code and provides the radius. I
> need to find the records with in the radius from the provided postal code.
> 
> There are few ways I thought through after going through the "Spatial
> Search" Solr wiki
> 
> 1. As Latitude and Longitude positions are required for spatial search. Get
> Latitude Longitude position (may be using GeoCoding API) of a postal code
> and use "LatLonType" field type and query accordingly. As the GeoCoding API
> returns one point and if the postal code area is too big, then I may end up
> not getting any results (apart from the records from the same postal code)
> if the radius provided is small.
> 
> 2. Get the latitude longitude points of the postal code which forms a
> border (not sure yet on how to get) and build a polygon (using RPT). While
> querying use this polygon and provide the distance. Can this be achieved?
> Or Am I ruminating too much? :(
> 
> Appreciate any help on this.
> 
> Thanks


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message