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}
                }
            }
        }
    }
}
posted @ 2021-07-07 09:59  好奇成传奇  阅读(490)  评论(0编辑  收藏  举报