I am using spark2.0 and using the spark session variable .trying to write some data into elastic search cluster installed in my local machine.code snippet is given below
spark.conf.set("es.index.auto.create", "true")
spark.conf.set("es.nodes", "127.0.0.1")
spark.conf.set("es.port", "9200")
val test = spark.createDataset(Seq(1,2))
EsSpark.saveToEs(test,"abc/def")
Last line is throwing a compilation error .Can some one suggest what is the correct way of calling the saveToEs method?