[ https://issues.apache.org/jira/browse/SOLR-1365?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12744643#action_12744643 ]
Hoss Man commented on SOLR-1365: -------------------------------- FWIW: if a new feature doesn't have any impact on existing users, and has good tests, then i say we might as well commit it for 1.4 (If we were talking about a new feature on an existing component, then i'd be hesitant because of how that feature might impact existing users of that component -- but in this case even if it has bad performance or some small bug that slips through tests, people have to go out of their way to use it) But grant's right: needs tests before it's really a subject for debate. > Add configurable Sweetspot Similarity factory > --------------------------------------------- > > Key: SOLR-1365 > URL: https://issues.apache.org/jira/browse/SOLR-1365 > Project: Solr > Issue Type: New Feature > Affects Versions: 1.3 > Reporter: Kevin Osborn > Priority: Minor > Fix For: 1.5 > > Attachments: SOLR-1365.patch > > > This is some code that I wrote a while back. > Normally, if you use SweetSpotSimilarity, you are going to make it do > something useful by extending SweetSpotSimilarity. So, instead, I made a > factory class and an configurable SweetSpotSimilarty. There are two classes. > SweetSpotSimilarityFactory reads the parameters from schema.xml. It then > creates an instance of VariableSweetSpotSimilarity, which is my custom > SweetSpotSimilarity class. In addition to the standard functions, it also > handles dynamic fields. > So, in schema.xml, you could have something like this: > <similarity class="org.apache.solr.schema.SweetSpotSimilarityFactory"> > <bool name="useHyperbolicTf">true</bool> > <float name="hyperbolicTfFactorsMin">1.0</float> > <float name="hyperbolicTfFactorsMax">1.5</float> > <float name="hyperbolicTfFactorsBase">1.3</float> > <float name="hyperbolicTfFactorsXOffset">2.0</float> > <int name="lengthNormFactorsMin">1</int> > <int name="lengthNormFactorsMax">1</int> > <float name="lengthNormFactorsSteepness">0.5</float> > <int name="lengthNormFactorsMin_description">2</int> > <int name="lengthNormFactorsMax_description">9</int> > <float name="lengthNormFactorsSteepness_description">0.2</float> > <int name="lengthNormFactorsMin_supplierDescription_*">2</int> > <int name="lengthNormFactorsMax_supplierDescription_*">7</int> > <float > name="lengthNormFactorsSteepness_supplierDescription_*">0.4</float> > </similarity> > So, now everything is in a config file instead of having to create your own > subclass. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.