1.索引列表
curl -X GET "localhost:9200/_cat/indices?v"
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
green open tenmao_index_153915944934 Z6BV1VaMRc-tC-7IucJE2w 5 1 198444 0 40.9mb 20.4mb
条件过滤:_cat/indices?v&health=yellow
排序:_cat/indices?v&health=yellow&s=docs.count:desc
2.索引详细信息
curl -X GET "localhost:9200/chat_index_alias/_stats?pretty"
3.数据量
curl -X GET "localhost:9200/_cat/count/chat_index_alias?v&pretty"
4.新建索引
curl -X PUT "localhost:9200/my_index" -d '
{
"settings" : {
"index" : {
"number_of_shards" : 3,
"number_of_replicas" : 2
}
}
}'
5.删除索引
curl -X DELETE "localhost:9200/tenmao_index"
curl -X DELETE "localhost:9200/tenmao_index_1504520299944"
6.分词搜索
curl -X POST "localhost:9200/chat_index_alias/_search" -d '
{
"query": {
"match": {
"question": "吃饭了吗"
}
}
}'
7.完全匹配搜索
curl -X POST "localhost:9200/chat_index_alias/_search" -d '
{
"query": {
"match_phrase": {
"question": "你吃饭了"
}
}
}'
1.查看别名
curl -X GET "localhost:9200/_alias/chat_index_alias?pretty"
2.增加别名
curl -X PUT "localhost:9200/my_index/_alias/my_index_alias?pretty"
3.删除别名,一般纯删除别名使用的比较少,一般是别名重新绑定(删除和绑定为一个原子操作)
curl -X POST 'http://localhost:9200/_aliases' -d '{ "actions": [ {"remove": {"index": "my_index", "alias": "my_index_alias"}} ]}'
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。