Using FindTask to access feature attributes
You can use FindTask to search a map service exposed by the ArcGIS Server REST API for a string value. The search can be conducted on a single field of a single layer, on many fields of a layer, or on many fields of many layers. As with the other tasks we've examined, the find operation relies upon complementary objects: FindParameters, FindTask, and FindResult. FindParameters serves as the input parameter object, which FindTask uses to accomplish its work, and FindResult contains the results returned by the task.
FindParameters
FindParameters is used to specify the search criteria for a find operation and includes a searchText property that is the text that will be searched for, along with properties that specify the fields and layers that will be searched. In addition, setting the returnGeometry property to true indicates that you want to return the geometry of the features that matched the find operation and this can be used to highlight the results...