UPDATE: I have run the chrome developer tools for the eSearch and it is returning with the error: "Cannot read property 'getLayerObject' of undefined" I do not know why it is undefined. I have defined it. So still not working and still don't know how to fix it.
I am using Web AppBuilder 2.0 via Portal 10.4 and for some layers my search and query keeps failing. When I perform a search, it will come back and say 'Search Failed !'. When I perform a query, results will appear in the attribute table and the query results window but no data can be displayed on the map. I click and click on the records but nothing happens. Each of the layers that are not working with the search and query can be individually added to the map and displayed as a layer. I have tried selecting the query layer as 'From the map', 'From Portal' and 'Service URL' but nothing works. I am not using any filter definitions and left the results settings on default.
All my layers are added as services on ArcGIS Server. One is a point layer and the other a polygon.
My Searches are set up as: