Skip to content

Commit

Permalink
Apply limit on top of cursor
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Roitman committed Oct 31, 2017
1 parent 4eca0cd commit 1084c60
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion controller/search.go
Expand Up @@ -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 {
Expand Down

0 comments on commit 1084c60

Please sign in to comment.