Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autocomplete: cannot find place using its label #1395

Open
missinglink opened this issue Nov 21, 2019 · 7 comments
Open

autocomplete: cannot find place using its label #1395

missinglink opened this issue Nov 21, 2019 · 7 comments

Comments

@missinglink
Copy link
Member

missinglink commented Nov 21, 2019

the document openstreetmap:venue:node/3691534194 has the following label:

"label": "Koh Lanta, Gothenburg, Sweden"

however, when searching for the same record using this label no results are returned:

/v1/autocomplete?text=Koh Lanta, Gothenburg, Sweden
no features

it's not clear why this is the case, requires some investigation.

note: this works correctly for /v1/search

@Joxit Joxit pinned this issue Nov 22, 2019
@missinglink
Copy link
Member Author

@orangejulius this test case seems to be fixed by what you've current got running on the staging server:
https://pelias.github.io/compare/#/v1/autocomplete?text=Koh+Lanta%2C+Gothenburg%2C+Sweden&debug=1

Can you remind me what you changed which may have fixed this?

@orangejulius
Copy link
Member

This is the branch: https://github.com/pelias/api/tree/disable-parser

There are two notable changes: the first is removing most of the parser logic to always return subject (as a test), and second, some of the query logic is changed. The primary must query is changed from a match_phrase to a match, and then the match_phrase query is duplicated, as a should.

I believe that second change is something we should probably merge close to straight away, as it helps reduce overly strict requirements for matching. Removing the parser logic is probably too extreme, although we might look at effectively disabling it for very short inputs.

@vipyoung
Copy link

vipyoung commented Feb 15, 2021

@orangejulius thank you for hinting into the "disable-parser" branch.
Most of the geo-coding in Qatar is done by providing a venue name (e.g., Qatar Foundation | Al Nasr Tower | The Pearl | Villagio | etc.) and the search endpoint was unable to correctly resolve them because of the parser. I looked everywhere on how to disable it until I checked the branch you mentioned.
In case someone who uses the docker version of pelias needs to do the same, you can simply download this file https://github.com/pelias/api/blob/master/sanitizer/_text_pelias_parser.js and mount it as a volume under the api service in docker-compose.yml as follows:

volumes:
    - "./sanitizer/_text_pelias_parser.js:/home/pelias/sanitizer/_text_pelias_parser.js"

@meezaan
Copy link

meezaan commented Jan 12, 2023

Hi folks,

I seem to have a similar issue. I'm run the latest docker build, and for me autocomplete is always empty but search always works.

So, for instance, v1/search?text=london returns a lot of results, but v1/autocomplete?text=london returns nothing.

I've just checked the logs now before pressing submit, and it appears that the autocomplete endpoint is unable to connect to elastic search, but the search one works just fine. For autocomplete I can see the following in the logs:

Elasticsearch WARNING: 2023-01-12T06:10:37Z
  Unable to revive connection: http://elasticsearch:9200/

Elasticsearch WARNING: 2023-01-12T06:10:37Z
  No living connections

Which is strange. I'll have a look at the setup and post back.

@meezaan
Copy link

meezaan commented Jan 12, 2023

I don't see anything odd in my docker compose file. And obviously the search endpoint from the api container can connect just fine to the elastic endpoint, but the autocomplete one cannot, so it must be somewhere in the code?

@missinglink
Copy link
Member Author

Hi @meezaan, you issue is different from the one mentioned.

Can you please open a new issue and post your pelias.json file.

@meezaan
Copy link

meezaan commented Jan 13, 2023

Thanks @missinglink. I may have found the problem, but if I have not I'll open another issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants