All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.zulia.server.search.ScoreCompare Maven / Gradle / Ivy

There is a newer version: 1.6.4
Show newest version
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