I've got a very customized Search Widget in an ArcGIS JavaScript API app. I would like to have it configured so that "keyword" search results are not suggested in autosuggest. For example, if I type "Piz", I don't want to see "Pizza" as an option.
I'm okay with most other categories of results, although I might wish to filter results further.
I've currently got my searchWidget configured like so:
const searchWidget = new Search({
includeDefaultSources: false,
maxSuggestions: 5,
minSuggestCharacters: 2,
popupEnabled: false,
sources: [
{
apiKey: ourAPIKey,
filter: { geometry: bufferExtent},
locator: new LocatorSearchSource({
categories: ["Point Address"], //or whatever I want
url: "https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer", // default
}),
name: "ArcGIS World Geocoding Service",
},
...layerSources.filter((l) => l !== null), // other custom layer sources
],
view: this.props.view,
});
//... some stuff
const suggestions = await searchWidget.suggest("piz");But this seems to have no effect. I've had this problem at 4.20, tried at 4.23 no difference.
I was assuming that supplying a string list of categories from here to the LocatorSearchSource would do the trick but it seems not.
Anyone know what needs to be done?