@Override
    public Result search(Query query, Execution execution) {
        List<FieldOrder> s = (query.getRanking().getSorting() != null) ? query.getRanking().getSorting().fieldOrders() : null;
        if (s == null) {
            return execution.search(query);
        }
        for (FieldOrder f : s) {
            if (RANK.equals(f.getFieldName())) {
                return execution.search(query);
            }
        }
        query.getRanking().setProfile(UNRANKED);
        return execution.search(query);
    }
Avoid doing relevance calculations if sorting only on attributes.

@author Steinar Knutsen
container-search/src/main/java/com/yahoo/prelude/querytransform/NoRankingSearcher.java