Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
4.3.1, 4.6.1
-
None
-
New
Description
Given text of: "x y z x z x a"
With a query of: spanNear([spanNear([text:x, text:y, text:z], 0, true), text:a], 10, false)
Resulting highlight: <B>x</B> <B>y</B> <B>z</B> <B>x</B> <B>z</B> <B>x</B> <B>a</B>
Expected highlight: <B>x</B> <B>y</B> <B>z</B> x z x <B>a</B>
This is caused because WeightedSpanTermExtractor.extractWeightedSpanTerms takes the SpanQuery and flattens all terms and uses the positions from the outermost SpanNear clause (ignoring the nested SpanNear positions). I believe this could be resolved with a little recursion - walking the span query tree in the extractWeightedSpanTerms method.
Attachments
Attachments
Issue Links
- duplicates
-
LUCENE-2287 Unexpected terms are highlighted within nested SpanQuery instances
- Closed
- is duplicated by
-
LUCENE-8121 UnifiedHighlighter can highlight terms within SpanNear clauses at unmatched positions
- Closed