Lucene - Core
  1. Lucene - Core
  2. LUCENE-2828

SimilarityDelegator broke back-compat for subclasses overriding lengthNorm

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.9, 2.9.1, 2.9.2, 2.9.3, 2.9.4, 3.0, 3.0.1, 3.0.2, 3.0.3
    • Fix Version/s: 2.9.5, 3.0.4
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      In LUCENE-1420, we added Similarity.computeNorm to let the norm computation have access to the raw information (length, boost, etc.).

      But this class broke back compat with SimilarityDelegator. We did add computeNorm there, but, it's impl just forwards to the delegee's computeNorm. In the case where a subclass of SimilarityDelegator overrides lengthNorm, that method will no longer be invoked.

      Not quite sure how to fix this since, somehow, we have to determine whether the delegee's impl of computeNorm should be favored over the subclasses impl of the "legacy" lengthNorm.

      1. LUCENE-2828.patch
        1 kB
        Michael McCandless

        Activity

        Hide
        Simon Willnauer added a comment -

        I think we can close this now - I don't see another 2.9 / 3.0 release happening?

        Show
        Simon Willnauer added a comment - I think we can close this now - I don't see another 2.9 / 3.0 release happening?
        Hide
        Michael McCandless added a comment -

        We won't fix this for 3.x or 4.0, since we've deprecated SimilarityDelegator, and forced hard cutover from Sim.lengthNorm -> Sim.computeNorm (LUCENE-2854).

        But I'll leave this open in case we do another 2.9/3.0 release.

        Show
        Michael McCandless added a comment - We won't fix this for 3.x or 4.0, since we've deprecated SimilarityDelegator, and forced hard cutover from Sim.lengthNorm -> Sim.computeNorm ( LUCENE-2854 ). But I'll leave this open in case we do another 2.9/3.0 release.
        Hide
        Michael McCandless added a comment -

        Patch w/ test case showing the failure.

        Show
        Michael McCandless added a comment - Patch w/ test case showing the failure.

          People

          • Assignee:
            Robert Muir
            Reporter:
            Michael McCandless
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development