Closed missinglink closed 2 years ago
I've added a second commit which removes the stable
module since stable sort has been available natively since node@12.
Note: the comparator is expected to return a finite number, I hunted for any cases where it might return a boolean and couldn't find any in the code, one in the tests, worth keeping an 👁️ out for.
acceptance tests look good, there was one regression:
/v1/search?sources=wof&text=Taman Taynton View, Malaysia
# previously
0) Taman Taynton View, Kuala Lumpur, Malaysia
1) Taman Taynton, Kuala Lumpur, Malaysia
# now
0) Taman Taynton, Kuala Lumpur, Malaysia
1) Taman Taynton View, Kuala Lumpur, Malaysia
This is due to the results being displayed in order returned from pelias/placeholder
.
I'm happy to merge this as-is, we can tackle the sorting order returned by placeholder in a subsequent PR.
this PR fixes a subtle sorting bug: https://github.com/pelias/sorting/pull/26
in particular, a user noted that the query
Acton, ME, USA
returned the result forMeeker County
above that ofMaine
, which is now resolved.