io.zulia.server.search.ScoreCompare Maven / Gradle / Ivy
package io.zulia.server.search;
import io.zulia.message.ZuliaQuery.ScoredResult;
import java.util.Comparator;
public class ScoreCompare implements Comparator {
@Override
public int compare(ScoredResult o1, ScoredResult o2) {
int compare = Double.compare(o1.getScore(), o2.getScore()) * -1;
if (compare == 0) {
return Integer.compare(o1.getResultIndex(), o2.getResultIndex());
}
return compare;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy