Updated search query to properly select latest version of results