Delete index from elasticsearch thru spark scala code

I am creating a spark object which contains the stats of a table and writing into elasticsearch
val cases_count_stats = spark.sql("select col2,count(*) from table group by col2"
cases_count_stats.saveToEs("abc/def")

How do I delete the index everything before I create it ?

Elasticsearch for Apache Spark supports the OVERWRITE save mode from Spark's data source api. Could use that.

1 Like

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