Browse Source

Solr查询方法添加排序,根据rowkey升序

wangxingwang 6 years ago
parent
commit
36ca8b1d61
1 changed files with 1 additions and 0 deletions
  1. 1 0
      commons-data-solr/src/main/java/com/yihu/ehr/solr/SolrUtil.java

+ 1 - 0
commons-data-solr/src/main/java/com/yihu/ehr/solr/SolrUtil.java

@ -73,6 +73,7 @@ public class SolrUtil {
        if (StringUtils.isNotEmpty(fq)) {
            query.setFilterQueries(fq);
        }
        query.setSort("rowkey", SolrQuery.ORDER.asc);
        query.setFields(fields);
        //设置查询起始行
        query.setStart(Integer.parseInt(String.valueOf(start)));