pelias / pelias/api

should placeholder execute for admin queries which include a postalcode?

Open
#1,257 2 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 noticed that the query MIDLAND, MI, 48642, US does not only return results from MI.
Omitting the postcode will change the query to only returning MI results.

This is due to a predicate called placeholderGeodisambiguationShouldExecute which controls when we use placeholder and when we don't, and in this case, since there is a postcode present, we do not.

I'm wondering if we loosen this requirement and allow placeholder to execute for queries which are entirely admin area, and also which may or may not contain a postcode too.

I'm not sure if the current query approach has any benefit, as it's unlikely that the postcode matching subquery will provide enough boost to ensure that the MI results float to the top of the resultset.

The disadvantage of the current approach is that the results are fairly noisy and contain entries outside MI.

So there are two ways of looking at this:

  • Use placeholder for these type of queries
  • Adjust the scoring so that the MI subquery provides enough boost to score them at the top

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 placeholderGeodisambiguationShouldExecute predicate and reproduce the MIDLAND, MI, 48642, US query alongside the version without a postcode. Compare the placeholder and postcode-matching behavior, then determine which proposed direction—enabling placeholder or changing scoring—meets the expected result of keeping MI entries at the top without introducing noisy out-of-state results.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, backend, search
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.