pelias / pelias/api

Wrong field in admin_multi_match_first query

Open
#1,497 0 comments 0 reactions 1 assignee View on GitHub

@Joxit is already working on this.

Since Oct 16, 2020.

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

Description

Describe the bug

Heeeeey @Joxit

I was investigating a bug report today and I noticed something on our dev server which looks incorrect:
https://pelias.github.io/compare/#/v1/autocomplete?lang=de&text=Am+Gro%C3%9Fhausberg%2C+Furtwangen+im+Schwarzwald+deut&debug=1

Dev server is running a newer master branch than the production server.

Screenshot 2020-10-16 at 11 51 25

The screenshot shows it's using phrase.default but name.de, is that possibly due to this PR?
I would expect to see phrase.default and phrase.de.

Originally posted by @missinglink in https://github.com/pelias/api/pull/1493#issuecomment-709947256

Expected behavior

We should use the phrase.{lang} field instead of name.{lang}.

Additional context

Here is where we update the name.default field to phrase.default:

https://github.com/pelias/api/blob/5d202c48c0753f34f3401bd0c451449d53cf1e6b/query/view/admin_multi_match_first.js#L32-L37

The lang from clean is not available in this function... We may add a new property lang in the view ?

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.