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

UnifiedHighlighter: Make Passage public for extensibility

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.4
    • Component/s: modules/highlighter
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      (UnifiedHighlighter) Passage.java has a variety of package-level fields and methods that are accessed by FieldHighlighter.highlightOffsetsEnums (the kernel of the UH). It should be possible for people to extend this method to tweak the process of producing passages. That method is extensible but Passage.java is too closed. Even if one were to write their own equivalent to Passage.java, it would be impossible to then use PassageScorer or PassageFormatter.

      1. LUCENE-7559.patch
        16 kB
        David Smiley

        Activity

        Hide
        dsmiley David Smiley added a comment -

        This patch makes it's fields private, adds setters, and makes the package visible methods public. /** @lucene.internal */ was added to methods only needed internally.

        Show
        dsmiley David Smiley added a comment - This patch makes it's fields private, adds setters, and makes the package visible methods public. /** @lucene.internal */ was added to methods only needed internally.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit c51e89014ac74f164e3b6962abc5f0db56ee99bb in lucene-solr's branch refs/heads/master from David Smiley
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=c51e890 ]

        LUCENE-7559: UnifiedHighlighter: Increase Passage visibility

        Show
        jira-bot ASF subversion and git services added a comment - Commit c51e89014ac74f164e3b6962abc5f0db56ee99bb in lucene-solr's branch refs/heads/master from David Smiley [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=c51e890 ] LUCENE-7559 : UnifiedHighlighter: Increase Passage visibility
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit cbc83929e70e78d84e15013aa9e60cc81a4a7a6d in lucene-solr's branch refs/heads/master from David Smiley
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=cbc8392 ]

        LUCENE-7559: fix indentation of entire file

        Show
        jira-bot ASF subversion and git services added a comment - Commit cbc83929e70e78d84e15013aa9e60cc81a4a7a6d in lucene-solr's branch refs/heads/master from David Smiley [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=cbc8392 ] LUCENE-7559 : fix indentation of entire file
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 23b8bb669359008d19fd19d744ba42ef8870d25c in lucene-solr's branch refs/heads/branch_6x from David Smiley
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=23b8bb6 ]

        LUCENE-7559: UnifiedHighlighter: Increase Passage visibility

        (cherry picked from commit c51e890)

        Show
        jira-bot ASF subversion and git services added a comment - Commit 23b8bb669359008d19fd19d744ba42ef8870d25c in lucene-solr's branch refs/heads/branch_6x from David Smiley [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=23b8bb6 ] LUCENE-7559 : UnifiedHighlighter: Increase Passage visibility (cherry picked from commit c51e890)
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 06ee34c68225fd904b8909af44173574890d881e in lucene-solr's branch refs/heads/branch_6x from David Smiley
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=06ee34c ]

        LUCENE-7559: fix indentation of entire file

        (cherry picked from commit cbc8392)

        Show
        jira-bot ASF subversion and git services added a comment - Commit 06ee34c68225fd904b8909af44173574890d881e in lucene-solr's branch refs/heads/branch_6x from David Smiley [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=06ee34c ] LUCENE-7559 : fix indentation of entire file (cherry picked from commit cbc8392)
        Hide
        dsmiley David Smiley added a comment -

        Reopening. Dawid Weiss helpfully pointed out that the OffsetsEnum class in the UnifiedHighlighter should also have it's methods be made public, otherwise someone subclassing to override FieldHighlighter#highlightOffsetsEnums can't really do anything useful. And doing that is the primary motivation for making Passage extensible.

        Additionally, it'd be good to add a basic test in TestUnifiedHighlighterExtensibility showing we got this right.

        Show
        dsmiley David Smiley added a comment - Reopening. Dawid Weiss helpfully pointed out that the OffsetsEnum class in the UnifiedHighlighter should also have it's methods be made public, otherwise someone subclassing to override FieldHighlighter#highlightOffsetsEnums can't really do anything useful. And doing that is the primary motivation for making Passage extensible. Additionally, it'd be good to add a basic test in TestUnifiedHighlighterExtensibility showing we got this right.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 7435ab18786a43f9004c44713446380711137b79 in lucene-solr's branch refs/heads/master from David Smiley
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=7435ab1 ]

        LUCENE-7559: UH: Also expose OffsetsEnum, and test it's exposure

        Show
        jira-bot ASF subversion and git services added a comment - Commit 7435ab18786a43f9004c44713446380711137b79 in lucene-solr's branch refs/heads/master from David Smiley [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=7435ab1 ] LUCENE-7559 : UH: Also expose OffsetsEnum, and test it's exposure
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 4449710a3bcb790b5c33d6803ce97e1e57176043 in lucene-solr's branch refs/heads/branch_6x from David Smiley
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=4449710 ]

        LUCENE-7559: UH: Also expose OffsetsEnum, and test it's exposure

        (cherry picked from commit 7435ab1)

        Show
        jira-bot ASF subversion and git services added a comment - Commit 4449710a3bcb790b5c33d6803ce97e1e57176043 in lucene-solr's branch refs/heads/branch_6x from David Smiley [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=4449710 ] LUCENE-7559 : UH: Also expose OffsetsEnum, and test it's exposure (cherry picked from commit 7435ab1)
        Hide
        dweiss Dawid Weiss added a comment -

        Thanks David, looks good to me!

        Show
        dweiss Dawid Weiss added a comment - Thanks David, looks good to me!

          People

          • Assignee:
            dsmiley David Smiley
            Reporter:
            dsmiley David Smiley
          • Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development