Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-8329

SchemaSimilarityFactory should support a config option for the defaultSimilarity

    Details

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

      Description

      SchemaSimilarityFactory has an implicit default Similarity instance that it uses for any fieldTypes that don't define their own – we should make this default configurable.


      Example of how to use this new option from the javadocs...

         <similarity class="solr.SchemaSimilarityFactory" >
           <str name="defaultSimFromFieldType">type-using-custom-dfr</str>
         </similarity>
         ...
         <fieldType name="type-using-custom-dfr" class="solr.TextField">
           ...
           <similarity class="solr.DFRSimilarityFactory">
             <str name="basicModel">I(F)</str>
             <str name="afterEffect">B</str>
             <str name="normalization">H3</str>
             <float name="mu">900</float>
           </similarity>
         </fieldType>
       

        Issue Links

          Activity

          Hide
          hossman Hoss Man added a comment -

          Attaching my proposal.

          Rather then trying to make SchemaSimilarityFactory configurable with both a factory name and optional configuration, this approach takes in a single fieldType name, and uses the similarity configured for that fieldtype as the default. (with error checking to ensure it has an explicit similarity configured.

          Show
          hossman Hoss Man added a comment - Attaching my proposal. Rather then trying to make SchemaSimilarityFactory configurable with both a factory name and optional configuration, this approach takes in a single fieldType name, and uses the similarity configured for that fieldtype as the default. (with error checking to ensure it has an explicit similarity configured.
          Hide
          jira-bot ASF subversion and git services added a comment -

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

          SOLR-8329: SchemaSimilarityFactory now supports a 'defaultSimFromFieldType' init option for using a fieldType name to identify which Similarity to use as a default

          Show
          jira-bot ASF subversion and git services added a comment - Commit 1715881 from hossman@apache.org in branch 'dev/trunk' [ https://svn.apache.org/r1715881 ] SOLR-8329 : SchemaSimilarityFactory now supports a 'defaultSimFromFieldType' init option for using a fieldType name to identify which Similarity to use as a default
          Hide
          jira-bot ASF subversion and git services added a comment -

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

          SOLR-8329: SchemaSimilarityFactory now supports a 'defaultSimFromFieldType' init option for using a fieldType name to identify which Similarity to use as a default (merge r1715881)

          Show
          jira-bot ASF subversion and git services added a comment - Commit 1715945 from hossman@apache.org in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1715945 ] SOLR-8329 : SchemaSimilarityFactory now supports a 'defaultSimFromFieldType' init option for using a fieldType name to identify which Similarity to use as a default (merge r1715881)
          Hide
          jira-bot 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
          jira-bot 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

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development