Authored by hugufei

UFO搜索排序加上id排序

... ... @@ -163,6 +163,7 @@ public class UfoSearchQueryHelper extends BaseService {
if (StringUtils.isBlank(order)) {
sortBuilders.add(SortBuilders.scoreSort().order(SortOrder.DESC));
sortBuilders.add(SortBuilders.fieldSort(UfoProductIndexEsField.orderBy).order(SortOrder.DESC));
sortBuilders.add(SortBuilders.fieldSort(UfoProductIndexEsField.id).order(SortOrder.DESC));
return sortBuilders;
}
String[] sortTypes = order.split(",");
... ... @@ -171,8 +172,9 @@ public class UfoSearchQueryHelper extends BaseService {
String fieldName = sortParts[0];
SortOrder sortOrder = SortOrder.ASC.toString().equals(sortParts[1]) ? SortOrder.ASC : SortOrder.DESC;
this.addSortBuildSorts(sortBuilders, filteredFieldNames, paramMap, fieldName, sortOrder);
}
sortBuilders.add(SortBuilders.fieldSort(UfoProductIndexEsField.orderBy).order(SortOrder.DESC));
sortBuilders.add(SortBuilders.fieldSort(UfoProductIndexEsField.id).order(SortOrder.DESC));
return sortBuilders;
}
... ... @@ -224,8 +226,6 @@ public class UfoSearchQueryHelper extends BaseService {
} else {
sortBuilders.add(SortBuilders.fieldSort(fieldName).order(sortOrder));
}
sortBuilders.add(SortBuilders.scoreSort().order(SortOrder.DESC));
sortBuilders.add(SortBuilders.fieldSort(UfoProductIndexEsField.orderBy).order(SortOrder.DESC));
}
private void addMustIntTermsQuery(BoolQueryBuilder boolFilter, Map<String, String> paramMap, String filterParamName, String paramName, String esField) {
... ...