1

I have items in Sitecore, these items represent service centers. They have a lat/lon and they have an effective range, meaning a range in which they are able to provide a service. These ranges could be different. One service center has a 10 mile range, one has a 15 mile range, etc. These ranges could overlap. I need to run a search to find out which service center's range a certain point falls into.

Right now I am doing this in code after loading item by computing the user's distance from the service center and throwing out results that are out of range. I would like to offload this to Lucene. Perhaps through the use of computed fields where each service center item can store a value representing its range's circle and then the seach would test to see if the current lat/lon point is within that circle.

I have a general plan, but I can't put it all together. Thanks in advance to anyone who can point me in the right direction.

Alex
  • 855
  • 7
  • 11
  • 1
    Have you looked at this yet? http://www.sitecorecoding.com/2014/11/Sitecore-ContentSearch-With-Spatial-Search.html. When performing the withinradius query you could get the radius to be dynamic by adding a radius field to the search POCO. – Ian Graham Apr 06 '16 at 21:05
  • @IanGraham I did look at that, but the problem is that the radius that I'm interested in is unique to each of the searchable items. Imagine a Venn diagram on a Cartesian plane, the circles are all of varying sizes. Those circles represent the effective ranges of the service centers. As a user I have a single point, and I want to know which circle(s) I am covered by. – Alex Apr 07 '16 at 13:11
  • yep I know. But it might work (or you could extend it if it doesn't to make the Radius a property on your POCO) so the search will try to examine the lat long with each radius in the index. – Ian Graham Apr 07 '16 at 13:42

0 Answers0