You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "David Smiley (JIRA)" <ji...@apache.org> on 2018/01/11 04:11:00 UTC

[jira] [Resolved] (LUCENE-5455) Nested SpanNear queries lose positional highlights

     [ https://issues.apache.org/jira/browse/LUCENE-5455?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Smiley resolved LUCENE-5455.
----------------------------------
       Resolution: Duplicate
    Fix Version/s:     (was: 6.0)
                       (was: 4.9)
                   7.3

> Nested SpanNear queries lose positional highlights
> --------------------------------------------------
>
>                 Key: LUCENE-5455
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5455
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: modules/highlighter
>    Affects Versions: 4.3.1, 4.6.1
>            Reporter: Steve Davids
>             Fix For: 7.3
>
>         Attachments: LUCENE-5455-Tests.patch
>
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org