{"action":"created","issue":{"url":"https://api.github.com/repos/OpenRefine/OpenRefine/issues/1063","labels_url":"https://api.github.com/repos/OpenRefine/OpenRefine/issues/1063/labels{/name}","comments_url":"https://api.github.com/repos/OpenRefine/OpenRefine/issues/1063/comments","events_url":"https://api.github.com/repos/OpenRefine/OpenRefine/issues/1063/events","html_url":"https://github.com/OpenRefine/OpenRefine/issues/1063","id":104966492,"number":1063,"title":"Reconciliation results are not sorted by score","user":{"login":"joewiz","id":59118,"avatar_url":"https://avatars.githubusercontent.com/u/59118?v=3","gravatar_id":"","url":"https://api.github.com/users/joewiz","html_url":"https://github.com/joewiz","followers_url":"https://api.github.com/users/joewiz/followers","following_url":"https://api.github.com/users/joewiz/following{/other_user}","gists_url":"https://api.github.com/users/joewiz/gists{/gist_id}","starred_url":"https://api.github.com/users/joewiz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joewiz/subscriptions","organizations_url":"https://api.github.com/users/joewiz/orgs","repos_url":"https://api.github.com/users/joewiz/repos","events_url":"https://api.github.com/users/joewiz/events{/privacy}","received_events_url":"https://api.github.com/users/joewiz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/OpenRefine/OpenRefine/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-04T20:44:59Z","updated_at":"2015-10-16T16:35:43Z","closed_at":"2015-10-16T16:35:43Z","body":"In building my own reconciliation service, I noticed that OpenRefine displays the results in the order returned by the remote API, rather than sorting them by the score object. For example, a query for \"McCarthy, Joseph M.\" returns 3 results, which are displayed in the following order, even though the 3rd match has the highest score:\r\n\r\n```json\r\n{\"q0\": {\"result\": [\r\n    {\r\n        \"name\": \"McCarthy, Joseph R.\",\r\n        \"score\": 6.4928436,\r\n        \"type\": [\"person\"],\r\n        \"id\": \"6603\"\r\n    },\r\n    {\r\n        \"name\": \"McCarthy, Senator Joseph R.\",\r\n        \"score\": 6.4928436,\r\n        \"type\": [\"person\"],\r\n        \"id\": \"3558\"\r\n    },\r\n    {\r\n        \"name\": \"McCarthy, Joseph M.\",\r\n        \"score\": 11.757351,\r\n        \"type\": [\"person\"],\r\n        \"id\": \"6536\"\r\n    }\r\n]}}\r\n```\r\n\r\nOpenRefine should use the score value rather than the order of objects sent by the API (in particular since JSON lacks a notion of document ordering that either server or client can depend on).\r\n\r\n(I'm using 2.6RC1 with current versions of Mac OS X and Google Chrome.)"},"comment":{"url":"https://api.github.com/repos/OpenRefine/OpenRefine/issues/comments/148763137","html_url":"https://github.com/OpenRefine/OpenRefine/issues/1063#issuecomment-148763137","issue_url":"https://api.github.com/repos/OpenRefine/OpenRefine/issues/1063","id":148763137,"user":{"login":"tfmorris","id":82178,"avatar_url":"https://avatars.githubusercontent.com/u/82178?v=3","gravatar_id":"","url":"https://api.github.com/users/tfmorris","html_url":"https://github.com/tfmorris","followers_url":"https://api.github.com/users/tfmorris/followers","following_url":"https://api.github.com/users/tfmorris/following{/other_user}","gists_url":"https://api.github.com/users/tfmorris/gists{/gist_id}","starred_url":"https://api.github.com/users/tfmorris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tfmorris/subscriptions","organizations_url":"https://api.github.com/users/tfmorris/orgs","repos_url":"https://api.github.com/users/tfmorris/repos","events_url":"https://api.github.com/users/tfmorris/events{/privacy}","received_events_url":"https://api.github.com/users/tfmorris/received_events","type":"User","site_admin":false},"created_at":"2015-10-16T16:35:43Z","updated_at":"2015-10-16T16:35:43Z","body":"Your assertion that JSON arrays aren't ordered is incorrect. \r\n\r\nhttp://stackoverflow.com/questions/7214293/is-the-order-of-elements-in-a-json-list-maintained\r\n\r\nThe reconciliation service is already filtering and ranking the results.   It makes far more sense, at least to me, to order them correctly at that point, particularly since the reconciliation service presumably has the most information available as to what the correct order is."}}