change search suggestions text

3875
3
04-01-2016 03:13 AM
MassimilianoSantini
New Contributor

hi all

is possible to change the suggestion text returned from the Search widjet?
I'm using only Esri World GeocodeServer as locator that return string like "address, region, state"

like this:

{"suggestions":[{"text":"Roma, Latium, Italy","ma ....
Region and state doesn't mach my italian languages (WHY???) so I've decided to remove it.

How can I modify the suggestion text?

thanks

Massimiliano

0 Kudos
3 Replies
ChenLi2
New Contributor III

hi Massimiliano,

I think you could use category to filter your suggest result, for example:

http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/suggest?f=json&text=redlands&maxS...

You could check the link here for details about possible values for the category:

Category filtering—ArcGIS REST API: World Geocoding Service | ArcGIS for Developers

0 Kudos
MassimilianoSantini
New Contributor

Hi Chen,

thank for you answer but I badly explained my problem.

I already use the category "City" in my code:

sources.push({

                        locator: new Locator("//geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer"),

                        singleLineFieldName: "SingleLine",

                        categories: ["City"],                      

                        outFields: ["*"],

                        countryCode: "IT",

                        maxResults: 3,

                        maxSuggestions: 6,

                        minCharacters: 3,

                        placeholder: "Località/Comune/Via/CAP"

                    });

but the suggests I get are written in mixed languages.

Immagine.png

If I search for city "ROMA", I get, in the same suggest row, a text like this "ROMA, Latium, Italy".

Roma is in Italian, Latium, in English, Italy in English.

Is it possible to have all the three field in the same languge?

If not, is it possible to change/remove this field from the suggest?

Thanks again.,

Massimiliano

0 Kudos
MassimilianoSantini
New Contributor

no suggestions?

0 Kudos