07 2020 档案

摘要:最近在做脚本重评分时,遇上了一个空值问题。查询时painless脚本中若遇到字段中的值为空值就会报错,本来想用 value == null 这种形式的判断来判断字段值是否为空,然后过来掉,结果发现并不行, 以下时错误示范: 这个重评分的代码在defprice字段全部都有值得时候运行正常,但是一旦出现 阅读全文
posted @ 2020-07-23 20:13 yeren2046 阅读(4693) 评论(1) 推荐(1) 编辑
摘要:/** * @Author: * @Description:获取某个目录下所有直接下级文件,不包括目录下的子目录的下的文件,所以不用递归获取 * @Date: */ public static List<String> getFiles(String path) { List<String> fil 阅读全文
posted @ 2020-07-21 11:09 yeren2046 阅读(2228) 评论(0) 推荐(0) 编辑
摘要:1. parseObject解析为一个对象。示例:String json = new String(Files.readAllBytes(Paths.get(getRoodDir() + "config.json")), StandardCharsets.UTF_8);ConfigObj obj = JSONObject.parseObject(json,ConfigObj.class);2.pa... 阅读全文
posted @ 2020-07-21 09:27 yeren2046 阅读(1037) 评论(0) 推荐(0) 编辑
摘要:主要代码 private PageEntity<HotelEsSource> genEntityByFile(String fileName) throws IOException { String json_Str = readToString(new File(getRoodDir() + fi 阅读全文
posted @ 2020-07-15 17:59 yeren2046 阅读(776) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示