1 回答

TA貢獻(xiàn)1834條經(jīng)驗(yàn) 獲得超8個贊
使用這個簡單的計(jì)算可以使用一些數(shù)學(xué)來刪除時間部分
long t1 = new Date().getTime();
t1 -= t1 % (24 * 3600 * 1000); //24 * 3600 * 1000 total milliseconds in a day
您可以像這樣更新您的查詢
"filter": {
"script": {
"script": {
"inline": "long t1 = new Date().getTime();
long t2 = doc['PostCodeDate'].value.getMillis();
t1 -= t1 % (24 * 3600 * 1000);
t2 -= t2 % (24 * 3600 * 1000);
return (t1 - t2) / (24 * 3600 * 1000) == params.missDelby",
"params": { "missDelby": 1 }
}
}
}
一旦找到更簡單的方法,我將立即更新我的解決方案。
- 1 回答
- 0 關(guān)注
- 89 瀏覽
添加回答
舉報