版本es 2.31
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'.000+08:00'");
String currentTime = dateFormat.format(new java.util.Date());
boolQueryBuilder = boolQueryBuilder.filter(QueryBuilders.rangeQuery("SHELF_DATE").gt(currentTime).lt("2111-08-00T00:00:00.000+08:00"));
补充:es存的时间格式是 2117-02-26T15:25:00.000+08:00
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'.000+08:00'");
String currentTime = dateFormat.format(new java.util.Date());
boolQueryBuilder = boolQueryBuilder.filter(QueryBuilders.rangeQuery("SHELF_DATE").gt(currentTime).lt("2111-08-00T00:00:00.000+08:00"));
补充:es存的时间格式是 2117-02-26T15:25:00.000+08:00
2 个回复
wyntergreg
赞同来自:
suwensen - 如影随形
赞同来自: