生产环境建议用curl来调用elasticsearch的restful接口来创建索引,每个索引的index脚本,mapping的脚本都提前写好提到git上打包,部署的时候直接通过curl执行
开发环境随便怎么执行都可以,用java调用jest接口创建index和mapping也行