df.write.format('org.elasticsearch.spark.sql') \
.option('es.nodes', '10.0.0.0') \
.option('es.port', '9200') \
.option('es.resource', 'test/nested_type') \
.option('es.mapping.id', 'id') \
.option('es.write.operation', 'update') \
.option('es.update.script.inline', "if(ctx._source.containsKey('hphm')){if(!ctx._source.hphm.contains('2222')){ctx._source.hphm.add('2222')}}") \
.save(mode='append')
参数列表:
https://www.elastic.co/guide/en/elasticsearch/hadoop/current/configuration.html