SparkSQL: How to specify custom ROUTING when writting to ES

This code is working fine for me
ES : 5.2
Spark: 1.6
es-hadoop: elasticsearch-spark-13_2.10...

val sc = new SparkContext(sparkConf)
val sqlContext = new org.apache.spark.sql.hive.HiveContext(sc)
val df = sqlContext.sql(sqlMov)
EsSparkSQL.saveToEs(df, conf.getString("s-app.persistenciaES"))

Now i want to distribute the data correctly on each shards...
How can i specify the "routing" option in my Spark code (with Scala) like this example:

curl -XPOST 'http://localhost:9200/store/order?routing=user123'

Please help! thanks.

@Eduardo_Curonisy You want the es.mapping.routing property.

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