converting JSONArray into string in order not to get ClassCastException while saving json file into ES