@Override
    public int compare(Hit first, Hit second) {
        for (Sorting.FieldOrder fieldOrder : sorting.fieldOrders() ) {
            String fieldName = fieldOrder.getFieldName();
            Object a = getField(first,fieldName);
            Object b = getField(second,fieldName);

            int x = compareValues(a, b, fieldOrder.getSorter());
            if (x != 0) {
                if (fieldOrder.getSortOrder() == Sorting.Order.DESCENDING)
                    x *= -1;
                return x;
            }
        }
        return super.compare(first, second);
    }
Compares hits based on a sorting specification and values
stored in hit fields.0
<p>
When one of the hits has the requested property and the other
has not, the hit containing the property precedes the one
that does not.
<p>
There is no locale based sorting here, as the backend does
not do that either.

@return -1, 0, 1 if first should be sorted before, equal to or after second
container-search/src/main/java/com/yahoo/search/result/FieldComparator.java