(1)简单方式
PUT test
{
"acknowledged": true,
"shards_acknowledged": true,
"index": "test"
}
(2)索引名不能包含大些字母
PUT Test
(3)重复创建
PUT test
(4)指定参数
PUT blog
{
"settings": {
"number_of_shards": 3,
"number_of_replicas": 1
}
}
{
"acknowledged": true,
"shards_acknowledged": true,
"index": "blog"
}
(1)查看指定索引的配置信息
GET blog/_settings
{
"blog": {
"settings": {
"index": {
"creation_date": "1515458969949",
"number_of_shards": "3",
"number_of_replicas": "1",
"uuid": "A7pKNO7bTgucu1uNgmXlQg",
"version": {
"created": "5060399" },
"provided_name": "blog"
}
}
}
}
(2)查看多个索引
GET test,blog/_settings
{
"test": {
"settings": {
"index": {
"creation_date": "1515460501267",
"number_of_shards": "5",
"number_of_replicas": "1",
"uuid": "FfVJ9w9bSxqyqvh7r1UL7w",
"version": {
"created": "5060399" },
"provided_name": "test"
}
}
},
"blog": {
"settings": {
"index": {
"creation_date": "1515459619703",
"number_of_shards": "3",
"number_of_replicas": "1",
"uuid": "6x9RQQ5KRoStK57T88VhmA",
"version": {
"created": "5060399" },
"provided_name": "blog"
}
}
}
}
DELETE test
{
"acknowledged": true
}
(1)关闭索引
POST blog/_close
{
"acknowledged": true
}
(2)尝试插入数据
PUT blog/article/1
{
"title":"test title"
}
index_closed_exception
(3)重新打开索引
POST blog/_open