Geocoder, max results sugestion

4281
8
Jump to solution
03-12-2015 12:12 PM
RichardMoussopo
Occasional Contributor III

When the auto-complete mode  is set to true, the default max propositions is limited to 5.

I am wondering if this is the default behavior.

is there a way to change that value to 15 for example?

GeocoderMaxResults.PNG

0 Kudos
1 Solution

Accepted Solutions
KellyHutchins
Esri Frequent Contributor

The World Geocoder, which is the default geocoder used by search, doesn't support specifying maxSuggestions. It will always return 5.   We'll add this info to the API Ref doc reference page.

View solution in original post

0 Kudos
8 Replies
ChrisSmith7
Frequent Contributor

According to the API reference, there doesn't seem to be a supported property. I dug in and found the requests in one of the Esri examples:

http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/suggest?f=json&text=chu%20Redland...

This returns the object with 5 recommendations based upon string "chu". According to this page:

Suggest: (ComplexCompleter)

There doesn't seem to be a way to do this, unless it's undocumented.

0 Kudos
ChrisSmith7
Frequent Contributor

Update:

I found the API reference regarding "suggest" for the geocoder:

ArcGIS REST API - Services and Data Types

I don't see anything mentioned about configuring the number of autocomplete results... If it's not supported, maybe Esri can add it?

0 Kudos
RichardMoussopo
Occasional Contributor III

Hi Chris,

Yes I did look through the API as well with no luck. So, I posted this manner as an idea at ArcGIS Idea - Geocode Service Max Results Suggest . We can all go support it and hopefully, ESRI will take it to consideration. I think it will be great if we can control the suggestions results...

0 Kudos
ChrisSergent
Regular Contributor III

It looks like you would use maxLocations under properties in the API reference. maxLocations sets the Maximum number of locations to display in the results menu. -  Geocoder | API Reference | ArcGIS API for JavaScript

0 Kudos
ChrisSmith7
Frequent Contributor

That was my initial thought, too, but when I tried adjusting the property in one of Esri's sandboxes (ArcGIS API for JavaScript Sandbox), it didn't appear to do anything.

The following thread appears to explain why:

Java API Geocoder Autocomplete max results limit

0 Kudos
ChrisSergent
Regular Contributor III

I see that, but even with autocomplete turned on, the maxLocation property has a default of 6, I wonder if it's a bug. Kelly Hutchins​?

0 Kudos
ChrisSergent
Regular Contributor III

Also in the sample, the screenshot displays 6 addresses, but the when it runs, it displays 5. Makes me think it's a bug: Geocoder widget | Guide | ArcGIS API for JavaScript

0 Kudos
KellyHutchins
Esri Frequent Contributor

The World Geocoder, which is the default geocoder used by search, doesn't support specifying maxSuggestions. It will always return 5.   We'll add this info to the API Ref doc reference page.

0 Kudos