[SERVER-856] Geospatial result paging fails when sorting with additional keys Created: 31/Mar/10 Updated: 04/Dec/15 Resolved: 04/Dec/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | 1.4.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Timbo White | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 13 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Linux 32 bit |
||
| Issue Links: |
|
||||||||
| Participants: | |||||||||
| Description |
|
Using limit() and skip() to page result sets yields unexpected results when utilizing geospatial querying and an additional sort key. Objects are not correctly sorted per the additional sort key, and some of the same objects appear in subsequent result sets. To reproduce:
|
| Comments |
| Comment by David Storch [ 04/Dec/15 ] | ||||||||||||||||||
|
Looks like this is fixed in 3.0:
Closing as "Gone Away", since I haven't tracked down the exact change that fixed the bug. | ||||||||||||||||||
| Comment by Vladimir [ 19/Oct/12 ] | ||||||||||||||||||
|
rob jennings, the problem is that I need sort by distance and in addition result must be sorted with another one field. | ||||||||||||||||||
| Comment by rob jennings [ 18/Oct/12 ] | ||||||||||||||||||
|
Vladamir, as per the docs "$within can be used instead of $near to find items within a shape. Results are not sorted by distance, which may result in faster queries when this sorting is not required" It would greatly simplify things in my use case to page results of $near | ||||||||||||||||||
| Comment by Vladimir [ 09/Apr/12 ] | ||||||||||||||||||
|
Alex, is that possible to make sort by distance with $within query? I just want to combine distance sort with other fields. | ||||||||||||||||||
| Comment by Thiago D [ 15/Mar/12 ] | ||||||||||||||||||
|
Thank you, Alex. This solved my problem. | ||||||||||||||||||
| Comment by Alex Sharp [ 15/Mar/12 ] | ||||||||||||||||||
|
Our solution was to drop the use of $near and use $within: {$center: []} instead. | ||||||||||||||||||
| Comment by Tiziano [ 15/Mar/12 ] | ||||||||||||||||||
|
I've got the same issue... Is in plan to fix this? | ||||||||||||||||||
| Comment by Thiago D [ 04/Mar/12 ] | ||||||||||||||||||
|
We are experiencing it too, someone knows some way to workaround this? | ||||||||||||||||||
| Comment by Alex Sharp [ 02/Mar/12 ] | ||||||||||||||||||
|
We're experiencing the exact same issue. Can anyone comment on this, and if it's a priority? Seems like a pretty major bug. |