Page MenuHomePhabricator

Special:Nearby has wrong sort order when searching by page
Closed, ResolvedPublic

Description

Compare https://en.wikipedia.org/wiki/Special:Nearby#/page/Empire_State_Building
to https://en.wikipedia.org/wiki/Special:Nearby#/coord/40.748433,-73.985656

When searching by coordinate the sort order is correct, but when searching by page the sorting is lost. It looks like searching by geocordinate is re-sorting after retrieving the pages from api, while by page is not. Because the api is being used as a generator the returned sort order is completely arbitrary.

Remaining work

  • Sort by index given by GeoData (thanks @MaxSem!) in Nearby special page

Event Timeline

Normal search deals with that here: https://github.com/wikimedia/mediawiki/blob/master/includes/api/ApiQuerySearch.php#L297-L299

Which allows the frontend to see the original sort order and re-sort the generator output. api maintainers identified too many edge cases to do that resort on the generator output

jhobs triaged this task as Medium priority.Jun 7 2016, 5:12 PM
jhobs moved this task from Incoming to Needs Prioritization on the Web-Team-Backlog board.

Change 293244 had a related patch set uploaded (by MaxSem):
Add index to results in generator mode

https://gerrit.wikimedia.org/r/293244

Change 293244 merged by jenkins-bot:
Add index to results in generator mode

https://gerrit.wikimedia.org/r/293244

jhobs updated the task description. (Show Details)
jhobs removed a project: Patch-For-Review.

sorting order looks fixed from max's patch.