美文网首页
ES的简单使用命令

ES的简单使用命令

作者: 你的努力时光不会辜负 | 来源:发表于2022-05-20 17:28 被阅读0次

curl -X GET http://10.1.10.1:9200/_cat/health?v
curl -X GET http://10.1.10.1:9200/_cat/indices?v
curl -X GET http://10.1.10.1:9200/_all

curl -H "Content-Type:application/json" -XPUT http://10.1.10.1:9200/my_new_index/user/1?pretty -d '{"name":"qa","age":"23"}'

curl -X DELETE http://10.1.10.1:9200/my_new_index
curl -X DELETE http://10.1.10.1:9200/kong01

curl -H "Content-Type:application/json" -XPUT http://10.1.10.1:9200/student_test

curl -H "Content-Type:application/json" -XPUT http://10.1.10.1:9200/student -d '{
"settings": {
"number_of_shards": 2,
"number_of_replicas": 2
}
}'

curl -H "Content-Type:application/json" -XPUT http://10.1.10.1:9200/teacher -d '{
"settings": {
"number_of_shards": 2,
"number_of_replicas": 2
},
"mappings":{
"properties":{
"id":{
"type":"integer"
},
"name":{
"type":"keyword"
},
"age":{
"type":"long"
},
"desc":{
"type":"text"
},
"birthday":{
"type":"date"
}
}
}
}'

curl -H "Content-Type:application/json" -XGET http://10.1.10.1:9200/teacher

curl -H "Content-Type:application/json" -XGET http://10.1.10.1:9200/_cat/indices

curl -H "Content-Type:application/json" -XGET http://10.1.10.1:9200/student_test/_count

curl -H "Content-Type:application/json" -XGET http://10.1.10.1:9200/_all/_count

curl -H "Content-Type:application/json" -XGET http://10.1.10.1:9200/_cat/indices?v&h=i,tm&s=tm:desc

curl -H "Content-Type:application/json" -XGET http://10.1.10.1:9200/_cat/indices?v&s=docs.count:desc

curl -H "Content-Type:application/json" -XGET http://10.1.10.1:9200/_cat/indices?v&health=green

curl -X DELETE http://10.1.10.1:9200/kong01

curl -H "Content-Type:application/json" -XPUT http://10.1.10.1:9200/teacher/_settings -d '{
"index":{
"number_of_replicas":4
}
}'

相关文章

网友评论

      本文标题:ES的简单使用命令

      本文链接:https://www.haomeiwen.com/subject/xagfprtx.html