首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

如何使用SpringBoot 整合ES

org.springframework.data.domain.Pageable; import org.springframework.data.elasticsearch.repository.ElasticsearchRepository...import org.springframework.stereotype.Repository; import java.util.List; /** * 第一种方式,类似于JPA,编写一个ElasticsearchRepository...* 第一个泛型为Bean的类型 * 第二个泛型为Bean的主键类型 */ @Repository public interface SysUserDao extends ElasticsearchRepository...集成Spring-data-es后的思考 使用spring-data-es 提供的ElasticsearchRepository 只能进行简单的增删改查操作,如果碰到一些稍微复杂的聚合操作,他就很难应付了...,所以这里有几个建议: ​ 如果只需要做简单增删改查操作,直接继承ElasticsearchRepository即可 如果项目中有非常复杂的查询或聚合操纵,可以使用结合ElasticsearchRestTemplate

1.5K153

SpringBoot 整合ES|解放你的mysql

org.springframework.data.domain.Pageable; import org.springframework.data.elasticsearch.repository.ElasticsearchRepository...import org.springframework.stereotype.Repository; import java.util.List; /** * 第一种方式,类似于JPA,编写一个ElasticsearchRepository...* 第一个泛型为Bean的类型 * 第二个泛型为Bean的主键类型 */ @Repository public interface SysUserDao extends ElasticsearchRepository...集成Spring-data-es后的思考 使用spring-data-es 提供的ElasticsearchRepository 只能进行简单的增删改差操作,如果碰到一些稍微复杂的聚合操作,他就很难应付了...,所以这里有几个建议: 如果只需要做简单增删改查操作,直接继承ElasticsearchRepository即可 如果项目中有非常复杂的查询或聚合操纵,可以使用结合ElasticsearchRestTemplate

54920
领券