/** Copy constructor. */ public FieldSortBuilder(FieldSortBuilder template) { this(template.fieldName); this.order(template.order()); this.missing(template.missing()); this.unmappedType(template.unmappedType()); if (template.sortMode != null) { this.sortMode(template.sortMode()); } this.setNestedFilter(template.getNestedFilter()); this.setNestedPath(template.getNestedPath()); if (template.getNestedSort() != null) { this.setNestedSort(template.getNestedSort()); }; }
public static FieldSortBuilder convertSort(SearchQuery.Sort sort) { return getSortClause(sort.getSortClause()) .order(getOrder(sort)) .sortMode(MIN); }
/** Copy constructor. */ public FieldSortBuilder(FieldSortBuilder template) { this(template.fieldName); this.order(template.order()); this.missing(template.missing()); this.unmappedType(template.unmappedType()); if (template.sortMode != null) { this.sortMode(template.sortMode()); } this.setNestedFilter(template.getNestedFilter()); this.setNestedPath(template.getNestedPath()); }
@Override public FieldSortBuilder buildSort(String idfName) { FieldSortBuilder fieldSortBuilder = SortBuilders.fieldSort(idfName).order(order).missing(valueArg); if (sortMethodInvocation.getParameterCount() == 3) { String sortModeText = sortMethodInvocation.getParameterAsString(2); fieldSortBuilder.sortMode(SortMode.fromString(sortModeText)); } return fieldSortBuilder; } });
/** Copy constructor. */ public FieldSortBuilder(FieldSortBuilder template) { this(template.fieldName); this.order(template.order()); this.missing(template.missing()); this.unmappedType(template.unmappedType()); if (template.sortMode != null) { this.sortMode(template.sortMode()); } this.setNestedFilter(template.getNestedFilter()); this.setNestedPath(template.getNestedPath()); if (template.getNestedSort() != null) { this.setNestedSort(template.getNestedSort()); }; }
/** Copy constructor. */ public FieldSortBuilder(FieldSortBuilder template) { this(template.fieldName); this.order(template.order()); this.missing(template.missing()); this.unmappedType(template.unmappedType()); if (template.sortMode != null) { this.sortMode(template.sortMode()); } this.setNestedFilter(template.getNestedFilter()); this.setNestedPath(template.getNestedPath()); if (template.getNestedSort() != null) { this.setNestedSort(template.getNestedSort()); }; }
@Override public FieldSortBuilder buildSort(String nestedFieldName) { BoolQueryBuilder filter = null; if (hasFilterExpr) { SQLExpr filterExpr = invocation.getParameter(3); BoolExpressionParser boolExpressionParser = new BoolExpressionParser(); String queryAs = invocation.getQueryAs(); SQLArgs sqlArgs = invocation.getSqlArgs(); filter = boolExpressionParser.parseBoolQueryExpr(filterExpr, queryAs, sqlArgs); } return SortBuilders.fieldSort(nestedFieldName) .missing(defaultSortVal).sortMode(SortMode.fromString(sortMode)) .setNestedFilter(hasFilterExpr ? filter : null).order(order); } });
PARSER.declareString(FieldSortBuilder::unmappedType , UNMAPPED_TYPE); PARSER.declareString((b, v) -> b.order(SortOrder.fromString(v)) , ORDER_FIELD); PARSER.declareString((b, v) -> b.sortMode(SortMode.fromString(v)), SORT_MODE); PARSER.declareObject(FieldSortBuilder::setNestedFilter, (p, c) -> { DEPRECATION_LOGGER.deprecated("[nested_filter] has been deprecated in favour for the [nested] parameter");