手动指定: 从数据导入数据 操作:添加数据的时需要指定主键 IndexRequest index = new IndexRequest(); index.index("user"); index.id(user.getName()); 自动生成: 数据主要存储在es中