[
https://issues.apache.org/jira/browse/LUCENE-8121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16322017#comment-16322017
]
Alan Woodward commented on LUCENE-8121:
---------------------------------------
Changing the expected score in testSubPhrases and testWithSameTermQuery fixes
things locally, and I don't think there's randomization issues in here? Will
commit and see if that quietens things down.
{code}
diff --git
a/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighterStrictPhrases.java
b/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighterStrictPhrases.java
index 08820aa543..9892b838f8 100644
---
a/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighterStrictPhrases.java
+++
b/lucene/highlighter/src/test/org/apache/lucene/search/uhighlight/TestUnifiedHighlighterStrictPhrases.java
@@ -163,7 +163,7 @@ public class TestUnifiedHighlighterStrictPhrases extends
LuceneTestCase {
return Arrays.toString(passages);
}
});
- assertArrayEquals(new
String[]{"[Passage[0-22]{yin[0-3],yang[4-8],yin[10-13]}score=2.4964213]"},
+ assertArrayEquals(new
String[]{"[Passage[0-22]{yin[0-3],yang[4-8],yin[10-13]}score=2.0685003]"},
highlighter.highlight("body", query, topDocs));
}
@@ -207,7 +207,7 @@ public class TestUnifiedHighlighterStrictPhrases extends
LuceneTestCase {
return Arrays.toString(passages);
}
});
- assertArrayEquals(new
String[]{"[Passage[0-41]{alpha[0-5],bravo[6-11],charlie[12-19]}score=3.931102]"},
+ assertArrayEquals(new
String[]{"[Passage[0-41]{alpha[0-5],bravo[6-11],charlie[12-19]}score=2.723861]"},
highlighter.highlight("body", query, topDocs));
}
{code}
> UnifiedHighlighter can highlight terms within SpanNear clauses at unmatched
> positions
> -------------------------------------------------------------------------------------
>
> Key: LUCENE-8121
> URL: https://issues.apache.org/jira/browse/LUCENE-8121
> Project: Lucene - Core
> Issue Type: Bug
> Components: modules/highlighter
> Reporter: David Smiley
> Assignee: David Smiley
> Priority: Minor
> Fix For: 7.3
>
> Attachments: LUCENE-2287_UH_SpanCollector.patch,
> LUCENE-2287_UH_SpanCollector.patch
>
>
> The UnifiedHighlighter (and original Highlighter) highlight phrases by
> converting to a SpanQuery and using the Spans start and end positions to
> assume that every occurrence of the underlying terms between those positions
> are to be highlighted. But this is inaccurate; see LUCENE-5455 for a good
> example, and also LUCENE-2287. The solution is to use the SpanCollector API
> which was introduced after the phrase matching aspects of those highlighters
> were developed.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]