I don't think Spatial search will fully fit into this. I have 2 approaches in 
mind but I am not satisfied with either one of them.

a) Have 2 separate indexes. First one to store the information about all the 
cities and second one to store the retail stores information. Whenever user 
searches for a city then I return all the matching cities from first index and 
then do a spatial search on each of the matched city in the second index. But 
this is too costly.

b) Index only the cities which have a nearby store. Do all the calculation(s) 
before indexing the data so that the search is fast. The problem that I see 
with this approach is that if a new retail store or a city is added then I 
would have to re-index all the data again.


On Mar 1, 2012, at 7:59 AM, Dirceu Vieira wrote:

> I believe that what you need is spatial search...
> 
> Have a look a the documention:  http://wiki.apache.org/solr/SpatialSearch
> 
> On Wed, Feb 29, 2012 at 10:54 PM, Venu Shankar 
> <venushankar...@gmail.com>wrote:
> 
>> Hello,
>> 
>> I have a design question for Solr.
>> 
>> I work for an enterprise which has a lot of retail stores (approx. 20K).
>> These retail stores are spread across the world.  My search requirement is
>> to find all the cities which are within x miles of a retail store.
>> 
>> So lets say if we have a retail Store in San Francisco and if I search for
>> "San" then San Francisco, Santa Clara, San Jose, San Juan, etc  should be
>> returned as they are within x miles from San Francisco. I also want to rank
>> the search results by their distance.
>> 
>> I can create an index with all the cities in it but I am not sure how do I
>> ensure that the cities returned in a search result have a nearby retail
>> store. Any suggestions ?
>> 
>> Thanks,
>> Venu,
>> 
> 
> 
> 
> -- 
> Dirceu Vieira JĂșnior
> -------------------------------------------------------------------
> +47 9753 2473
> dirceuvjr.blogspot.com
> twitter.com/dirceuvjr

Reply via email to