Select to view content in your preferred language

suggest API is too literal even when searching in a location

203
3
09-04-2024 03:59 PM
Labels (1)
DanielDormont
Regular Contributor

Hi,

In my web application I'm using the suggest API to drive a search box for a map that I'm displaying (using Leaflet Geosearch but I don't think that matters here). Specifically, I'm trying to find some rural provincial roads in Alberta. Here's an example:

https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/suggest?f=json&text=township+rd+... 

This correctly gives me some results, one of which is the one I'm looking for:

https://veoci.maps.arcgis.com/apps/mapviewer/index.html?webmap=8ef6358285ee41868dfc2552390ead80

 

But if I simply change "rd" to "road" in my search term:

https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/suggest?f=json&text=township+roa...

 

I get results that are nowhere near what I want, even though I've supplied a "location" value. The really funny part is that "Road" is spelled out if you actually look at the basemap. It's only in the search that I need to abbreviate it to "Rd". But my users aren't going to know to do that. 

Is there a way to have the suggest API return correct results in my case? Thanks.

0 Kudos
3 Replies
Tyler_M
Esri Contributor

Hi @DanielDormont , I hope you are doing well!

 

I think this would be good information to submit to the Geocoding Feedback Web Map for our review: https://www.arcgis.com/home/item.html?id=b7d30c782d63401894b36a44e62f76a9 

(and also possibly the Basemap Feedback Web Map (https://www.arcgis.com/home/item.html?id=28450cb78b324aaeaadb751e92d16ae0) regarding the basemap portion!)

 

 

Thank you!

0 Kudos
DanielDormont
Regular Contributor

Hi @Tyler_M 

Thanks, I did that but looking again, I don't really see this as a problem with the feature data. The problem is really with the search. I would expect both "township rd 604" and "township road 604" to return this result in the suggest call. Is that not possible? The system doesn't know (or can't be told) that rd is a synonym for road?

 

Dan

0 Kudos
DanielDormont
Regular Contributor

In fact, here's another indication that this is really a search issue. If I use the `searchExtent` parameter instead of or in addition to `location`, I _do_ get the right result:

https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/suggest?f=json&text=township+roa...

 

So it seems that the search engine does correctly understand that "rd" and "road" are synonyms, but for some reason it is prioritizing results containing the exact text "road" even though they are far from the location given, over results containing the synonym text "rd" that are much closer.

 

Can this be fixed?

0 Kudos