Hi,
currently we are using the SearchWidget with defaultSources enabled.
In our EnterprisePortal we have our own LocatorService.
As far as I understood the portal one is taken over arcgis.com-WorldLocator by simply setting the portalUrl in JS:
esriConfig.portalUrl = ...
Now we would like to district the search results to specific countries (DE + DK in my case).
I am not getting it to work.
Best guess I found is the LocatorSource to set the CountryCode.
https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html
Unfortunately there is no sample.
I tried to place it into the sources-array which also countains our Layers to search in.
Additionally I disabled to use defaultSearchSource.
Here is my current code:
const sources = await this.getSearchSourcesAsync(handles);
const sourceDE = new LocatorSearchSource();
sourceDE.countryCode = 'DE';
sources.push(sourceDE);
const searchWidget = new Search({
view: mapView,
includeDefaultSources: false,
locationEnabled: false,
sources,
container: this.elementRefSearch!.nativeElement
});
In the ExperienceBuilder its pretty easy to district on specific countries. It offers an option for that:

The LocatorSearchSource however only accepts a single country at once.
I hope there is an equivalent easy way to district the countries for the JS SearchWidget.