RavenDB - How to can one make a WithinRadiusOf(radius,lat,lng) query where radius is a document property?

114 views Asked by At

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?

1

There are 1 answers

2
Ayende Rahien On BEST ANSWER

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.