Authored by saihide

Merge branch 'master' into recommendbrand

... ... @@ -65,6 +65,9 @@ public class SearchSortHelper {
orderValues.add("pools.id:desc");
orderValues.add("pools.id:asc");
orderValues.add("pools.sort:desc");
orderValues.add("pools.sort:asc");
orderValues.add("brand_weight:asc");
orderValues.add("brand_weight:desc");
... ... @@ -220,11 +223,11 @@ public class SearchSortHelper {
} else if (fieldName.contains("pools")) {
BoolQueryBuilder poolsTermsBuilder = searchCommonHelper.getPoolIdTermsBuilder(paramMap);
String flag = sortOrder.toString().equals("desc") ? "_last" : "_first";
FieldSortBuilder poolsIdSort = SortBuilders.fieldSort(fieldName).order(sortOrder).setNestedPath("pools").missing(flag);
if (poolsTermsBuilder != null) {
poolsIdSort.setNestedFilter(poolsTermsBuilder);
FieldSortBuilder poolsFieldSortBuilder = SortBuilders.fieldSort(fieldName).order(sortOrder).setNestedPath("pools").missing(flag);
if (poolsFieldSortBuilder != null) {
poolsFieldSortBuilder.setNestedFilter(poolsTermsBuilder);
}
sortBuilders.add(poolsIdSort);
sortBuilders.add(poolsFieldSortBuilder);
} else {
this.addSortBuildSorts(sortBuilders, filteredFieldNames, fieldName, sortOrder);
}
... ...