简体   繁体   English

如何使用elasticsearch-spark在Elasticsearch中创建索引?

[英]How to create an index in Elasticsearch using elasticsearch-spark?

I want to create an index in Elasticsearch from my spark transformation. 我想从我的火花转换中在Elasticsearch中创建一个索引。 I wonder what is the best method to do it using the elasticsearch-spark library ? 我想知道使用elasticsearch-spark库的最佳方法是什么? Kind regards 亲切的问候

When writing to the elasticsearch it will create an index if not present 写入elasticsearch时,它将创建索引(如果不存在)

df.write
  .format("org.elasticsearch.spark.sql")
  .option("es.nodes.wan.only","true")
  .option("es.port","443")
  .option("es.nodes", esURL)
  .mode("Overwrite")
  .save("index/dogs")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM