Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-8446

UnifiedHighlighter DefaultPassageFormatter should merge overlapping offsets

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 7.5
    • modules/highlighter
    • None
    • New

    Description

      The UnifiedHighlighter's DefaultPassageFormatter (mostly unchanged from the old PostingsHighlighter) will format overlapping matches by closing a tag and immediately opening a tag.  I think this is a bit ugly structurally and it ought to continue the tag is if the matches were merged.  This is extremely rare in practice today since a match is always a word, and thus we'd only see this behavior if multiple words at the same position of different offsets are highlighted.  The advent of matches representing phrases will increase the probability of this, and indeed was discovered while working on LUCENE-8286.  Additionally, and related, OffsetsEnums should internally be ordered by the end offset if the start offset is the same.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            dsmiley David Smiley
            dsmiley David Smiley
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment