How can I restrict the results from an on-premises SMP Locator to a certain country code?

3010
1
05-17-2016 08:43 AM
NiklasKöhn
Esri Contributor

I'm using an SMP Locator service as source for the Directions Widget search fields. On text input, the widget fires a "suggest" request to the Locator Service. So far so good. Now, I need to restrict the results to a certain country code.

Is there a way to enable my local SMP Locator to work with the countryCode parameter? Or is there another way I can restrict my results via some JS parameter?

1 Reply
NiklasKöhn
Esri Contributor

Addition: As a workaround, I'm using the "prefix" parameter on Search.sources, but the results don't strike me as very convincing.
Example: My SMP-Locator covers several European countries. Search string "edin" (no country restriction) gives back Edinburgh as 1st result, among other international results. Search string "GBR,edin" finds only results from Great Britain, but no Edinburgh. I get a lot of Edingthorpes and Edin Gate, which seem a lot less important.
I can imagine that this is a matter of how the address locators are organized within the composite locator, but still: I would expect to get the "European results" in that particular order with all but the GBR findings filtered out, because the Locator obviously recognizes "GBR" as a country code..

0 Kudos