val game = Map(
"media_type"->"game",
"title" -> "FF VI",
"year" -> "1994")
val book = Map("media_type" -> "book","title" -> "Harry Potter","year" -> "2010")
val cd = Map("media_type" -> "music","title" -> "Surfing With The Alien")
sc.makeRDD(Seq(game, book, cd)).saveToEs("my-collection-{media_type}/doc")
String json1 = "{"reason" : "business","airport" : "SFO"}";
String json2 = "{"participants" : 5,"airport" : "OTP"}";
JavaSparkContext jsc = ...
JavaRDD<String> stringRDD = jsc.parallelize(ImmutableList.of(json1, json2));
JavaEsSpark.saveJsonToEs(stringRDD, "spark/json-trips");