Elasticsearch
# 首先关闭 shard 的分配
PUT _cluster/settings
{
"persistent": {
"cluster.routing.allocation.enable": "none"
}
}
# 然后写入硬盘
POST _flush/synced
# 升级完成后打开
PUT _cluster/settings
{
"persistent": {
"cluster.routing.allocation.enable": null
}
}
# 时间范围查询
GET element-quantity-2/_search
{
"query": {
"range": {
"timestamp": {
"lte": "2018.11.13",
"format": "yyyy.MM.dd"
}
}
}
}
# 值的种类查询
GET element-quantity-2/_search
{
"size": 0,
"query": {
"match_all": {}
},
"aggs": {
"count": {
"cardinality": {
"field": "databag_id"
}
}
}
}
# 通用参数
## 显示标题
?v
## 选择显示哪些列
?h=A,B,C
## 排序
?s=A:desc,B
# 获取素有的节点
GET _cat/nodes
# 获取所有的 index
GET _cat/indices?v
# 获取符合某个 pattern 的 index 的 shard
GET _cat/shards/${pattern}