1、使用elasticsearch-head-master连接
打开目录下的index.html,输入连接ip和端口,有的需要输入用户名和密码。
http://ip:9200/?auth_user=?? &auth_password=??
2、使用postman工具连接
连接时用户名和密码填写的header中
将【username:password】进行base64编码,填入authorization对应的内容,前边加上Basic
使用post方式插入数据
Url 如下:ip:port/索引/_doc/id 如127.0.0.1:9200/location/_doc/20221648090640515001
注:如果不指定id,id会随机生成。
插入内容以body-json形式写入