I am trying to add my CSVLayer as a source for the Search widget, however, I've been unsuccessful. My Search widget searches addresses and I was able to add one of the sources from this example (https://developers.arcgis.com/javascript/jssamples/search_multiplesources.html) successfully, however my CSVLayer doesn't return any results in the Search widget.
Has anyone had any success or experience with adding a CSVLayer as a source for the Search widget in ArcGIS Javascript? Below is a code snippet...
var csv = new CSVLayer("file.csv", {
outFields: ["*"]
});
var search = new Search({
enableButtonMode: false,
enableLabel: false,
enableInfoWindow: true,
showInfoWindowOnSelect: false,
map: map
}, "search");
var sources = search.get("sources");
sources.push({
featureLayer: csv,
searchFields: ["Name"],
displayField: "Name",
exactMatch: false,
outFields: ["*"],
name: "Foo",
placeholder: "FooPlace",
maxResults: 6,
maxSuggestions: 6,
infoTemplate: template,
enableSuggestions: true,
minCharacters: 0
});
Could the issue be that my csv var is technically a CSVLayer and not a FeatureLayer?