Lucene - Core
  1. Lucene - Core
  2. LUCENE-5285

FastVectorHighlighter copies segments scores when splitting segments across multi-valued fields

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.7
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      FastVectorHighlighter copies segments scores when splitting segments across multi-valued fields. This is only a problem when you want to sort the fragments by score. Technically BaseFragmentsBuilder (line 261 in my copy of the source) does the copying.

      Rather than copying the score I think it'd be more right to pull that copying logic into a protected method that child classes (such as ScoreOrderFragmentsBuilder) can override to do more intelligent things. Exactly what that means isn't clear to me at the moment.

      1. LUCENE-5285.patch
        13 kB
        Nik Everett
      2. LUCENE-5285.patch
        11 kB
        Nik Everett

        Activity

        Hide
        Nik Everett added a comment -

        This adds a boost member to FieldFragLists' SubInfo which is its contribution to the WeightedFragInfo's boost. When splitting WeightedFragInfo across fields the new info's score is the sum of the scores of all SubInfos it contains.

        Show
        Nik Everett added a comment - This adds a boost member to FieldFragLists' SubInfo which is its contribution to the WeightedFragInfo's boost. When splitting WeightedFragInfo across fields the new info's score is the sum of the scores of all SubInfos it contains.
        Hide
        Nik Everett added a comment -

        I realized last night that I did the WeightedFragList incorrectly in that patch. I'll upload another one as time permits.

        Show
        Nik Everett added a comment - I realized last night that I did the WeightedFragList incorrectly in that patch. I'll upload another one as time permits.
        Hide
        Nik Everett added a comment -

        New patch fixes my broken WeightedFragList change and expands WeightedFragListBuilderTest to catch the broken implementation.

        Show
        Nik Everett added a comment - New patch fixes my broken WeightedFragList change and expands WeightedFragListBuilderTest to catch the broken implementation.
        Hide
        Adrien Grand added a comment -

        I think the patch is good. I'm just a bit confused by WeightedFragListBuilderTest, shouldn't the "=" in totalSubInfoBoost = subInfo.getBoost(); be a "+=" actually?

        Show
        Adrien Grand added a comment - I think the patch is good. I'm just a bit confused by WeightedFragListBuilderTest, shouldn't the "=" in totalSubInfoBoost = subInfo.getBoost(); be a "+=" actually?
        Hide
        Nik Everett added a comment -

        Ah! += yeah. This fixes it and improves the test so it would notice the difference.

        Show
        Nik Everett added a comment - Ah! += yeah. This fixes it and improves the test so it would notice the difference.
        Hide
        ASF subversion and git services added a comment -

        Commit 1546603 from Adrien Grand in branch 'dev/trunk'
        [ https://svn.apache.org/r1546603 ]

        LUCENE-5285: Improved highlighting of multi-valued fields with FastVectorHighlighter.

        Show
        ASF subversion and git services added a comment - Commit 1546603 from Adrien Grand in branch 'dev/trunk' [ https://svn.apache.org/r1546603 ] LUCENE-5285 : Improved highlighting of multi-valued fields with FastVectorHighlighter.
        Hide
        ASF subversion and git services added a comment -

        Commit 1546607 from Adrien Grand in branch 'dev/branches/branch_4x'
        [ https://svn.apache.org/r1546607 ]

        LUCENE-5285: Improved highlighting of multi-valued fields with FastVectorHighlighter.

        Show
        ASF subversion and git services added a comment - Commit 1546607 from Adrien Grand in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1546607 ] LUCENE-5285 : Improved highlighting of multi-valued fields with FastVectorHighlighter.
        Hide
        Adrien Grand added a comment -

        Committed, thanks Nik!

        Show
        Adrien Grand added a comment - Committed, thanks Nik!

          People

          • Assignee:
            Adrien Grand
            Reporter:
            Nik Everett
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development