Spark sql insert json dataframe into elastic search

I've looked at the guide section for using spark SQL dataframe/dataset to insert json data into elastic search, but the section "Writing existing JSON to ElasticSearch" tells you to use sql load method, which gets data FROM elasticsearch to populate a dataframe in spark.

Link to section I am referring to:
https://www.elastic.co/guide/en/elasticsearch/hadoop/current/spark.html#spark-sql-json

I have spark log data and load that into a spark dataframe. I want to use elastic search spark library to bulk load that into elastic search. The closest I can get so far is pre aggregating the json data myself using spark and running dataframe.saveToEs("spark/.logs").

If I have val df = sqlContext.read.json("hdfs path")
I should be able to use the json schema as it has been worked out already.

What json save to Es method can I use?

Thanks,
Alistair

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.