Open Aleksio opened 9 years ago
hi @Aleksio, it is not possible to query any kind of osm tag, just the one that got considered by nominatim. For example, this query works: http://photon.komoot.de/api?q=berlin&osm_tag=place:city
Can you see the osm_tag
and osm_value
field of the response. That are the attributes where the filter apply.
Thanks for the quick reply, I merely looked at the list provided here: https://github.com/openstreetmap/osm2pgsql/blob/master/output-gazetteer.cpp#L81
Is it in any way possible to filter results by country(code), so we can provide means to our users to get more accurate results? Or is such feature planned in the future?
we haven't planned to implement such a feature yet. do you always want german results only? you could simple delete all non german items from the index, queries can only return german items then.
Unfortunately not, that was only for example. The usage is international, so being able to filter by country code would be ideal.
I would be nice to have this feature done
Hello, does anyone has a quick elastic query for deleting whole countries from elastic photon indice?
I used following query and after that fired also
curl -XPUT 'http://localhost:9200/photon/_settings?preserve_existing=true' -d '{ index.merge.policy.expunge_deletes_allowed" : "0" }'
and
curl -X POST "localhost:9200/photon/_forcemerge?only_expunge_deletes"
to purge index.
curl -X POST "http://localhost:9200/photon/place/_delete_by_query?pretty" -H 'Content-Type: application/json' -d' { "query": { "bool": { "must": { "match": { "collector.en.raw": { "query": "Afghanistan, Albania, Algeria", "operator": "or", "analyzer": "index_raw" } } } } } }'
How would I delete all elastic photon indices EXCEPT one country? IE: everything BUT Canada ?
@expressIndustries Try to us instead of "must" a "must_not" delete query.
Ok. thanks. Working on getting a USA only photon database up and running with TIGER street addresses...but having trouble getting TIGER data to load into Nominatim. Nothing happens when I run the import command: no errors are thrown and no new tables or indexes are created in nominatim database. Stumped at the moment.
Curious if loading the graphopper DB and then removing all other countries except USA using Elasticsearch query would be similar result as trying to load all US States from Geographik and then load TIGER. Any idea?
Your comment is off-topic for this ticket. For questions about installation and use of photon please use [the mailing list])(https://lists.openstreetmap.org/listinfo/photon).
this would be truly wonderful to have such option
Where is the accurate list for the supported tags and values? The one provided in the readme.md (https://github.com/openstreetmap/osm2pgsql/blob/master/output-gazetteer.cpp#L81) doesn't seem to work anymore
👍
Where is the accurate list for the supported tags and values? The one provided in the readme.md (https://github.com/openstreetmap/osm2pgsql/blob/master/output-gazetteer.cpp#L81) doesn't seem to work anymore
I'm finding it similarly difficult to figure out what tags and values are supported. I would also like to filter the results by country code (or even by the state
key on the returned JSON object) but it doesn't seem that this is possible.
Indeed, would be a very helpful feature. Hope it will be implemented someday. Thanks for the Photon project anyway.
IMO there's two ways this could be implemented: Either have something similar to Nominatim's countrycodes parameter, or a generalized filter that works for everything in the "properties" node (or even the "geography" node) that the API responds with.
The former would probably be easier to implement, while the latter offers more flexibility.
I'm trying to filter the search results by country code, but can't seem to do so. The readme states I can use the nominatim source as reference, and that includes country_code but I can't get it to work.
Is it actually supported? Or is the query incorrect?
http://photon.komoot.de/api?q=berlin&osm_tag=country_code:DE http://photon.komoot.de/api?q=berlin&osm_tag=country:DE