ES查詢按時時間過濾

2022-08-01 01:24:13 字數 452 閱讀 4016

資料量:document 大概有2kw+,每個document下有乙個nest陣列結構,資料量最多能達到上百個,每個陣列的元素中有個expire_time,搜尋時會通過expire_time進行過濾操作

搜尋時:es的時間過濾}}0},

"size": }}100},

"query": }" }

}, }}]}}}}]}}

}gt對時間的操作效能有很大的影響(分鐘級),在查詢時會有很大的抖動,延時很大,在這裡我們對資料做乙個定時指令碼,規避掉這個問題

post /ptp_tags/_update_by_query?conflicts=proceed

{"script":{

"inline":"ctx._source.object_list.removeif((item)->item.expire_time如果對時間不是特別敏感,定時清理掉過期的資料,減少查詢時候的結果集

find 按時間查詢

分類 linuxshell日記 mtime 修改時間 ctime 改變時間 atime 訪問時間 mtime 5 至少5天之前修改過的檔案,至少5天沒修改過 mtime 5 5天之內修改過的檔案 mtime 5 剛好5天前修改的檔案 perm 按許可權查詢 perm 001 精確匹配許可權。perm...

mysql時間查詢 MySQL按時間查詢

mysql 今天select from 表名 where to days 時間欄位名 to days now 昨天select from 表名 where to days now to days 時間欄位名 1 近7天select from 表名 where date sub curdate int...

Linux查詢目錄下的按時間過濾的檔案

在維護專案中,有時會指定都一些條件進行過濾檔案,並對該批檔案進行操作 這時我們將使用shell命令進行操作 直接上 bin sh begin find name type d prune o newermt 2001 01 01 00 00 00 newermt 2019 01 01 00 00 0...