Elasticsearch常用脚本,elasticsearch脚本
1、检测集群是否健康。 确保9200端口号可用
GET http://192.168.251.7:9200/_cat/health?v
curl http://192.168.251.7:9200/_cat/health?v
2、获取集群的节点列表
GET http://192.168.250.101:9200/_cat/nodes?v
3、列出所有索引
GET http://192.168.251.7:9200/_cat/indices?v
4、添加索引
在管理平台手动添加
5、添加文档
PUT http://192.168.250.101:9200/telnum_fee_index/_mapping/telnum_fee_type
{
"properties": {
"id": {
"type": "keyword"
},
"enterpriseCode": {
"type": "keyword"
},
"createTime": {
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis",
"type": "date"
},
"price": {
"type": "double"
},
"fee": {
"type": "double"
},
"num": {
"type": "integer"
},
"servicerName": {
"type": "keyword"
},
"servicerId": {
"type": "keyword"
},
"startTime": {
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis",
"type": "date"
},
"updateTime": {
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis",
"type": "date"
},
"endTime": {
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis",
"type": "date"
},
"enterpriseName": {
"type": "keyword"
}
}
}
6、index追加字段
PUT http://192.168.251.7:9200/call_record_index/_mapping/call_record_type
|
7、设置ES最大每页数据
PUT
http://192.168.250.101:9200/telnum_fee_index/_settings
|
本站文章为和通数据库网友分享或者投稿,欢迎任何形式的转载,但请务必注明出处.
同时文章内容如有侵犯了您的权益,请联系QQ:970679559,我们会在尽快处理。