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
Place returns venue version of record when address was requested #643
Comments
I'd like to note that the |
We have had other issues like this, such as the following query: In this case there is no Who's on First record with ID 123, but the underlying Elasticsearch query is searching for any record with ID 123, and finds a Geonames locality |
`/place` queries have been executing in a way where only the ID, but not the layer, has been considered when returning records from Elasticsearch. It turns out this bug was introduced almost a year and a half ago in #407. A little, relatively unimportant bit of code was looking for a property called `layers`: ``` const cmd = req.clean.ids.map( function(id) { return { _index: apiConfig.indexName, _type: id.layers, _id: id.id }; }); ``` The correct property was `layer`, so no filtering on layer was done in the resulting [mget](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-get.html) query. There was never an acceptance test for these sorts of queries, but there is now one in pelias/acceptance-tests#446 Fixes pelias/pelias#643
`/place` queries have been executing in a way where only the ID, but not the layer, has been considered when returning records from Elasticsearch. It turns out this bug was introduced almost a year and a half ago in #407. A little, relatively unimportant bit of code was looking for a property called `layers`: ``` const cmd = req.clean.ids.map( function(id) { return { _index: apiConfig.indexName, _type: id.layers, _id: id.id }; }); ``` The correct property was `layer`, so no filtering on layer was done in the resulting [mget](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-get.html) query. There was never an acceptance test for these sorts of queries, but there is now one in pelias/acceptance-tests#446. The unit tests were enforcing the incorrect behavior. Fixes pelias/pelias#643
We should have a fix for the originally reported issue in pelias/api#1036. The issue I reported is actually a different one, and is being discussed over in #672. |
`/place` queries have been executing in a way where only the ID, but not the layer, has been considered when returning records from Elasticsearch. It turns out this bug was introduced almost a year and a half ago in #407. A little, relatively unimportant bit of code was looking for a property called `layers`: ``` const cmd = req.clean.ids.map( function(id) { return { _index: apiConfig.indexName, _type: id.layers, _id: id.id }; }); ``` The correct property was `layer`, so no filtering on layer was done in the resulting [mget](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-get.html) query. There was never an acceptance test for these sorts of queries, but there is now one in pelias/acceptance-tests#446. The unit tests were enforcing the incorrect behavior. Fixes pelias/pelias#643
Here's what I did 😇
This came in through support (see Desk 980)
http://pelias.github.io/compare/#/v1/autocomplete%3Ftext=Hansaring
http://pelias.github.io/compare/#/v1/place%3Fids=openstreetmap:address:node:2420772655
Here's what I got 🙀
Properties from autocomplete:
Then, take this gid openstreetmap:address:node:2420772655 and do a place search:
Here's what I was expecting ✨
Expecting the osm:address record to be returned and not the venue version.
When you do place with openstreetmap:venue:node:2420772655, the venue record comes back.
Here's what I think could be improved 🏆
Behind the scenes, this is finding a record from OSM that is originally a venue that also contains a full address.
In those cases, we create two records, one in the address layer without venue name and the other in venue layer with all the information.
The place endpoint should not be returning the venue version of the record when address has been requested.
(thanks to @dianashk for explanation about the two records)
The text was updated successfully, but these errors were encountered: