版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/weixin_42528266/article/details/102796160
简介:手把手进行索引的操作
curl -X PUT "localhost:9200/nba"
{
"acknowledged": true,
"shards_acknowledged": true,
"index": "nba"
}
curl -X GET "localhost:9200/nba"
{
"nba": {
"aliases": {},
"mappings": {},
"settings": {
"index": {
"creation_date": "1563078001824",
"number_of_shards": "1",
"number_of_replicas": "1",
"uuid": "P-kmcRGlRECcBxAI_8mgaw",
"version": {
"created": "7020099"
},
"provided_name": "nba"
}
}
}
}
curl -X DELETE "localhost:9200/nba"
{
"acknowledged": true
}
curl -x GET "localhost:9200/nba,cba"
{
"cba": {
"aliases": {},
"mappings": {},
"settings": {
"index": {
"creation_date": "1563078437245",
"number_of_shards": "1",
"number_of_replicas": "1",
"uuid": "3rGtXSv_QTK-GU_xHKRvmw",
"version": {
"created": "7020099"
},
"provided_name": "cba"
}
}
},
"nba": {
"aliases": {},
"mappings": {},
"settings": {
"index": {
"creation_date": "1563078431931",
"number_of_shards": "1",
"number_of_replicas": "1",
"uuid": "bP6CZH5jSTGlhrTDzlq0bw",
"version": {
"created": "7020099"
},
"provided_name": "nba"
}
}
}
}
curl -X GET "localhost:9200/_all"
{
"cba": {
"aliases": {},
"mappings": {},
"settings": {
"index": {
"creation_date": "1563078437245",
"number_of_shards": "1",
"number_of_replicas": "1",
"uuid": "3rGtXSv_QTK-GU_xHKRvmw",
"version": {
"created": "7020099"
},
"provided_name": "cba"
}
}
},
"nba": {
"aliases": {},
"mappings": {},
"settings": {
"index": {
"creation_date": "1563078431931",
"number_of_shards": "1",
"number_of_replicas": "1",
"uuid": "bP6CZH5jSTGlhrTDzlq0bw",
"version": {
"created": "7020099"
},
"provided_name": "nba"
}
}
}
}
curl -X GET "localhost:9200/_cat/indices?v"
health status index uuid pri rep docs.count
docs.deleted store.size pri.store.size
yellow open nba bP6CZH5jSTGlhrTDzlq0bw 1 1 0
0 230b 230b
yellow open cba 3rGtXSv_QTK-GU_xHKRvmw 1 1 0
0 230b 230b
curl -I "localhost:9200/nba"
200 ok
curl -X POST "localhost:9200/nba/_close"
{
"acknowledged": true,
"shards_acknowledged": true
}
curl -X POST "localhost:9200/nba/_open"
{
"acknowledged": true,
"shards_acknowledged": true
}