Not able to read from elasticsearch from spark?

using logstash i have ingested file into elastic search with index/type .. car/soldcars
now for practising i want to read that csv file from spark using scala code.

;val spark= SparkSession.builder.master("local").appName("ReadFromES")
.config("es.nodes", "localhost").config("es.port",9200).config("es.resoruces","car/soldcars")
.config("es.index.auto.create","true").getOrCreate()

val es_df=spark.read.format("org.elasticsearch.spark.sql")
}

what to do next ?

I'm not sure I understand your question. Once you have a dataframe object, you should be able to define your processing operations on it. Are you seeing a specific inability to connect to Elasticsearch?

Not sure if this is just a typo in your post, but that should be es.resource

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