use of com.yahoo.searchdefinition.document.Sorting in project vespa by vespa-engine.
the class SortingOperation method apply.
public void apply(SDField field) {
Attribute attribute = field.getAttributes().get(attributeName);
if (attribute == null) {
attribute = new Attribute(attributeName, field.getDataType());
field.addAttribute(attribute);
}
Sorting sorting = attribute.getSorting();
if (ascending != null) {
sorting.setAscending();
}
if (descending != null) {
sorting.setDescending();
}
if (function != null) {
sorting.setFunction(function);
}
if (strength != null) {
sorting.setStrength(strength);
}
if (locale != null) {
sorting.setLocale(locale);
}
}