3

我正在使用elasticsearch,我试图处理数据库为空的情况

@SuppressWarnings("unchecked")
public <M extends Model> SearchResults<M> findPage(int page, String search, String searchFields, String orderBy, String order, String where) {
    BoolQueryBuilder qb = buildQueryBuilder(search, searchFields, where);           
    Query<M> query = (Query<M>) ElasticSearch.query(qb, entityClass);
    // FIXME Currently we ignore the orderBy and order fields
    query.from((page - 1) * getPageSize()).size(getPageSize());
    query.hydrate(true);
    return query.fetch();   
}

return query.fetch() 处的错误;

我正在尝试实现一个 try and catch 语句,但它不起作用,任何人都可以帮助解决这个问题吗?

4

0 回答 0