update to search content function to deal with arrays and objects