001
014
015 package com.liferay.portal.kernel.search;
016
017
020 public class SortFactoryImpl implements SortFactory {
021
022 public Sort create(String fieldName, boolean reverse) {
023 return new Sort(fieldName, reverse);
024 }
025
026 public Sort create(String fieldName, int type, boolean reverse) {
027 return new Sort(fieldName, type, reverse);
028 }
029
030 public Sort[] getDefaultSorts() {
031 return _DEFAULT_SORTS;
032 }
033
034 private static final Sort[] _DEFAULT_SORTS = new Sort[] {
035 new Sort(null, Sort.SCORE_TYPE, false),
036 new Sort(Field.MODIFIED, Sort.LONG_TYPE, true)
037 };
038
039 }