Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.2
    • Component/s: core/search
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      In LUCENE-6919 (Lucene 5.5), ScoringWrapperSpans was modified in such a way that made the existence of this class pointless, and possibly broke anyone who was using it as it's SimScorer argument isn't used anymore. We should now delete it. SpanWeight has getSimScorer() so people can customize the SimScorer that way.

      Another small change I observe to improve is have SpanWeight.buildSimWeight's last line use the existing Similarity that has already been populated on the field?

        Activity

        Hide
        dsmiley David Smiley added a comment -

        Adrien Grand any opinions; you committed LUCENE-6919? Alan Woodward? (you added this class originally)

        Show
        dsmiley David Smiley added a comment - Adrien Grand any opinions; you committed LUCENE-6919 ? Alan Woodward ? (you added this class originally)
        Hide
        romseygeek Alan Woodward added a comment -

        +1 to remove it

        Show
        romseygeek Alan Woodward added a comment - +1 to remove it
        Hide
        jpountz Adrien Grand added a comment -

        +1 to remove too

        Show
        jpountz Adrien Grand added a comment - +1 to remove too
        Hide
        dsmiley David Smiley added a comment -

        It's actually used within both SpanNot & SpanOr getSpans()... but of course this wrapper effectively does nothing. In the attached patch I remove this useless class as well as remove uses of it. Tests pass.

        Since it does nothing (which is itself misleading if anyone actually is using it) and it seems obscure, I propose not keeping it with deprecation in 6x.

        Proposed message:

        In API Changes:

        • ScoringWrapperSpans was removed since it has no purpose or effect as of Lucene 5.5.

        In other:

        • LUCENE-7384: Removed ScoringWrapperSpans. And tweaked SpanWeight.buildSimWeight to reuse the existing similarity instead of creating a new one. (David Smiley)
        Show
        dsmiley David Smiley added a comment - It's actually used within both SpanNot & SpanOr getSpans()... but of course this wrapper effectively does nothing. In the attached patch I remove this useless class as well as remove uses of it. Tests pass. Since it does nothing (which is itself misleading if anyone actually is using it) and it seems obscure, I propose not keeping it with deprecation in 6x. Proposed message: In API Changes: ScoringWrapperSpans was removed since it has no purpose or effect as of Lucene 5.5. In other: LUCENE-7384 : Removed ScoringWrapperSpans. And tweaked SpanWeight.buildSimWeight to reuse the existing similarity instead of creating a new one. (David Smiley)
        Hide
        jpountz Adrien Grand added a comment -

        +1

        Show
        jpountz Adrien Grand added a comment - +1
        Hide
        dsmiley David Smiley added a comment -

        Before I commit its removal, Alan Woodward do you recall why these queries needed/used the now-defunct ScoringWrapperSpans?

        Show
        dsmiley David Smiley added a comment - Before I commit its removal, Alan Woodward do you recall why these queries needed/used the now-defunct ScoringWrapperSpans?
        Hide
        romseygeek Alan Woodward added a comment -

        When I merged Spans and SpanScorer, I needed a way of setting a docScorer object on a Spans after it had been created - for example, if the exclusion Spans in a SpanNotQuery is empty, then we just return the inclusion Spans, but because the docScorer was only being set on the root Spans object you could end up with a null scorer. Now that SpanScorer and Spans are separate again, and SpanScorer holds the similarity objects, we don't need to deal with this any more.

        Show
        romseygeek Alan Woodward added a comment - When I merged Spans and SpanScorer, I needed a way of setting a docScorer object on a Spans after it had been created - for example, if the exclusion Spans in a SpanNotQuery is empty, then we just return the inclusion Spans, but because the docScorer was only being set on the root Spans object you could end up with a null scorer. Now that SpanScorer and Spans are separate again, and SpanScorer holds the similarity objects, we don't need to deal with this any more.
        Hide
        jira-bot ASF subversion and git services added a comment -

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

        LUCENE-7384: Remove defunct ScoringWrapperSpans.

        Show
        jira-bot ASF subversion and git services added a comment - Commit abb81e4dedd05606f91be809d702be0ca8be1caf in lucene-solr's branch refs/heads/master from David Smiley [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=abb81e4 ] LUCENE-7384 : Remove defunct ScoringWrapperSpans.
        Hide
        jira-bot ASF subversion and git services added a comment -

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

        LUCENE-7384: Tweak SpanWeight.buildSimWeight to reuse the existing similarity.

        Show
        jira-bot ASF subversion and git services added a comment - Commit 180f9562aa9c1e271d8dce48ac5695d0612bf808 in lucene-solr's branch refs/heads/master from David Smiley [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=180f956 ] LUCENE-7384 : Tweak SpanWeight.buildSimWeight to reuse the existing similarity.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 8904c3a952fa9cc56d95161c263096e22226a9d5 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=8904c3a ]

        LUCENE-7384: Remove defunct ScoringWrapperSpans.
        (cherry picked from commit abb81e4)

        Show
        jira-bot ASF subversion and git services added a comment - Commit 8904c3a952fa9cc56d95161c263096e22226a9d5 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=8904c3a ] LUCENE-7384 : Remove defunct ScoringWrapperSpans. (cherry picked from commit abb81e4)
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit dfa3f61ecf501014836ff8d015a1548715198a05 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=dfa3f61 ]

        LUCENE-7384: Tweak SpanWeight.buildSimWeight to reuse the existing similarity.
        (cherry picked from commit 180f956)

        Show
        jira-bot ASF subversion and git services added a comment - Commit dfa3f61ecf501014836ff8d015a1548715198a05 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=dfa3f61 ] LUCENE-7384 : Tweak SpanWeight.buildSimWeight to reuse the existing similarity. (cherry picked from commit 180f956)
        Hide
        jira-bot ASF subversion and git services added a comment -

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

        LUCENE-7384: Remove defunct ScoringWrapperSpans.

        Show
        jira-bot ASF subversion and git services added a comment - Commit abb81e4dedd05606f91be809d702be0ca8be1caf in lucene-solr's branch refs/heads/apiv2 from David Smiley [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=abb81e4 ] LUCENE-7384 : Remove defunct ScoringWrapperSpans.
        Hide
        jira-bot ASF subversion and git services added a comment -

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

        LUCENE-7384: Tweak SpanWeight.buildSimWeight to reuse the existing similarity.

        Show
        jira-bot ASF subversion and git services added a comment - Commit 180f9562aa9c1e271d8dce48ac5695d0612bf808 in lucene-solr's branch refs/heads/apiv2 from David Smiley [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=180f956 ] LUCENE-7384 : Tweak SpanWeight.buildSimWeight to reuse the existing similarity.
        Hide
        mikemccand Michael McCandless added a comment -

        Bulk close resolved issues after 6.2.0 release.

        Show
        mikemccand Michael McCandless added a comment - Bulk close resolved issues after 6.2.0 release.

          People

          • Assignee:
            dsmiley David Smiley
            Reporter:
            dsmiley David Smiley
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development