public final class ElasticSearchUtil extends Object
| 构造器和说明 |
|---|
ElasticSearchUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static org.elasticsearch.index.query.QueryBuilder |
convert(com.lmaye.app.common.query.Query query)
转化请求查询对象为QueryBuilder
|
static <T> com.lmaye.app.common.context.PageResult<T> |
searchPage(org.elasticsearch.client.RestHighLevelClient client,
com.lmaye.app.common.query.PageQuery query,
Class<T> clazz)
分页查询
- 浅分页
|
static <T> List<T> |
searchScrollAll(org.elasticsearch.client.RestHighLevelClient client,
com.lmaye.app.common.query.ListQuery query,
long scrollAliveTime,
Class<T> clazz)
获取结果集,返回SearchHit集合
- 使用游标
|
static <T> com.lmaye.app.common.context.PageResult<T> |
searchScrollPage(org.elasticsearch.client.RestHighLevelClient client,
com.lmaye.app.common.query.PageQuery query,
long scrollAliveTime,
Class<T> clazz)
分页查询
- 深度查询(游标)
|
public static org.elasticsearch.index.query.QueryBuilder convert(com.lmaye.app.common.query.Query query)
query - QueryBuilderpublic static <T> List<T> searchScrollAll(org.elasticsearch.client.RestHighLevelClient client, com.lmaye.app.common.query.ListQuery query, long scrollAliveTime, Class<T> clazz) throws Exception
client - RestHighLevelClientquery - ListQueryscrollAliveTime - scroll存活时间(ms)clazz - ClassException - 异常public static <T> com.lmaye.app.common.context.PageResult<T> searchPage(org.elasticsearch.client.RestHighLevelClient client,
com.lmaye.app.common.query.PageQuery query,
Class<T> clazz)
throws Exception
T - Tclient - RestHighLevelClientquery - PageQueryclazz - ClassException - 异常public static <T> com.lmaye.app.common.context.PageResult<T> searchScrollPage(org.elasticsearch.client.RestHighLevelClient client,
com.lmaye.app.common.query.PageQuery query,
long scrollAliveTime,
Class<T> clazz)
throws Exception
T - Tclient - RestHighLevelClientquery - PageQueryscrollAliveTime - scroll存活时间(ms)clazz - ClassException - 异常Copyright © 2020. All rights reserved.