public class SimpleESCRepository<T,M> extends Object implements ESCRepository<T,M>
| 构造器和说明 |
|---|
SimpleESCRepository(org.springframework.context.ApplicationContext applicationContext) |
| 限定符和类型 | 方法和说明 |
|---|---|
Map |
aggs(String metricName,
AggsType aggsType,
org.elasticsearch.index.query.QueryBuilder queryBuilder,
String bucketName)
普通聚合查询
以bucket分组以aggstypes的方式metric度量
|
List<String> |
completionSuggest(String fieldName,
String fieldValue)
搜索建议
|
long |
count(org.elasticsearch.index.query.QueryBuilder queryBuilder)
查询数量
|
boolean |
delete(T t)
删除索引
|
boolean |
deleteById(M id)
删除索引
|
T |
getById(M id)
根据ID查询
|
Class<T> |
getDomainClass() |
Class<M> |
getIdClass() |
org.elasticsearch.client.Response |
request(org.elasticsearch.client.Request request)
通过Low Level REST Client 查询
https://www.elastic.co/guide/en/elasticsearch/client/java-rest/6.6/java-rest-low-usage-requests.html
|
org.elasticsearch.action.bulk.BulkResponse |
save(List<T> list)
新增索引集合
|
boolean |
save(T o)
新增索引
|
List<T> |
search(org.elasticsearch.index.query.QueryBuilder queryBuilder)
非分页查询
目前暂时传入类类型
|
PageList<T> |
search(org.elasticsearch.index.query.QueryBuilder queryBuilder,
PageSortHighLight pageSortHighLight)
支持分页、高亮、排序的查询
|
org.elasticsearch.action.search.SearchResponse |
search(org.elasticsearch.action.search.SearchRequest searchRequest)
【最原始】查询
|
List<T> |
searchMore(org.elasticsearch.index.query.QueryBuilder queryBuilder,
int limitSize)
非分页查询,指定最大返回条数
目前暂时传入类类型
|
void |
setDomainClass(Class<T> domainClass) |
void |
setIdClass(Class<M> idClass) |
boolean |
update(T t)
按照有值字段更新索引
|
boolean |
updateCover(T t)
覆盖更新索引
|
public SimpleESCRepository(org.springframework.context.ApplicationContext applicationContext)
public org.elasticsearch.client.Response request(org.elasticsearch.client.Request request)
throws Exception
ESCRepositoryrequest 在接口中 ESCRepository<T,M>Exceptionpublic boolean save(T o) throws Exception
ESCRepositorysave 在接口中 ESCRepository<T,M>Exceptionpublic org.elasticsearch.action.bulk.BulkResponse save(List<T> list) throws Exception
ESCRepositorysave 在接口中 ESCRepository<T,M>Exceptionpublic boolean update(T t) throws Exception
ESCRepositoryupdate 在接口中 ESCRepository<T,M>Exceptionpublic boolean updateCover(T t) throws Exception
ESCRepositoryupdateCover 在接口中 ESCRepository<T,M>Exceptionpublic boolean delete(T t) throws Exception
ESCRepositorydelete 在接口中 ESCRepository<T,M>Exceptionpublic boolean deleteById(M id) throws Exception
ESCRepositorydeleteById 在接口中 ESCRepository<T,M>Exceptionpublic T getById(M id) throws Exception
ESCRepositorygetById 在接口中 ESCRepository<T,M>Exceptionpublic org.elasticsearch.action.search.SearchResponse search(org.elasticsearch.action.search.SearchRequest searchRequest)
throws Exception
ESCRepositorysearch 在接口中 ESCRepository<T,M>Exceptionpublic List<T> search(org.elasticsearch.index.query.QueryBuilder queryBuilder) throws Exception
ESCRepositorysearch 在接口中 ESCRepository<T,M>Exceptionpublic long count(org.elasticsearch.index.query.QueryBuilder queryBuilder)
throws Exception
ESCRepositorycount 在接口中 ESCRepository<T,M>Exceptionpublic PageList<T> search(org.elasticsearch.index.query.QueryBuilder queryBuilder, PageSortHighLight pageSortHighLight) throws Exception
ESCRepositorysearch 在接口中 ESCRepository<T,M>Exceptionpublic List<T> searchMore(org.elasticsearch.index.query.QueryBuilder queryBuilder, int limitSize) throws Exception
ESCRepositorysearchMore 在接口中 ESCRepository<T,M>limitSize - 最大返回条数Exceptionpublic List<String> completionSuggest(String fieldName, String fieldValue) throws Exception
ESCRepositorycompletionSuggest 在接口中 ESCRepository<T,M>Exceptionpublic Map aggs(String metricName, AggsType aggsType, org.elasticsearch.index.query.QueryBuilder queryBuilder, String bucketName) throws Exception
ESCRepositoryaggs 在接口中 ESCRepository<T,M>ExceptionCopyright © 2021. All rights reserved.