(因为ElasticSearch是restful请求所以 get post put delete这四种常见的请求)
put添加数据
get获取数据
#创建索引库lib 并且对索引库做了分片和备份(由于这里是单机的ElasticSearch备份0)
PUT /lib/
{"settings": {"index": {"number_of_shards":3,"number_of_replicas":0}}
}#不对创建的索引库设置,有没有默认值,当然有我们可以通过get请求查看索引库的设置
PUT lib2GET /lib/_settingsGET /lib2/_settingsGET /_all/_settingsPUT /lib/user/1
{"first_name":"Jane","last_name":"Smith","age":32,"about":"I like to collect rock albums","interests":["music"]
}
GET /lib/_settings
GET /lib2/_settings
我们没有为lib2设置分片和备份,默认5个分片,1份备份
GET /_all/_settings 查看所有索引库的设置
{"blog" : {"settings" : {"index" : {"creation_date" : "1583329166184","number_of_shards" : "5","number_of_replicas" : "1","uuid" : "81MUBVg2QIuEPfx4EUgewA","version" : {"created" : "6080699"},"provided_name" : "blog"}}},".kibana_task_manager" : {"settings" : {"index" : {"number_of_shards" : "1","auto_expand_replicas" : "0-1","provided_name" : ".kibana_task_manager","creation_date" : "1577929363433","number_of_replicas" : "0","uuid" : "HBrqPnnZTK2u9uR3kufo-Q","version" : {"created" : "6080699"}}}},"lib2" : {"settings" : {"index" : {"creation_date" : "1583416309156","number_of_shards" : "5","number_of_replicas" : "1","uuid" : "9Ta0EnpkQwya8BVgnzLxCQ","version" : {"created" : "6080699"},"provided_name" : "lib2"}}},"blog1" : {"settings" : {"index" : {"creation_date" : "1583330667393","number_of_shards" : "5","number_of_replicas" : "1","uuid" : "GbICx3zAQfGr1y9FdD4GKA","version" : {"created" : "6080699"},"provided_name" : "blog1"}}},"lib" : {"settings" : {"index" : {"creation_date" : "1583416264854","number_of_shards" : "3","number_of_replicas" : "0","uuid" : "xBd6M9IpQ7yJiaSby7mIJQ","version" : {"created" : "6080699"},"provided_name" : "lib"}}},".kibana_1" : {"settings" : {"index" : {"number_of_shards" : "1","auto_expand_replicas" : "0-1","provided_name" : ".kibana_1","creation_date" : "1577929369509","number_of_replicas" : "0","uuid" : "J0ZmfCI3TUidIX_i2qvTtQ","version" : {"created" : "6080699"}}}}
}