[ 
https://issues.apache.org/jira/browse/LUCENE-6023?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14183754#comment-14183754
 ] 

Hafiz M Hamid commented on LUCENE-6023:
---------------------------------------

That would require copy/pasting code from TFIDFSimilarity into our new 
Similarity implementation which we want to avoid as that might make it hard to 
upgrade in future. Majority of the DefaultSimilarity/TFIDFSimilarity 
functionality is still useful for us, we only want to override computation of a 
single component (i.e. fieldNorm) of existing tf-idf based scoring formula. 
Also changing it in the original code would allow others to benefit from it 
without posing any risks.

I'm curious why we even have "final" modifiers on these methods. Unless it 
hurts the design/function of the class, there shouldn't be any harm in letting 
people extend/override the methods.


> Remove "final" modifier from four methods of TFIDFSimilarity class to make 
> them overridable.
> --------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-6023
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6023
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: core/query/scoring
>    Affects Versions: 4.2.1
>            Reporter: Hafiz M Hamid
>              Labels: similarity
>             Fix For: 4.2.1
>
>
> The TFIDFSimilarity has the following four of its public methods marked 
> "final" which is keeping us from overriding these methods. Apparently there 
> doesn't seem to be an obvious reason for keeping these methods 
> non-overridable.
> Here are the four methods:
> computeNorm()
> computeWeight()
> exactSimScorer()
> sloppySimScorer()



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to