public interface BaseEsMapper<T>
Copyright © 2021 xpc1024 All Rights Reserved
| 限定符和类型 | 方法和说明 |
|---|---|
Boolean |
createIndex()
创建索引,根据当前mapper对应实体类信息及其注解配置生成索引信息
|
Boolean |
createIndex(LambdaEsIndexWrapper<T> wrapper)
创建索引
|
Integer |
delete(LambdaEsQueryWrapper<T> wrapper)
根据 entity 条件,删除记录
|
Integer |
deleteBatchIds(Collection<? extends Serializable> idList)
删除(根据ID 批量删除)
|
Integer |
deleteBatchIds(Collection<? extends Serializable> idList,
String indexName)
删除(根据ID 批量删除)
|
Integer |
deleteById(Serializable id)
根据 ID 删除
|
Integer |
deleteById(Serializable id,
String indexName)
根据 ID 删除
|
Boolean |
deleteIndex(String indexName)
删除指定索引
|
Boolean |
existsIndex(String indexName)
是否存在索引
|
org.elasticsearch.client.indices.GetIndexResponse |
getIndex()
获取当前索引信息
|
org.elasticsearch.client.indices.GetIndexResponse |
getIndex(String indexName)
获取指定索引信息
|
org.elasticsearch.search.builder.SearchSourceBuilder |
getSearchSourceBuilder(LambdaEsQueryWrapper<T> wrapper)
获取SearchSourceBuilder,可用于本框架生成基础查询条件,不支持的高阶语法用户可通过SearchSourceBuilder 进一步封装
|
String |
getSource(LambdaEsQueryWrapper<T> wrapper)
获取通过本框架生成的查询参数,可用于检验本框架生成的查询参数是否正确
|
Integer |
insert(T entity)
插入一条记录
|
Integer |
insert(T entity,
String indexName)
插入一条记录,可指定索引插入
|
Integer |
insertBatch(Collection<T> entityList)
批量插入
|
Integer |
insertBatch(Collection<T> entityList,
String indexName)
批量插入
|
PageInfo<T> |
pageQuery(LambdaEsQueryWrapper<T> wrapper,
Integer pageNum,
Integer pageSize)
指定返回类型及分页参数
|
org.elasticsearch.action.search.SearchResponse |
scroll(org.elasticsearch.action.search.SearchScrollRequest searchScrollRequest,
org.elasticsearch.client.RequestOptions requestOptions)
es原生滚动查询
|
org.elasticsearch.action.search.SearchResponse |
search(LambdaEsQueryWrapper<T> wrapper)
标准查询
|
org.elasticsearch.action.search.SearchResponse |
search(org.elasticsearch.action.search.SearchRequest searchRequest,
org.elasticsearch.client.RequestOptions requestOptions)
es原生查询
|
SAPageInfo<T> |
searchAfterPage(LambdaEsQueryWrapper<T> wrapper,
List<Object> searchAfter,
Integer pageSize)
searchAfter类型分页
|
List<T> |
selectBatchIds(Collection<? extends Serializable> idList)
查询(根据ID 批量查询)
|
List<T> |
selectBatchIds(Collection<? extends Serializable> idList,
String indexName)
查询(根据ID 批量查询)
|
T |
selectById(Serializable id)
根据 ID 查询
|
T |
selectById(Serializable id,
String indexName)
根据 ID 查询
|
default Long |
selectCount(LambdaEsQueryWrapper<T> wrapper)
获取总数 默认根据折叠参数去重
|
Long |
selectCount(LambdaEsQueryWrapper<T> wrapper,
boolean distinct)
是否去重获取总数
|
List<T> |
selectList(LambdaEsQueryWrapper<T> wrapper)
根据 entity 条件,查询全部记录
|
T |
selectOne(LambdaEsQueryWrapper<T> wrapper)
根据 entity 条件,查询一条记录
|
Boolean |
setCurrentActiveIndex(String indexName)
设置当前Mapper默认激活的全局索引名称 务必谨慎操作,设置后全局生效,永驻jvm,除非项目重启
|
Integer |
update(T entity,
LambdaEsUpdateWrapper<T> updateWrapper)
根据 whereEntity 条件,更新记录
|
Integer |
updateBatchByIds(Collection<T> entityList)
根据ID 批量更新
|
Integer |
updateBatchByIds(Collection<T> entityList,
String indexName)
根据ID 批量更新
|
Integer |
updateById(T entity)
根据 ID 更新
|
Integer |
updateById(T entity,
String indexName)
根据 ID 更新
|
Boolean |
updateIndex(LambdaEsIndexWrapper<T> wrapper)
更新索引
|
org.elasticsearch.client.indices.GetIndexResponse getIndex()
org.elasticsearch.client.indices.GetIndexResponse getIndex(String indexName)
indexName - 指定索引名Boolean createIndex()
Boolean createIndex(LambdaEsIndexWrapper<T> wrapper)
wrapper - 条件Boolean updateIndex(LambdaEsIndexWrapper<T> wrapper)
wrapper - 条件org.elasticsearch.action.search.SearchResponse search(LambdaEsQueryWrapper<T> wrapper)
wrapper - 条件org.elasticsearch.search.builder.SearchSourceBuilder getSearchSourceBuilder(LambdaEsQueryWrapper<T> wrapper)
wrapper - 条件org.elasticsearch.action.search.SearchResponse search(org.elasticsearch.action.search.SearchRequest searchRequest,
org.elasticsearch.client.RequestOptions requestOptions)
throws IOException
searchRequest - 查询请求参数requestOptions - 类型IOException - IO异常org.elasticsearch.action.search.SearchResponse scroll(org.elasticsearch.action.search.SearchScrollRequest searchScrollRequest,
org.elasticsearch.client.RequestOptions requestOptions)
throws IOException
searchScrollRequest - 查询请求参数requestOptions - 类型IOException - IO异常String getSource(LambdaEsQueryWrapper<T> wrapper)
wrapper - 条件PageInfo<T> pageQuery(LambdaEsQueryWrapper<T> wrapper, Integer pageNum, Integer pageSize)
wrapper - 条件pageNum - 当前页pageSize - 每页条数SAPageInfo<T> searchAfterPage(LambdaEsQueryWrapper<T> wrapper, List<Object> searchAfter, Integer pageSize)
wrapper - 条件searchAfter - 当前页 第一页时为nullpageSize - 每页条数default Long selectCount(LambdaEsQueryWrapper<T> wrapper)
wrapper - 条件Long selectCount(LambdaEsQueryWrapper<T> wrapper, boolean distinct)
wrapper - 条件distinct - 是否去重Integer insert(T entity, String indexName)
entity - 插入的数据对象indexName - 指定插入的索引名Integer insertBatch(Collection<T> entityList)
entityList - 插入的数据对象列表Integer insertBatch(Collection<T> entityList, String indexName)
entityList - 插入的数据对象列表indexName - 指定插入的索引名Integer deleteById(Serializable id)
id - 主键Integer deleteById(Serializable id, String indexName)
id - 主键indexName - 指定删除的索引名Integer delete(LambdaEsQueryWrapper<T> wrapper)
wrapper - 条件Integer deleteBatchIds(Collection<? extends Serializable> idList)
idList - 主键列表Integer deleteBatchIds(Collection<? extends Serializable> idList, String indexName)
idList - 主键列表indexName - 指定删除的索引名Integer updateById(T entity, String indexName)
entity - 更新对象indexName - 指定更新的索引名称Integer updateBatchByIds(Collection<T> entityList)
entityList - 更新对象列表Integer updateBatchByIds(Collection<T> entityList, String indexName)
entityList - 更新对象列表indexName - 指定更新的索引名称Integer update(T entity, LambdaEsUpdateWrapper<T> updateWrapper)
entity - 更新对象updateWrapper - 条件T selectById(Serializable id)
id - 主键T selectById(Serializable id, String indexName)
id - 主键indexName - 指定查询的索引名List<T> selectBatchIds(Collection<? extends Serializable> idList)
idList - 主键列表List<T> selectBatchIds(Collection<? extends Serializable> idList, String indexName)
idList - 主键列表indexName - 指定查询的索引名T selectOne(LambdaEsQueryWrapper<T> wrapper)
wrapper - 条件List<T> selectList(LambdaEsQueryWrapper<T> wrapper)
wrapper - 条件Copyright © 2022. All rights reserved.