pelias / pelias/api

Autocomplete: Multi-lang search (based on user's lang)

Open
#1,296 19 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Transcription of https://github.com/pelias/api/issues/127#issuecomment-490002821

What is this for ?

We want Pelias to send responses to queries written in other languages than English.
For example, a Dutch looking for Parijs (Paris in Dutch) will get Parijs, Frankrijk.

What should we do ?

  • Use multi_match in autocomplete queries (done in #1300)
  • Should search in name.$LANG index with higher boost
  • Should search in name.default index with standard boost
  • Should search in name.en index as fallback with lower boost (when $LANG is not en)
  • Should return name.$LANG when available, default otherwise (done in #1301)
  • Found something for matching parent e.g Parijs, Frankrijk.

Some use cases

Text Lang Result Status
Parijs nl Parijs, Frankrijk (whosonfirst:locality:101751119 Paris) KO
Londre fr Londres, Angleterre, Royaume-Uni (whosonfirst:locality:101750367 London) KO
ブラジル ja ブラジル (whosonfirst:country:85633009 Brazil) OK

cc @mihneadb Have you started working on it ? I can take the task if you want 😄

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 from the autocomplete query and response handling in the Pelias API, then reproduce the listed Parijs and Londre cases using the language values shown. The completed checklist items are already covered by #1300 and #1301; done means resolving the remaining parent-matching case with the expected localized result.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, search
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.