The new DistanceSortField does not work when used with MaxResults set to something smaller than the number of documents stored.
The error is easy to reproduce, just add the following to the org.hibernate.search.test.jpa.SpatialQueringJPATest in module hibernate-search-orm
In hibernate-search-orm run it with mvn -Dtest=SpatialQueringJPATest test
Java 7, Hibernate 4.1.7, MySQL
Thank you for the great work
I have re submitted the pull request with usage of lucene own IntToDoubleMap.
It shall be more efficient in memory usage and speed.