上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 61 下一页

2022年1月4日

ElastaticSearch -- es深度分页 searchAfter

摘要: searchAfter深度分页 es一次只能查1万条数据,如果超过1万,会报错如下: "reason": { "type": "query_phase_execution_exception", "reason": "Result window is too large, from + size m 阅读全文

posted @ 2022-01-04 01:03 乐之者v 阅读(1605) 评论(0) 推荐(0)

2022年1月1日

ElastaticSearch -- es客户端RestHighLevelClient

摘要: RestHighLevelClient es的客户端有 RestClient、 TransportClient 、 RestHighLevelClient, RestClient、 TransportClient不适合高版本的es,官方推荐使用RestHighLevelClient. maven配置 阅读全文

posted @ 2022-01-01 19:23 乐之者v 阅读(343) 评论(0) 推荐(0)

2021年12月27日

ElastaticSearch -- es批量插入数据

摘要: es批量插入数据的示例 /** * 批量插入数据 * @param client es客户端 * 如果没有现成的client, 获取client的代码以及jar包,详情见 https://www.cnblogs.com/expiator/p/15735701.html * @param list 对 阅读全文

posted @ 2021-12-27 22:34 乐之者v 阅读(2115) 评论(0) 推荐(0)

ElastaticSearch ---java查看es索引是否存在

摘要: java查看es索引是否存在 /** * 判断指定的索引名是否存在 * * @param indexName 索引名 * @return 存在:true; 不存在:false; */ public static boolean isExistsIndex(String indexName) { // 阅读全文

posted @ 2021-12-27 18:12 乐之者v 阅读(1963) 评论(0) 推荐(0)

ElastaticSearch ---es客户端 TransportClient

摘要: TransportClient TransportClient客户端,官方在es 7.0版本中将弃用TransportClient客户端,且在8.0版本中完全移除它. es 7.0及以上的版本,请使用 RestHighLevelClient。 如果项目中使用的es版本不高,可以使用 Transpor 阅读全文

posted @ 2021-12-27 11:46 乐之者v 阅读(504) 评论(0) 推荐(0)

2021年12月6日

程序员如何减少bug?

摘要: 程序员(开发)如何减少bug? ### 程序员要多跟产品交流 * 需求文档不清晰的地方,要及时跟产品确认。切忌独自揣测,随意开发。 * 在跟产品沟通时,要有自己的想法,描述问题,并给出解决方案,不要一味地抛出问题。 * 需求变更,必须录入需求系统。没有记录,需求变更也会被误认为是bug。 ### 程 阅读全文

posted @ 2021-12-06 23:51 乐之者v 阅读(407) 评论(0) 推荐(1)

2021年11月15日

mysql查出来的时间跟数据库相差13/14小时

摘要: 背景 mysql查出来的时间跟数据库相差13/14小时,写入的时间跟数据库也相差13/14小时。 问题原因 查看时区: 在mysql中执行以下命令: SHOW VARIABLES LIKE '%time_zone%'; 查询结果如下: 可以看到时区使用的是 CST,而 CST 是一种混乱的时区。它可 阅读全文

posted @ 2021-11-15 22:22 乐之者v 阅读(1373) 评论(0) 推荐(0)

2021年10月25日

ApplicationContext在非Service类中调用Spring的Serivce类

摘要: 背景 有时我们需要在一些不属于Spring的类中,去调用Spring的Service类的方法。 比如,在Util类,或者main()方法中,去调用Service类的方法。 这时,可以使用 ApplicationContextAware接口 和 ApplicationContext接口 . Appli 阅读全文

posted @ 2021-10-25 11:57 乐之者v 阅读(226) 评论(0) 推荐(0)

2021年10月19日

PropertyDescriptor动态反射setter和getter设置对象属性

摘要: PropertyDescriptor 我们在开发的过程中,有时会需要动态地设置属性,也就是动态getter、 setter。 使用传统的反射 Method、Field等类去处理,需要对方法名进行大量拼接,比较麻烦。 可以使用 PropertyDescriptor. 常用方法: 构造方法: Prope 阅读全文

posted @ 2021-10-19 19:41 乐之者v 阅读(967) 评论(0) 推荐(0)

2021年9月26日

ElasticSearch---es用should表示or的逻辑

摘要: should 在使用es时,如果需要用到or逻辑,可以使用should。 minimum_should_match should,可以配合 minimum_should_match 使用。 minimum_should_match是最低匹配度, minimum_should_match为1, 表示s 阅读全文

posted @ 2021-09-26 18:39 乐之者v 阅读(6532) 评论(0) 推荐(0)

上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 61 下一页

导航