Solr
  1. Solr
  2. SOLR-8057 Change default Sim to BM25 (w/backcompat config handling)
  3. SOLR-8239

Deprecate/rename DefaultSimilarityFactory to ClassicSimilarityFactory and remove DefaultSimilarityFactory in trunk

    Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.4, 6.0
    • Component/s: None
    • Labels:
      None

      Description

      As outlined in parent issue...

      • clone DefaultSimilarityFactory -> ClassicSimilarityFactory
      • prune DefaultSimilarityFactory down to a trivial subclass of ClassicSimilarityFactory
        • make it log a warning on init
      • change default behavior of IndexSchema to use ClassicSimilarityFactory directly
      • mark DefaultSimilarityFactory as deprecated in 5.x, remove from trunk/6.0

      This should put us in a better position moving forward of having the facotry names directly map to the underlying implementation, leaving less ambiguity when an explicit factory is specified in the schema.xml (either as the main similarity, or as a per field similarity)

        Issue Links

          Activity

          Hide
          Hoss Man added a comment -

          Before applying this patch, run the following svn commands...

          svn cp solr/core/src/java/org/apache/solr/search/similarities/DefaultSimilarityFactory.java solr/core/src/java/org/apache/solr/search/similarities/ClassicSimilarityFactory.java
          svn mv solr/core/src/test/org/apache/solr/search/similarities/TestDefaultSimilarityFactory.java solr/core/src/test/org/apache/solr/search/similarities/TestClassicSimilarityFactory.java
          

          Changes included in patch...

          • clone DefaultSimilarityFactory to ClassicSimilarityFactory
          • prune DefaultSimilarityFactory down to a trivial subclass of ClassicSimilarityFactory
            • class is marked deprecated with link to ClassicSimilarityFactory
            • init metod logs a warning about deprecation / new name if used
            • class can be removed from trunk after backporting
          • Change IndexSchema to use ClassicSimilarityFactory by default instead of DefaultSimilarityFactory
          • Change SweetSpotSimilarityFactory to subclass ClassicSimilarityFactory
          • update jdocs for SchemaSimilarityFactory & TestNonDefinedSimilarityFactory to refer to ClassicSimilarity/Factory
          • update TestSchemaSimilarityResource & (solrj's) SchemaTest to expect ClassicSimilarityFactory as default
          • remove gratuitious refrences to DefaultSimilarity / DefaultSimilarityFactory from various test schema files
          • rename TestDefaultSimilarityFactory to TestClassicSimilarityFactory
            • update javadocs to make it clear this is actually testing explicit uses of the factory on a per-fieldtype basis via SchemaSimilarityFactory
            • update test to verify explicit configurations of both ClassicSimilarityFactory & DefaultSimilarityFactory
              • DefaultSimilarityFactory assertions can be removed from trunk after backporting
            • refactor existing assertions to legeral two-arg getSimilarity method in superclass
            • additions to schema-tfidf.xml as needed for new assertions
              • did some re-org of schema-tfidf.xml for readability
          Show
          Hoss Man added a comment - Before applying this patch, run the following svn commands... svn cp solr/core/src/java/org/apache/solr/search/similarities/DefaultSimilarityFactory.java solr/core/src/java/org/apache/solr/search/similarities/ClassicSimilarityFactory.java svn mv solr/core/src/test/org/apache/solr/search/similarities/TestDefaultSimilarityFactory.java solr/core/src/test/org/apache/solr/search/similarities/TestClassicSimilarityFactory.java Changes included in patch... clone DefaultSimilarityFactory to ClassicSimilarityFactory prune DefaultSimilarityFactory down to a trivial subclass of ClassicSimilarityFactory class is marked deprecated with link to ClassicSimilarityFactory init metod logs a warning about deprecation / new name if used class can be removed from trunk after backporting Change IndexSchema to use ClassicSimilarityFactory by default instead of DefaultSimilarityFactory Change SweetSpotSimilarityFactory to subclass ClassicSimilarityFactory update jdocs for SchemaSimilarityFactory & TestNonDefinedSimilarityFactory to refer to ClassicSimilarity/Factory update TestSchemaSimilarityResource & (solrj's) SchemaTest to expect ClassicSimilarityFactory as default remove gratuitious refrences to DefaultSimilarity / DefaultSimilarityFactory from various test schema files rename TestDefaultSimilarityFactory to TestClassicSimilarityFactory update javadocs to make it clear this is actually testing explicit uses of the factory on a per-fieldtype basis via SchemaSimilarityFactory update test to verify explicit configurations of both ClassicSimilarityFactory & DefaultSimilarityFactory DefaultSimilarityFactory assertions can be removed from trunk after backporting refactor existing assertions to legeral two-arg getSimilarity method in superclass additions to schema-tfidf.xml as needed for new assertions did some re-org of schema-tfidf.xml for readability
          Hide
          ASF subversion and git services added a comment -

          Commit 1712840 from hossman@apache.org in branch 'dev/trunk'
          [ https://svn.apache.org/r1712840 ]

          SOLR-8239: Added ClassicSimilarityFactory, marked DefaultSimilarityFactory as deprecated

          Show
          ASF subversion and git services added a comment - Commit 1712840 from hossman@apache.org in branch 'dev/trunk' [ https://svn.apache.org/r1712840 ] SOLR-8239 : Added ClassicSimilarityFactory, marked DefaultSimilarityFactory as deprecated
          Hide
          ASF subversion and git services added a comment -

          Commit 1712845 from hossman@apache.org in branch 'dev/trunk'
          [ https://svn.apache.org/r1712845 ]

          SOLR-8239: reverting r1712840 from trunk – backport to 5x was more complicated then I expected because aparently DefaultSimilarity deprecation with ClassicSimilarity was never backported? want to clarify/resolve that before moving forward here

          Show
          ASF subversion and git services added a comment - Commit 1712845 from hossman@apache.org in branch 'dev/trunk' [ https://svn.apache.org/r1712845 ] SOLR-8239 : reverting r1712840 from trunk – backport to 5x was more complicated then I expected because aparently DefaultSimilarity deprecation with ClassicSimilarity was never backported? want to clarify/resolve that before moving forward here
          Hide
          ASF subversion and git services added a comment -

          Commit 1712979 from hossman@apache.org in branch 'dev/trunk'
          [ https://svn.apache.org/r1712979 ]

          SOLR-8239: Added ClassicSimilarityFactory, marked DefaultSimilarityFactory as deprecated

          Show
          ASF subversion and git services added a comment - Commit 1712979 from hossman@apache.org in branch 'dev/trunk' [ https://svn.apache.org/r1712979 ] SOLR-8239 : Added ClassicSimilarityFactory, marked DefaultSimilarityFactory as deprecated
          Hide
          ASF subversion and git services added a comment -

          Commit 1712992 from hossman@apache.org in branch 'dev/branches/branch_5x'
          [ https://svn.apache.org/r1712992 ]

          SOLR-8239: Added ClassicSimilarityFactory, marked DefaultSimilarityFactory as deprecated (merge r1712845)

          Show
          ASF subversion and git services added a comment - Commit 1712992 from hossman@apache.org in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1712992 ] SOLR-8239 : Added ClassicSimilarityFactory, marked DefaultSimilarityFactory as deprecated (merge r1712845)
          Hide
          ASF subversion and git services added a comment -

          Commit 1713039 from hossman@apache.org in branch 'dev/trunk'
          [ https://svn.apache.org/r1713039 ]

          SOLR-8239: remove (deprecated) DefaultSimilarityFactory from trunk

          Show
          ASF subversion and git services added a comment - Commit 1713039 from hossman@apache.org in branch 'dev/trunk' [ https://svn.apache.org/r1713039 ] SOLR-8239 : remove (deprecated) DefaultSimilarityFactory from trunk
          Hide
          Varun Thacker added a comment -

          There is a small typo in the upgrading from solr 5.x section:

          "Several changes have been made regarding the "Similiarity" used in Solr, " - Similiarity -> Similiarity

          Show
          Varun Thacker added a comment - There is a small typo in the upgrading from solr 5.x section: "Several changes have been made regarding the "Similiarity" used in Solr, " - Similiarity -> Similiarity
          Hide
          ASF subversion and git services added a comment -

          Commit 1715950 from hossman@apache.org in branch 'dev/trunk'
          [ https://svn.apache.org/r1715950 ]

          SOLR-8261 + SOLR-8329 + SOLR-8239: update 6.0 upgrade instructions to note new defaultSimFromFieldType option for people who want backcompat behavior even if luceneMatchVersion is increased. Also fixed some typos

          Show
          ASF subversion and git services added a comment - Commit 1715950 from hossman@apache.org in branch 'dev/trunk' [ https://svn.apache.org/r1715950 ] SOLR-8261 + SOLR-8329 + SOLR-8239 : update 6.0 upgrade instructions to note new defaultSimFromFieldType option for people who want backcompat behavior even if luceneMatchVersion is increased. Also fixed some typos
          Hide
          Alexandre Rafalovitch added a comment - - edited

          Spelling error in CHANGES.txt:
          > DefaultSimilarityFactory has been renamed to ClassicSimilarityFactory to *mach*

          Show
          Alexandre Rafalovitch added a comment - - edited Spelling error in CHANGES.txt: > DefaultSimilarityFactory has been renamed to ClassicSimilarityFactory to * mach *
          Hide
          ASF subversion and git services added a comment -

          Commit 1716501 from hossman@apache.org in branch 'dev/trunk'
          [ https://svn.apache.org/r1716501 ]

          SOLR-8239: CHANGES typo

          Show
          ASF subversion and git services added a comment - Commit 1716501 from hossman@apache.org in branch 'dev/trunk' [ https://svn.apache.org/r1716501 ] SOLR-8239 : CHANGES typo
          Hide
          ASF subversion and git services added a comment -

          Commit 1716502 from hossman@apache.org in branch 'dev/branches/branch_5x'
          [ https://svn.apache.org/r1716502 ]

          SOLR-8239: CHANGES typo (merge r1716501)

          Show
          ASF subversion and git services added a comment - Commit 1716502 from hossman@apache.org in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1716502 ] SOLR-8239 : CHANGES typo (merge r1716501)
          Hide
          ASF subversion and git services added a comment -

          Commit 1716503 from hossman@apache.org in branch 'dev/branches/lucene_solr_5_4'
          [ https://svn.apache.org/r1716503 ]

          SOLR-8239: CHANGES typo (merge r1716501)

          Show
          ASF subversion and git services added a comment - Commit 1716503 from hossman@apache.org in branch 'dev/branches/lucene_solr_5_4' [ https://svn.apache.org/r1716503 ] SOLR-8239 : CHANGES typo (merge r1716501)

            People

            • Assignee:
              Hoss Man
              Reporter:
              Hoss Man
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development