...
|
...
|
@@ -30,7 +30,7 @@ public class SearchSortHelper { |
|
|
void init() {
|
|
|
orderValues.add("_score:desc");
|
|
|
orderValues.add("_score:asc");
|
|
|
|
|
|
|
|
|
orderValues.add("id:desc");
|
|
|
orderValues.add("id:asc");
|
|
|
|
...
|
...
|
@@ -93,7 +93,7 @@ public class SearchSortHelper { |
|
|
} else {
|
|
|
realSortField = CharUtils.underlineToCamelhump(realSortField);
|
|
|
}
|
|
|
if(realSortField.equalsIgnoreCase("score")){
|
|
|
if (realSortField.equalsIgnoreCase("score")) {
|
|
|
realSortField = "_score";
|
|
|
}
|
|
|
realOrder.append("," + realSortField + ":" + sortParts[1]);
|
...
|
...
|
@@ -115,7 +115,6 @@ public class SearchSortHelper { |
|
|
filteredFieldNames.add(fieldName);
|
|
|
sortBuilders.add(SortBuilders.fieldSort(fieldName).order(sortOrder));
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 是否需要优先按分数排序
|
...
|
...
|
@@ -136,11 +135,15 @@ public class SearchSortHelper { |
|
|
if (searchCommonHelper.isNeedDeScoreBrandSearch(paramMap)) {
|
|
|
return true;
|
|
|
}
|
|
|
// 4、传了需要显示第一个SKN的参数过来时
|
|
|
if (searchCommonHelper.isFirstProductSknSearch(paramMap)) {
|
|
|
return true;
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
// 都要添加次要排序条件
|
|
|
private void addDeafultSortBuildSorts(List<SortBuilder> sortBuilders,List<String> filteredFieldNames) {
|
|
|
private void addDeafultSortBuildSorts(List<SortBuilder> sortBuilders, List<String> filteredFieldNames) {
|
|
|
this.addSortBuildSorts(sortBuilders, filteredFieldNames, "firstShelveTime", SortOrder.DESC);
|
|
|
this.addSortBuildSorts(sortBuilders, filteredFieldNames, "id", SortOrder.DESC);
|
|
|
}
|
...
|
...
|
|