From c6482c148840a0d9789572ccf8684383cc31af8d Mon Sep 17 00:00:00 2001 From: David Wayne Smiley Date: Mon, 13 Apr 2015 13:48:57 +0000 Subject: [PATCH] SOLR-6692: Don't round highlight fragment scores for ordering purposes git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1673185 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/solr/highlight/DefaultSolrHighlighter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solr/core/src/java/org/apache/solr/highlight/DefaultSolrHighlighter.java b/solr/core/src/java/org/apache/solr/highlight/DefaultSolrHighlighter.java index 2a868cbaf5d..42bdd1cdc57 100644 --- a/solr/core/src/java/org/apache/solr/highlight/DefaultSolrHighlighter.java +++ b/solr/core/src/java/org/apache/solr/highlight/DefaultSolrHighlighter.java @@ -564,7 +564,7 @@ public class DefaultSolrHighlighter extends SolrHighlighter implements PluginInf Collections.sort(frags, new Comparator() {//TODO make TextFragment Comparable @Override public int compare(TextFragment arg0, TextFragment arg1) { - return Math.round(arg1.getScore() - arg0.getScore()); + return Float.compare(arg1.getScore(), arg0.getScore()); } }); }