SearchParameters sp = new SearchParameters();
sp.addStore(getStoreRef());
sp.setLanguage(SearchService.LANGUAGE_LUCENE);
sp.setQuery('PATH:\'//.\'');
sp.addSort('ID', true);
ResultSet results = null;
try {
    results = serviceRegistry.getSearchService().query(sp);
    for(ResultSetRow row : results) {
        NodeRef currentNodeRef = row.getNodeRef();
        ...
    }
} finally {
    if(results != null) {
        results.close();
    }
}

支持特殊的属性排序,例如:cm:content.size和cm:content.mimetype

Lucene sorting is based on Java string ordering. Internally, we transform numeric and date types into a lexographical form that orders as expected.
Lucene排序基于Java字符串排序。在内部,我们将数字和日期类型转换为按预期顺序排列的词汇表形式。

Tokenising can give sort orders that may not be what you expect. Locale sensitive fields can only be ordered with respect to one locale. Nodes that are not relevant to the locale will be in the order they were added to the index (treated like null values in SQL)
分词可以给出可能不是您所期望的排序顺序。区域设置敏感字段只能针对一个区域设置进行排序。与区域设置无关的节点将按照它们添加到索引中的顺序(在SQL中被视为空值)

文档更新时间: 2020-03-01 01:55   作者:凌云文档