Re: Use case of Spatial search

2013-08-19 Thread Erick Erickson
I think you can do this by a combination of standard function queries,
see: http://wiki.apache.org/solr/FunctionQuery#if
and geodist, see:
http://wiki.apache.org/solr/SpatialSearch#geodist_-_The_distance_function

WARNING: I haven't tried this myself, but it seems like it would work. The
trick is to have your function return 0 for docs you want to exclude. Since
that's
multiplied into the score, you effectively eliminate the doc from your
result
set.

Best,
Erick


On Mon, Aug 19, 2013 at 8:53 AM, Shishir Jain shishir.j...@gmail.comwrote:

 Hi,

 I have a very standard use case of Spatial search. Was trying to figure out
 how to do it in Solr, but couldn't figure out a standard way of doing it.
 Please point me to any document which explains this use case or how this
 specific use case can be implemented in Solr.

 The Use case is:

 There is database of Food Joints who deliver food. Each of them have a
 different serving distance. So, when a user is requesting for a list of
 food joints which can serve at his/her location, it needs to find the
 distance between the user and food joint and the distance served by each of
 these joints and if the distance between the user and the food joint is
 less than the distance served, return the list. The geo co-ordiantes of the
 food joint and the radius of the distance served is pre-known and stored in
 the solr

 Now I'm trying to get this list directly from solr, but couldn't find any
 way. Please let me know if this use case is handled by Solr Spatial search
 and yes, how to do it. If no, what other Solr users have figured out as a
 work-around?

 Best regards,
 Shishir



Re: Use case of Spatial search

2013-08-19 Thread David Smiley (@MITRE.org)
Shishir,
Use the location_rpt type and index circles of the business and the distance
they serve with this syntax:  field name=myfieldNameCircle(lat,lon
d=degreesRadius)/field
Your query shape is then simply a point; use bbox query parser with d=0.

This approach should scale *great* at query time.  Erick suggesting using
function queries for filtering, which could work but the worse-case
performance can be bad (e.g. no other filtering and tons of data).

~ David
p.s. I'm on vacation so I'm not very responsive and my replies are less
descriptive


Shishir Jain wrote
 Hi,
 
 I have a very standard use case of Spatial search. Was trying to figure
 out
 how to do it in Solr, but couldn't figure out a standard way of doing it.
 Please point me to any document which explains this use case or how this
 specific use case can be implemented in Solr.
 
 The Use case is:
 
 There is database of Food Joints who deliver food. Each of them have a
 different serving distance. So, when a user is requesting for a list of
 food joints which can serve at his/her location, it needs to find the
 distance between the user and food joint and the distance served by each
 of
 these joints and if the distance between the user and the food joint is
 less than the distance served, return the list. The geo co-ordiantes of
 the
 food joint and the radius of the distance served is pre-known and stored
 in
 the solr
 
 Now I'm trying to get this list directly from solr, but couldn't find any
 way. Please let me know if this use case is handled by Solr Spatial search
 and yes, how to do it. If no, what other Solr users have figured out as a
 work-around?
 
 Best regards,
 Shishir





-
 Author: http://www.packtpub.com/apache-solr-3-enterprise-search-server/book
--
View this message in context: 
http://lucene.472066.n3.nabble.com/Use-case-of-Spatial-search-tp4085430p4085592.html
Sent from the Solr - User mailing list archive at Nabble.com.