I'm attempting to query a map service using the Search Widget (4.7). The widget works fine when selecting from one of the list of suggested values as I begin typing. When entering complete values (and hitting enter or the search icon), it returns "No Results", even when the value is valid. I tried publishing the same data to AGOL, to test if its an issue with the map service.. and sure enough all works well with a feature service.
Has anyone else experienced this?
Here's my code for reference:
var searchSources = [
{
featureLayer: {
url: "https://.../arcgis/rest/services/Public/ParcelsTest/MapServer/0"
},
searchFields: ["TAXLOT"],
displayField: "TAXLOT",
name: "Taxlot Search",
placeholder: "Enter Taxlot Number",
popupOpenOnSelect: true,
maxResults: 6,
maxSuggestions: 6,
suggestionsEnabled: true,
minSuggestCharacters: 5
}
]
Solved! Go to Solution.
Adam,
Does the service have the query capability and have the ObjectId and shape fields visible?
Adam,
Does the service have the query capability and have the ObjectId and shape fields visible?
Robert,
Yes the service has Data, Map and Query operations allowed.
The service has all fields visible. Your comment got me heading down the right path though. I added the outFields property to the search source object, and included the ObjectID and Shape fields...it works now! This feels like a hack, but glad its working.
Adam,
I wouldn't think of that as a hack. It is more of a requirement as the search needs to know which fields it will be working with.