07 2020 档案
摘要:最近在做脚本重评分时,遇上了一个空值问题。查询时painless脚本中若遇到字段中的值为空值就会报错,本来想用 value == null 这种形式的判断来判断字段值是否为空,然后过来掉,结果发现并不行, 以下时错误示范: 这个重评分的代码在defprice字段全部都有值得时候运行正常,但是一旦出现
阅读全文
摘要:/** * @Author: * @Description:获取某个目录下所有直接下级文件,不包括目录下的子目录的下的文件,所以不用递归获取 * @Date: */ public static List<String> getFiles(String path) { List<String> fil
阅读全文
摘要: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...
阅读全文
摘要:主要代码 private PageEntity<HotelEsSource> genEntityByFile(String fileName) throws IOException { String json_Str = readToString(new File(getRoodDir() + fi
阅读全文