pelias / pelias/query

`StructuredFallbackQuery` scoring of `venue` queries.

Open
#136 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
13
Forks
31
PR merge metrics
No merged PRs in 30d

Description

When specifying the venue param for /v1/search/structured (ie. when searching for a POI), additional information, such as the postcode and street fields are not considered for scoring.

https://github.com/pelias/query/blob/a730d26fabddb41119eae7b918374621817b2a35/layout/StructuredFallbackQuery.js#L166

This results in POI results being returned in insertion order rather than better matches being shown first.

Examples:

The second result matches the postalcode 6011, yet is displayed second:

Screenshot 2024-04-16 at 17 02 48 Screenshot 2024-04-16 at 17 02 53

Adding the address information of the second result returns only address layer results:

Screenshot 2024-04-16 at 17 05 16 Screenshot 2024-04-16 at 17 05 23

Manually specifying layers=venue shows the same results as the original query (incorrectly ordered):

Screenshot 2024-04-16 at 17 05 59 Screenshot 2024-04-16 at 17 06 04

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 by reproducing the venue query through the /v1/search/structured entry point, using the postcode and street examples from the issue. Then inspect layout/StructuredFallbackQuery.js around line 166 to trace which fields contribute to scoring. Done means venue results use the additional address information so better postcode and street matches rank ahead of insertion order.

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
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.