ElasticSearch es筆記

複製代碼


-- 數據查詢 bash

curl -XGET IP:PORT/your_index/your_type/_search -d '{ "sort":[{ "date":{"order":"desc"}}], "size": 10 }' app

 -- 刪除老數據 curl

curl -XPOST IP:PORT/your_index/your_type/_delete_by_query -d '{"query":{"range":{"date":{"lt":"now-30d"}}}}' ui

 --切換索引 url

curl -XPOST IP:PORT/_aliases -d ' { "actions": [ { "remove": { "alias": "your_alias", "index": "your_index_1" }}, { "add": { "alias": "your_alias", "index": "your_index_2" }} ] } ' spa

三十天前時間:now-30dcode

相關文章
相關標籤/搜索