Location range filter in NEST?

How can I apply a geo-range filter with NEST? It seems like something

var results = client.Search<MyDataType>(s => s .Filter(m => m.GeoDistance(c => c.Location, f => f.Distance(100, GeoUnit.mi))); 

but how to get to the long / lat target location?

(a similar question was asked for the Java client)

+8
elasticsearch nest
source share
1 answer

Answering my question. It works:

 var results = client.Search<MyDataType>(s => s .Filter(m => m.GeoDistance( c => c.Location, f => f.Distance("100 mi").Location(40.7, -74.0))); 

After some debugging, I suspect that f.Distance(100, GeoUnit.mi) not working due to an error in NEST.

+7
source share

All Articles