Why is my search widget so slow? it takes about 5 seconds, sometimes more to return suggestions even thought the service has the capability support pagination to true.
here is the code:
  var searchAddress = new Search({
                    enableButtonMode: false,
                    enableLabel: false,
                    enableInfoWindow: true,
                    showInfoWindowOnSelect: true,
                    map: map
                }, "adrSearch");
                var sourcesAddr = []; //search.get("sources");
                sourcesAddr.push({
                    featureLayer: new FeatureLayer(".../AddressTypes/MapServer/0"),
                    searchFields: ["LSN"],
                    displayField: "LSN",
                    exactMatch: false,
                    name: "Address",
                    outFields: ["*"],
                    placeholder: "Search address",
                    maxResults: 25,
                    maxSuggestions: 25,
                    enableSuggestions: true,
                    minCharacters: 3
                });
                searchAddress.set("sources", sourcesAddr);
                searchAddress.startup();here is the snapshot of service capabilities:
Richard,
Do the fields that the search widget is using have indexes applied in ArcGIS. When you have a field in GIS that will be searched often, it is best practice to index that field in ArcCatalog.
Thank you Robert for your reply, I did add the index field in Arc Catalog,
the waiting time did change a little bit, now down to about 3 seconds before showing suggestions.
I have about 66388 records. I am wondering if the number of rows has to do with this.
Richard,
I would say definitely the number of records/rows is in direct correlation to time taken for suggestions to be returned.