It's best to switch to LatLonDocValuesField and use its newDistanceSort. These are new in 6.x, and in 6.2 there are some nice improvements.
Mike McCandless http://blog.mikemccandless.com On Tue, Aug 16, 2016 at 6:00 AM, Rolf Veen <rolf.v...@gmail.com> wrote: > Hi, all. > > I had a piece of code to create a 'near' SoftField like this: > > public SortField distanceSortField(double x, double y, IndexSearcher ix) > throws Exception { > Point pt = ctx.makePoint(x, y); > ValueSource valueSource = strategy.makeDistanceValueSource(pt, > DistanceUtils.DEG_TO_KM); > return valueSource.getSortField(false); > } > > > This does not work anymore due to refactoring in Lucene 6 and Spatial libs. > What would be the current approach to build a 'near' SortField in Lucene > 6.x, based on a GeoPointField ? > > Kind regards, > Rolf. >