diff --git a/sandbox/contributions/highlighter/src/java/org/apache/lucene/search/highlight/TextFragment.java b/sandbox/contributions/highlighter/src/java/org/apache/lucene/search/highlight/TextFragment.java index e264a56e560..c6dd136e70a 100644 --- a/sandbox/contributions/highlighter/src/java/org/apache/lucene/search/highlight/TextFragment.java +++ b/sandbox/contributions/highlighter/src/java/org/apache/lucene/search/highlight/TextFragment.java @@ -46,11 +46,12 @@ public class TextFragment /** * @param frag2 Fragment to be merged into this one */ - public void merge(TextFragment frag2) - { - textEndPos = frag2.textEndPos; - } - /** + public void merge(TextFragment frag2) + { + textEndPos = frag2.textEndPos; + score=Math.max(score,frag2.score); + } + /** * @param fragment * @return true if this fragment follows the one passed */