Apply limit on top of cursor

This commit is contained in:
Alex Roitman 2017-10-31 09:48:17 -07:00
parent 4eca0cdee7
commit 1084c60805
1 changed files with 1 additions and 1 deletions

View File

@ -352,7 +352,7 @@ type iterItem struct {
}
func nearestNeighbors(sw *scanWriter, lat, lon float64, iter func(id string, o geojson.Object, fields []float64, dist *float64) bool) {
limit := int(sw.limit)
limit := int(sw.cursor + sw.limit)
var items []iterItem
sw.col.NearestNeighbors(lat, lon, func(id string, o geojson.Object, fields []float64) bool {
if _, ok := sw.fieldMatch(fields, o); ok {