The layer doesn't appear in search widget.
Thanks in advance.
A FeatureLayer coming from a FeatureCollection has this limitation:
So you can not use it with the Search widget.
I don't know of any way other than to loop through the graphics and check for that attribute value. If the FeatureCollection is coming from a map service initially then you can run the query on map service and get the ObjectID of the result you want and then loop through the FeatureCollection to get that OID.
What I am basically doing is getting data from web service and than creating a feature layer using feature layer definition followed by populated that data as features. This is working fine.
Now I like to add that feature layer in search widget. I understand from your previous reply that it cannot be queried against the feature collection due to it limitation.
If I understood correctly, manually created feature layer cannot be added to search widget.