You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "Bruno Roustant (Jira)" <ji...@apache.org> on 2021/01/04 11:00:00 UTC

[jira] [Commented] (LUCENE-9646) Set BM25Similarity discountOverlaps via the constructor

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

Bruno Roustant commented on LUCENE-9646:
----------------------------------------

I see that ClassicSimilarity constructor has a comment "Sole constructor: parameter-free". I don't know why it was designed to have this parameter free constructor with the same setDiscountOverlaps setter inherited from TFIDFSimilarity. Based on the usages of this setter, these similarities could indeed be immutable instead.

> Set BM25Similarity discountOverlaps via the constructor
> -------------------------------------------------------
>
>                 Key: LUCENE-9646
>                 URL: https://issues.apache.org/jira/browse/LUCENE-9646
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: core/search
>    Affects Versions: master (9.0)
>            Reporter: Patrick Marty
>            Priority: Trivial
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> BM25Similarity discountOverlaps parameter is true by default.
> It can be set with {{org.apache.lucene.search.similarities.BM25Similarity#setDiscountOverlaps}} method.
> But this method makes BM25Similarity mutable.
>  
> discountOverlaps should be set via the constructor and {{setDiscountOverlaps}} method should be removed to make BM25Similarity immutable.
>  
> PR https://github.com/apache/lucene-solr/pull/2161



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org