Lucene - Core
  1. Lucene - Core
  2. LUCENE-6004

Highlighting AnalyzingInfixSuggester skips non-highlighted key

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 4.10
    • Fix Version/s: 4.10.3, 5.0, 6.0
    • Component/s: modules/other
    • Labels:
    • Lucene Fields:
      New

      Description

      when setting 'doHighlight' to true at AnalyzingInfixSuggester.lookup(..), both the key and the highlightKey inside the returned lookupresult are set to the highlighted string. See at AnalyzingInfixSuggester.createResults, line 530:
      if (doHighlight)

      { Object highlightKey = highlight(text, matchedTokens, prefixToken); result = new LookupResult(highlightKey.toString(), highlightKey, score, payload, contexts); }

      else

      { result = new LookupResult(text, score, payload, contexts); }

      As I understand, the key should'nt be highlighted in any case, only the highlightKey.

        Issue Links

          Activity

          Hide
          jane chang added a comment -

          pass text instead of highlight for the key

          if (doHighlight) {
          result = new LookupResult(text, highlight(text, matchedTokens, prefixToken), score, payload, contexts);

          fixed tests

          Show
          jane chang added a comment - pass text instead of highlight for the key if (doHighlight) { result = new LookupResult(text, highlight(text, matchedTokens, prefixToken), score, payload, contexts); fixed tests
          Hide
          Michael McCandless added a comment -

          Thanks Christian and jane, I think this makes sense ... I'll commit shortly.

          Show
          Michael McCandless added a comment - Thanks Christian and jane, I think this makes sense ... I'll commit shortly.
          Hide
          ASF subversion and git services added a comment -

          Commit 1639798 from Michael McCandless in branch 'dev/trunk'
          [ https://svn.apache.org/r1639798 ]

          LUCENE-6004: don't highlight LookupResult.key from AnalyzingInfixSuggester

          Show
          ASF subversion and git services added a comment - Commit 1639798 from Michael McCandless in branch 'dev/trunk' [ https://svn.apache.org/r1639798 ] LUCENE-6004 : don't highlight LookupResult.key from AnalyzingInfixSuggester
          Hide
          ASF subversion and git services added a comment -

          Commit 1639799 from Michael McCandless in branch 'dev/branches/branch_5x'
          [ https://svn.apache.org/r1639799 ]

          LUCENE-6004: don't highlight LookupResult.key from AnalyzingInfixSuggester

          Show
          ASF subversion and git services added a comment - Commit 1639799 from Michael McCandless in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1639799 ] LUCENE-6004 : don't highlight LookupResult.key from AnalyzingInfixSuggester
          Hide
          ASF subversion and git services added a comment -

          Commit 1639802 from Michael McCandless in branch 'dev/branches/lucene_solr_4_10'
          [ https://svn.apache.org/r1639802 ]

          LUCENE-6004: don't highlight LookupResult.key from AnalyzingInfixSuggester

          Show
          ASF subversion and git services added a comment - Commit 1639802 from Michael McCandless in branch 'dev/branches/lucene_solr_4_10' [ https://svn.apache.org/r1639802 ] LUCENE-6004 : don't highlight LookupResult.key from AnalyzingInfixSuggester
          Hide
          Michael McCandless added a comment -

          Thanks Christian and jane!

          Show
          Michael McCandless added a comment - Thanks Christian and jane!
          Hide
          Robert Muir added a comment -

          I'm confused about the CHANGES.txt entry here, it seems to refer to another issue?

          Show
          Robert Muir added a comment - I'm confused about the CHANGES.txt entry here, it seems to refer to another issue?
          Hide
          Michael McCandless added a comment -

          Egads, it's completely wrong! I think I screwed up resolving the conflicts in CHANGES when I backported (the other changed files look correct). I'll fix ... thanks for catching this Rob!

          Show
          Michael McCandless added a comment - Egads, it's completely wrong! I think I screwed up resolving the conflicts in CHANGES when I backported (the other changed files look correct). I'll fix ... thanks for catching this Rob!
          Hide
          ASF subversion and git services added a comment -

          Commit 1642646 from Michael McCandless in branch 'dev/branches/lucene_solr_4_10'
          [ https://svn.apache.org/r1642646 ]

          LUCENE-6004: fix CHANGES entry

          Show
          ASF subversion and git services added a comment - Commit 1642646 from Michael McCandless in branch 'dev/branches/lucene_solr_4_10' [ https://svn.apache.org/r1642646 ] LUCENE-6004 : fix CHANGES entry
          Hide
          Anshum Gupta added a comment -

          Bulk close after 5.0 release.

          Show
          Anshum Gupta added a comment - Bulk close after 5.0 release.

            People

            • Assignee:
              Unassigned
              Reporter:
              Christian Reuschling
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 5m
                5m
                Remaining:
                Remaining Estimate - 5m
                5m
                Logged:
                Time Spent - Not Specified
                Not Specified

                  Development