-
-
Notifications
You must be signed in to change notification settings - Fork 164
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
Fix for #1077, fail to search Saint..
cities in structured queries
#1080
Conversation
Hey @Joxit, If you have a chance, can you test how some of the cases listed here work after your change? If not, we'll hopefully be able to get to it within the next couple weeks. |
Hi, Example with Before: GET v1/search/structured?locality=Saint Marys®ion=PA HTTP/1.1
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"bbox": [
-78.64852,
41.390487,
-78.419566,
41.523252
],
"features": [
{
"bbox": [
-78.64852,
41.390487,
-78.419566,
41.523252
],
"geometry": {
"coordinates": [
-78.534187,
41.459777
],
"type": "Point"
},
"properties": {
"accuracy": "centroid",
"confidence": 1,
"country": "United States",
"country_a": "USA",
"country_gid": "whosonfirst:country:85633793",
"county": "Elk County",
"county_gid": "whosonfirst:county:102081265",
"gid": "whosonfirst:locality:101716717",
"id": "101716717",
"label": "St. Marys, PA, USA",
"layer": "locality",
"localadmin": "St. Marys",
"localadmin_gid": "whosonfirst:localadmin:404486717",
"locality": "St. Marys",
"locality_gid": "whosonfirst:locality:101716717",
"match_type": "exact",
"name": "St. Marys",
"region": "Pennsylvania",
"region_a": "PA",
"region_gid": "whosonfirst:region:85688481",
"source": "whosonfirst",
"source_id": "101716717"
},
"type": "Feature"
}
],
"geocoding": {
"attribution": "http://places.jawg.io/v1/attribution",
"engine": {
"author": "Mapzen",
"name": "Pelias",
"version": "1.0"
},
"query": {
"lang": {
"defaulted": true,
"iso6391": "en",
"iso6393": "eng",
"name": "English"
},
"parsed_text": {
"city": "st marys",
"state": "PA"
},
"private": false,
"querySize": 20,
"size": 10
},
"timestamp": 1517309617785,
"version": "0.2"
},
"type": "FeatureCollection"
} After: GET v1/search/structured?locality=Saint Marys®ion=PA HTTP/1.1
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"bbox": [
-78.56086,
40.04178,
-75.34074,
41.45747
],
"features": [
{
"geometry": {
"coordinates": [
-78.56086,
41.42784
],
"type": "Point"
},
"properties": {
"accuracy": "centroid",
"confidence": 1,
"country": "United States",
"country_a": "USA",
"country_gid": "whosonfirst:country:85633793",
"county": "Elk County",
"county_gid": "whosonfirst:county:102081265",
"gid": "geonames:locality:5210117",
"id": "5210117",
"label": "Saint Marys, PA, USA",
"layer": "locality",
"localadmin": "St. Marys",
"localadmin_gid": "whosonfirst:localadmin:404486717",
"locality": "Saint Marys",
"locality_gid": "geonames:locality:5210117",
"match_type": "exact",
"name": "Saint Marys",
"region": "Pennsylvania",
"region_a": "PA",
"region_gid": "whosonfirst:region:85688481",
"source": "geonames",
"source_id": "5210117"
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
-78.53418,
41.45747
],
"type": "Point"
},
"properties": {
"accuracy": "centroid",
"confidence": 1,
"country": "United States",
"country_a": "USA",
"country_gid": "whosonfirst:country:85633793",
"county": "Elk County",
"county_gid": "whosonfirst:county:102081265",
"gid": "geonames:locality:5210217",
"id": "5210217",
"label": "City of Saint Marys, PA, USA",
"layer": "locality",
"localadmin": "St. Marys",
"localadmin_gid": "whosonfirst:localadmin:404486717",
"locality": "City of Saint Marys",
"locality_gid": "geonames:locality:5210217",
"match_type": "exact",
"name": "City of Saint Marys",
"region": "Pennsylvania",
"region_a": "PA",
"region_gid": "whosonfirst:region:85688481",
"source": "geonames",
"source_id": "5210217"
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
-75.34074,
40.04178
],
"type": "Point"
},
"properties": {
"accuracy": "centroid",
"confidence": 1,
"country": "United States",
"country_a": "USA",
"country_gid": "whosonfirst:country:85633793",
"county": "Delaware County",
"county_gid": "whosonfirst:county:102080913",
"gid": "geonames:locality:5210213",
"id": "5210213",
"label": "Saint Marys Seminary, PA, USA",
"layer": "locality",
"localadmin": "Radnor",
"localadmin_gid": "whosonfirst:localadmin:404486571",
"locality": "Saint Marys Seminary",
"locality_gid": "geonames:locality:5210213",
"match_type": "exact",
"name": "Saint Marys Seminary",
"region": "Pennsylvania",
"region_a": "PA",
"region_gid": "whosonfirst:region:85688481",
"source": "geonames",
"source_id": "5210213"
},
"type": "Feature"
}
],
"geocoding": {
"attribution": "http://places.jawg.io/v1/attribution",
"engine": {
"author": "Mapzen",
"name": "Pelias",
"version": "1.0"
},
"query": {
"lang": {
"defaulted": true,
"iso6391": "en",
"iso6393": "eng",
"name": "English"
},
"parsed_text": {
"city": "saint marys",
"state": "PA"
},
"private": false,
"querySize": 20,
"size": 10
},
"timestamp": 1517309648187,
"version": "0.2"
},
"type": "FeatureCollection"
} The query match GeoNames instead of Who's On First because in GN datas it's Saint-Marys and in WOF it's St. Marys... This simplification should perhaps be done in imports instead of API? |
This PR is linked to pelias/schema#268 With these changes, all these queries work properly :
|
It's great to see all those improvements. This change doesn't result in any regressions in our acceptance test suite, so it looks good to merge! As for your earlier comment about how this could ideally be handled in WOF, I agree, so I looked into things. Most of these records already have the abbreviations expanded as alternate names. For example St Mary's PA: That means Placeholder is already aware of these alternate names. However, the structured endpoint doesn't user Placeholder yet. So, this is a great short term fix. In the long term, Placeholder can help fix this issue and many more like it. Thanks for all the work that went into this :) |
Hi again, |
Hi, thanks :) |
Fixes #1077