pelias / pelias/api

Regression in Autocomplete sorting

Open
#1,327 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
259
Forks
168
Avg merge
6h 15m
Merged PRs (30d)
1

Description

I've just performed a full rebuild and update and I've found a regression in the ordering of autocomplete queries.

E.g. https://pelias.github.io/compare/#/v1/autocomplete%3Fboundary.country=AU&layers=locality%252Cpostalcode%252Clocaladmin%252Cregion%252Ccounty&text=hobart

This query is asking for results on the layers: locality, postalcode, localadmin, region, county
However only localities are being returned. The locality is the least broad layer in the list so I would have expected it to be last.

Removing it from the list gives this: https://pelias.github.io/compare/#/v1/autocomplete%3Fboundary.country=AU&layers=postalcode%252Clocaladmin%252Cregion%252Ccounty&text=hobart
Which is similar, now all we get is localadmin.

Removing localadmin and we finally get the Hobart county.
https://pelias.github.io/compare/#/v1/autocomplete%3Fboundary.country=AU&layers=county%252Cregion%252Cpostalcode&text=hobart

It's like the layer heirachy is upside down when sorting results with the most specific results first, not the broadest results first.

This was working correctly with my last update in April.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the autocomplete API entry point and reproduce the linked Hobart queries with different layer lists. Trace how layer hierarchy affects result sorting; done means requested layers are ordered from broadest to most specific, including when locality or localadmin is present, with regression coverage added if the project has an existing test location.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, search
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.