use of com.yahoo.search.query.ranking.MatchPhase in project vespa by vespa-engine.
the class SortingDegrader method setDegradation.
private void setDegradation(Query query) {
query.trace("Using sorting degrading for performance - totalHits will be wrong. " + "Turn off with sorting.degrading=false.", 2);
// ensured above
Sorting.FieldOrder primarySort = query.getRanking().getSorting().fieldOrders().get(0);
MatchPhase matchPhase = query.getRanking().getMatchPhase();
matchPhase.setAttribute(primarySort.getFieldName());
matchPhase.setAscending(primarySort.getSortOrder() == Sorting.Order.ASCENDING);
if (matchPhase.getMaxHits() == null)
matchPhase.setMaxHits(decideDefaultMaxHits(query));
}
Aggregations