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

UnifiedHighlighter ANALYSIS mode does not accurately highlight SpanNotQuery or MUST_NOT

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 8.5.1
    • None
    • modules/highlighter
    • I tested with 8.5.1, but other versions are probably also affected.

    • New

    Description

      If UnifiedHighlighter uses MemoryIndexOffsetStrategy, it does not treat SpanNotQuery correctly.
      Since UnifiedHighlighter uses actual search in order to determine which locations to highlight, it should be consistent with search and only highlight locations in a document that really match the query. However, it does not for SpanNotQuery.

      For the query spanNot(spanNear([content:100, content:dollars], 1, true), content:thousand, 0, 0)
      it produces
      A <b>100</b> fucking <b>dollars</b> wasn't enough to fix it. ... We need <b>100</b> thousand <b>dollars</b> to buy the house

      Attachments

        1. TestUnifiedHighlighter.java
          3 kB
          Christoph Goller

        Activity

          People

            Unassigned Unassigned
            goller@detego-software.de Christoph Goller
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: