Search in sources :

Example 1 with Sorting

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);
    }
}
Also used : Attribute(com.yahoo.searchdefinition.document.Attribute) Sorting(com.yahoo.searchdefinition.document.Sorting)

Aggregations

Attribute (com.yahoo.searchdefinition.document.Attribute)1 Sorting (com.yahoo.searchdefinition.document.Sorting)1