2

如何在 Java 中优雅的使用 elasticsearchAPI

 2 years ago
source link: https://www.v2ex.com/t/848128
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

V2EX  ›  Java

如何在 Java 中优雅的使用 elasticsearchAPI

  Saxton · 4 小时 39 分钟前 · 419 次点击

情况:目前使用了 spring 官方提供的 spring-elasticsearch-data (基于 es 官方的 java 库的),代码里充实着一大堆写死的字符串 mapper 的字段名

想到的方法: 借鉴 mybatisPlus 的思路,使用 SerializedLambda 的方式来替代字符串
具体可以参考: 代码

问:除了这种方式还有其他更优雅的方式吗?


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK