0

I would like to make the following query, but am struggling with it syntactically:

var query = session.Advanced.LuceneQuery<Object,IndexDefinition>().WithinRadiusOf(doc.MaxRadius,latitude,longitude).Where(x => x.StringProperty.Contains("xxx"));

The crux of this is that "doc.MaxRadius" is a property on the indexed documents. I'd like to avoid iterating the results, but's it's looking like I'll have to query on the "Contains" filter, then do so. Has anyone been able to accomplish a query of this nature?

Josh Wheelock
  • 369
  • 4
  • 9

1 Answers1

0

You cannot ask this question as stated. Instead of storing a radius, store a circle shape from the location, then you can call intersect on that.

Ayende Rahien
  • 22,925
  • 1
  • 36
  • 41
  • Brilliant! I missed that in the documentation. I'm trying it out now. – Josh Wheelock Nov 23 '14 at 11:43
  • I am attempting to implement your suggestion, but am unable to index properly. The index is throwing an error message "System.IndexOutOfRangeException: Index was outside the bounds of the array." after calling Spatial4n.Core.Io.ShapeWriter.ReadStandardShape(). My indexing assignment looks like this: __ = SpatialGenerate("WorkingRadiusShape","Circle("+doc.Latitude.ToString()+","+doc.Longitude.ToString()+",d="+doc.WorkingRadius.ToString() + ")",SpatialSearchStrategy.GeohashPrefixTree,12). Can you see what I'm doing wrong. The documentation does not show a matching example. – Josh Wheelock Nov 23 '14 at 13:10