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

How do I use this from Pelias API? #27

Closed
tuukka opened this issue Apr 17, 2019 · 8 comments
Closed

How do I use this from Pelias API? #27

tuukka opened this issue Apr 17, 2019 · 8 comments

Comments

@tuukka
Copy link

tuukka commented Apr 17, 2019

Hi! I'm able to see the transit stops in Elastic Search but not via Pelias API searches. Are there any instructions or examples of how to use it or what to look for in the API configuration?

For more context, I'm currently researching which of the various GTFS import modules I should deploy, and have yet to find one that works end-to-end.

@missinglink
Copy link
Member

Hi @Tukka, if you can see them in elasticsearch then that means the importer is working, so that's good news.
Could you please post one document from elasticsearch so I can see what properties it has?

One thing I would try first is to filter by source or layer, you should see the source and layer properties listed against the document in elasticsearch.

If that works for you then it would be helpful to post an example of the request you are sending to pelias/api and what response you are getting vs. what you're expecting to see.

@orangejulius
Copy link
Member

This was probably fixed by pelias/api#1316, before that the API did not actually know about all the possible source/layer options that might have been brought in by custom importers.

Let us know if this is still a problem.

@irbian
Copy link

irbian commented Dec 7, 2021

I´m too having this problem

I see the data on the elasticsearch, but when checked on the API with /api/v1/search?text=mystopname&layers=stops

I get

errors: [
"'stops' is an invalid layers parameter. Valid options: coarse,address,venue,street,country,macroregion,region,county,localadmin,locality,borough,neighbourhood,continent,empire,dependency,macrocounty,macrohood,microhood,disputed,postalcode,ocean,marinearea"
],

@missinglink
Copy link
Member

missinglink commented Dec 7, 2021

since pelias/config#127 Pelias will automatically discover all 'layers' and 'sources' from records which exist in elasticsearch.

please check that there is a document in your elasticsearch index which has the layer 'stops'.

If you're using the pelias/docker project there is a command named pelias elastic stats which can be used to query this information directly from elasticsearch.

Also worth checking all your Pelias code is relatively up-to-date (at least from this year).

If you're using the pelias/docker project there is a command named pelias compose pull which can be used to pull the latest docker images.

@irbian
Copy link

irbian commented Dec 7, 2021

If you're using the pelias/docker project there is a command named pelias elastic stats which can be used to query this information directly from elasticsearch.

This is very helpful :) this is what is showing:

       {
          "key" : "transit",
          "doc_count" : 26,
          "layers" : {
            "doc_count_error_upper_bound" : 0,
            "sum_other_doc_count" : 0,
            "buckets" : [
              {
                "key" : "stops",
                "doc_count" : 26
              }
            ]
          }
        }

If you're using the pelias/docker project there is a command named pelias compose pull which can be used to pull the latest docker images.

Yeah, I have been working recently with this, using pelias/docker

@missinglink
Copy link
Member

Okay then try setting api.targets.auto_discover to true in your pelias.json and restart the server.

@orangejulius
Copy link
Member

The other trick that might be relevant is you have to restart the API if you have imported custom data since it started. It only detects the custom sources and layers on startup.

pelias compose kill api && pelias compose up api should do it for you.

@irbian
Copy link

irbian commented Dec 7, 2021

What sorcery is this? it's working!

Okay then try setting api.targets.auto_discover to true in your pelias.json and restart the server.

This was already setted before (even when auto_discover default value is true iirc)

pelias compose kill api && pelias compose up api should do it for you.

What I don´t understand is that I´m sure I tried with a pelias compose down, pelias compose up before this. Maybe I didn´t do it this time but in a time before, with so much tests...

Thanks!

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

No branches or pull requests

4 participants