Yup, Lance is right.  But it won't always work if you have multi-valued data
since it wouldn't match a document that had a point both in the ring and the
hole.

Another approach that internally works faster and addresses the multi-value
case is to implement a custom Spatial4j Shape.  In this case, you could
create a special aggregate Shape that basically accepts one shape and
excludes the other, in its custom relate() method.  It's like a subtracting
shape.  This is generically useful and on my list of things to do but I
haven't had the need.  The other step would be parsing it somehow, so you
might do that by extending the existing spatial 4 field type.

~ David


Lance Norskog-2 wrote
> Outer distance AND NOT inner distance?
> 
> On 04/12/2013 09:02 AM, kfdroid wrote:
>> We currently do a radius search from a given Lat/Long point and it works
>> great. I have a new requirement to do a search on a larger radius from
>> the
>> same point, but not include the smaller radius.  Kind of a donut (torus)
>> shaped search.
>>
>> How would I do this (Solr 4)?  Search where radius is between 20km and
>> 40km
>> for example?
>> Thanks,
>> Ken
>>
>>
>>
>> --
>> View this message in context:
>> http://lucene.472066.n3.nabble.com/Spatial-search-question-tp4055597.html
>> Sent from the Solr - User mailing list archive at Nabble.com.





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

Reply via email to