参考这两篇文章:
https://www.bmc.com/blogs/spark-elasticsearch-hadoop/
https://blog.pythian.com/updating-elasticsearch-indexes-spark/
先在ES创建3个document
[mshuai@node1 ~]$ curl -XPUT --header 'Content-Type: application/json' http://your_ip:your_port/school/doc/1 -d '{ "school" : "SUSE" }'
[mshuai@node1 ~]$ curl -XPUT --header 'Content-Type: application/json' http://your_ip:your_port/school/doc/2 -d '{
"school" : "SCU"
}'
[mshuai@node1 ~]$ curl -XPUT --header 'Content-Type: application/json' http://your_ip:your_port/school/doc/3 -d '{
"school" : "Harvard"
}'