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

Hoss Man commented on SOLR-5561:
--------------------------------

bq. As a result, discountOverlap is not initialized to true, and the default 
behavior is that multiple terms on the same position DO affect the fieldNorm. 
this is not the intended default.

Grr... that really sucks -- and seems easily confusing.

My concern about making this change as written in Isaac's patch is that it 
could cause some very weird inconsistencies for people who upgrade.

My suggestion would be to do the following...

1) in DefaultSimilarityFactory, change the declaration of the discountOverlaps 
variable to default to true for cnsistency (seems like a good idea in general, 
even if we do fix the lifecycle to ensure init() gets called)
2) in IndexSchema.java, where Isaac's patch currently fixes the hadcoded 
construction of a default instance of DefaultSimilarityFactory to always call 
init with empty SolrParams, make the params pased to the init param contingent 
on the value of the luceneMatchVersion -- if it's less then 4.7, pass 
discountOverlaps=false to the init method for backcompat, and if it's 4.7 or 
greater pass an empty set of params (so the factories defaults are used 
correctly)
3) write some tests using trivial solrconfig.xml+schema.xml files with 
hardcoded version match params to verify that the correct behavior is being 
implemented.

thoughts?

> DefaultSimilarity 'init' method is not called, if the similarity plugin is 
> not explicitly declared in the schema
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-5561
>                 URL: https://issues.apache.org/jira/browse/SOLR-5561
>             Project: Solr
>          Issue Type: Bug
>          Components: Schema and Analysis
>    Affects Versions: 4.6
>            Reporter: Isaac Hebsh
>              Labels: similarity
>             Fix For: 4.7, 4.6.1
>
>         Attachments: SOLR-5561.patch
>
>
> As a result, discountOverlap is not initialized to true, and the default 
> behavior is that multiple terms on the same position DO affect the fieldNorm. 
> this is not the intended default.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

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

Reply via email to