Select to view content in your preferred language

Geocode REST API suggestions biased toward "startswith"

265
0
12-14-2022 12:08 PM
russelldrown
New Contributor

I have implemented an application using the Geocode REST API Suggest + FindAddressCandidates capabilities to identify "places" anywhere in the world. The search is always filtered down to a single country.

Users need to locate a variety of "places", from addresses to cities to businesses to points of interest to tiny, remote villages, etc. In other words, the breadth of "places" makes it difficult to standardize or force users to enter search text in single, specific format.

I find that the suggestions are heavily biased towards, if not completely restricted to, the "startswith" text of the filter parameter that the user enters, rather than offering the option of searching as "contains" text. This forces users to choose the correct leading text to find what they are looking for, or to keep trying different options until they stumble upon the correct starting value.

In SQL terms, this would be equivalent to searching with a WHERE clause such LIKE 'pattern%', but it would be helpful to get results in a LIKE '%pattern%'.

A test of hundreds of single line search strings of the format "address + ',' + city + ',' +country" using the findAddressCandidates method directly could be geocoded with reasonable precision, but this same text when attempted through the Suggestions often required multiple attempts or failed entirely.

Is there some approach to tweak the parameters when constructing the API request to better achieve such results?  If not, this would be a useful feature to implement to improve the usability.

0 Replies