elasticsearch 查询索引和清理索引命令

查询

curl --silent 'http://127.0.0.1:9200/_cat/indices'

删除

curl -X DELETE "localhost:9200/wifilock_prepro_subscribe_std_lock_status?pretty"

设置es可写

curl -XPUT -H "Content-Type: application/json" http://127.0.0.1:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}'

条件范围查询

POST uplus_data_log_pro/_search
{
    "query" : {
        "bool" : {
            "must" : {
                "match" : {
                    "uPlusDeviceId" : "SD8M9GQ17SD078420963E4645"
                }
            },
            "filter" : {
                "range" : {
                    "eventTime" : {"gte":1611590400000,"lte":1611676800000}
                }
            }
        }
    }
}
上一篇:ES操作


下一篇:【尚硅谷】ElasticSearch入门到精通2021最新教程