[jira] [Commented] (LUCENE-7395) Query Norm and coordination factor not calculated when PerFieldSimilarityWrapper is used

2016-07-27 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on LUCENE-7395:
-

Commit 22d24969f5b148a78684482592c63e6f976fae6c in lucene-solr's branch 
refs/heads/branch_6x from [~thetaphi]
[ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=22d2496 ]

LUCENE-7395, SOLR-9315: Fix PerFieldSimilarityWrapper to also delegate query 
norm and coordination factor using a default similarity added as ctor param


> Query Norm and coordination factor not calculated when 
> PerFieldSimilarityWrapper is used 
> -
>
> Key: LUCENE-7395
> URL: https://issues.apache.org/jira/browse/LUCENE-7395
> Project: Lucene - Core
>  Issue Type: Bug
>Affects Versions: 5.3.1, 5.4.1
>Reporter: Sascha Markus
>Assignee: Uwe Schindler
> Fix For: 6.2
>
> Attachments: LUCENE-7395.patch
>
>
> If any kind of similarity is defined and therefore the 
> SchemaSimilarityFactory is defined as global similarity the queryNorm is 
> always 1.0
> The PerFieldSimilarityWrapper delegates some of the methods to the desired 
> Similarity but misses to delegate public float queryNorm(float 
> valueForNormalization)
> Instead the IndexReader calls this method on the base class Similarity.
> The result is that all scores are much higher.
> I created a custom similarity which extends ClassicSimilarity.
> To have the calculation fixed I did a local "hotfix"  which always uses the 
> default similarity. Also wrong for some cases but fine in my scenario.
>   @Override
>   public float queryNorm(float valueForNormalization) {
> return get("").queryNorm(valueForNormalization); // use default 
> similarity to calculate
>   }



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

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (LUCENE-7395) Query Norm and coordination factor not calculated when PerFieldSimilarityWrapper is used

2016-07-26 Thread Adrien Grand (JIRA)

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

Adrien Grand commented on LUCENE-7395:
--

+1

> Query Norm and coordination factor not calculated when 
> PerFieldSimilarityWrapper is used 
> -
>
> Key: LUCENE-7395
> URL: https://issues.apache.org/jira/browse/LUCENE-7395
> Project: Lucene - Core
>  Issue Type: Bug
>Affects Versions: 5.3.1, 5.4.1
>Reporter: Sascha Markus
>Assignee: Uwe Schindler
> Fix For: 6.2
>
> Attachments: LUCENE-7395.patch
>
>
> If any kind of similarity is defined and therefore the 
> SchemaSimilarityFactory is defined as global similarity the queryNorm is 
> always 1.0
> The PerFieldSimilarityWrapper delegates some of the methods to the desired 
> Similarity but misses to delegate public float queryNorm(float 
> valueForNormalization)
> Instead the IndexReader calls this method on the base class Similarity.
> The result is that all scores are much higher.
> I created a custom similarity which extends ClassicSimilarity.
> To have the calculation fixed I did a local "hotfix"  which always uses the 
> default similarity. Also wrong for some cases but fine in my scenario.
>   @Override
>   public float queryNorm(float valueForNormalization) {
> return get("").queryNorm(valueForNormalization); // use default 
> similarity to calculate
>   }



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

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (LUCENE-7395) Query Norm and coordination factor not calculated when PerFieldSimilarityWrapper is used

2016-07-25 Thread Uwe Schindler (JIRA)

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

Uwe Schindler commented on LUCENE-7395:
---

I think a required ctor param is also fine. The abstract method is not needed 
as it should always be a constant. Like the other methods, I will make the 
impls final. Thanks Adrien!

As this changes API we can do this in 6.2, not earlier.

> Query Norm and coordination factor not calculated when 
> PerFieldSimilarityWrapper is used 
> -
>
> Key: LUCENE-7395
> URL: https://issues.apache.org/jira/browse/LUCENE-7395
> Project: Lucene - Core
>  Issue Type: Bug
>Affects Versions: 5.3.1, 5.4.1
>Reporter: Sascha Markus
>
> If any kind of similarity is defined and therefore the 
> SchemaSimilarityFactory is defined as global similarity the queryNorm is 
> always 1.0
> The PerFieldSimilarityWrapper delegates some of the methods to the desired 
> Similarity but misses to delegate public float queryNorm(float 
> valueForNormalization)
> Instead the IndexReader calls this method on the base class Similarity.
> The result is that all scores are much higher.
> I created a custom similarity which extends ClassicSimilarity.
> To have the calculation fixed I did a local "hotfix"  which always uses the 
> default similarity. Also wrong for some cases but fine in my scenario.
>   @Override
>   public float queryNorm(float valueForNormalization) {
> return get("").queryNorm(valueForNormalization); // use default 
> similarity to calculate
>   }



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

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (LUCENE-7395) Query Norm and coordination factor not calculated when PerFieldSimilarityWrapper is used

2016-07-25 Thread Adrien Grand (JIRA)

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

Adrien Grand commented on LUCENE-7395:
--

I agree the default impl of coord and queryNorm on PerFieldSimilarity is trappy 
in 6.x. +1 to adding an abstract method or a required constructor argument.

> Query Norm and coordination factor not calculated when 
> PerFieldSimilarityWrapper is used 
> -
>
> Key: LUCENE-7395
> URL: https://issues.apache.org/jira/browse/LUCENE-7395
> Project: Lucene - Core
>  Issue Type: Bug
>Affects Versions: 5.3.1, 5.4.1
>Reporter: Sascha Markus
>
> If any kind of similarity is defined and therefore the 
> SchemaSimilarityFactory is defined as global similarity the queryNorm is 
> always 1.0
> The PerFieldSimilarityWrapper delegates some of the methods to the desired 
> Similarity but misses to delegate public float queryNorm(float 
> valueForNormalization)
> Instead the IndexReader calls this method on the base class Similarity.
> The result is that all scores are much higher.
> I created a custom similarity which extends ClassicSimilarity.
> To have the calculation fixed I did a local "hotfix"  which always uses the 
> default similarity. Also wrong for some cases but fine in my scenario.
>   @Override
>   public float queryNorm(float valueForNormalization) {
> return get("").queryNorm(valueForNormalization); // use default 
> similarity to calculate
>   }



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

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (LUCENE-7395) Query Norm and coordination factor not calculated when PerFieldSimilarityWrapper is used

2016-07-25 Thread Uwe Schindler (JIRA)

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

Uwe Schindler commented on LUCENE-7395:
---

My proposal is to add a second abstarct method like the protected {{get()}}: 
[https://lucene.apache.org/core/6_1_0/core/org/apache/lucene/search/similarities/PerFieldSimilarityWrapper.html#get-java.lang.String-]

In that case it could be named {{abstract Similarity default()}}.

> Query Norm and coordination factor not calculated when 
> PerFieldSimilarityWrapper is used 
> -
>
> Key: LUCENE-7395
> URL: https://issues.apache.org/jira/browse/LUCENE-7395
> Project: Lucene - Core
>  Issue Type: Bug
>Affects Versions: 5.3.1, 5.4.1
>Reporter: Sascha Markus
>
> If any kind of similarity is defined and therefore the 
> SchemaSimilarityFactory is defined as global similarity the queryNorm is 
> always 1.0
> The PerFieldSimilarityWrapper delegates some of the methods to the desired 
> Similarity but misses to delegate public float queryNorm(float 
> valueForNormalization)
> Instead the IndexReader calls this method on the base class Similarity.
> The result is that all scores are much higher.
> I created a custom similarity which extends ClassicSimilarity.
> To have the calculation fixed I did a local "hotfix"  which always uses the 
> default similarity. Also wrong for some cases but fine in my scenario.
>   @Override
>   public float queryNorm(float valueForNormalization) {
> return get("").queryNorm(valueForNormalization); // use default 
> similarity to calculate
>   }



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

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (LUCENE-7395) Query Norm and coordination factor not calculated when PerFieldSimilarityWrapper is used

2016-07-25 Thread Uwe Schindler (JIRA)

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

Uwe Schindler commented on LUCENE-7395:
---

I think the Solr one is a duplicate of this one. The problem already exists in 
Lucene, because it returns a static constant of 1 for those methods.

I have the feeling that PerFieldSimilarityWrapper should provide some 
"fallback" similraity (defaultSimilarity in Solr), too. Same as 
PerFieldAnalyzerWrapper. It is currently abstract and you have to implement the 
"per field" method. But for all those which do not use fields, it should also 
provide some abstract method to return a default for all methods in similarity 
that are not per-field.

> Query Norm and coordination factor not calculated when 
> PerFieldSimilarityWrapper is used 
> -
>
> Key: LUCENE-7395
> URL: https://issues.apache.org/jira/browse/LUCENE-7395
> Project: Lucene - Core
>  Issue Type: Bug
>Affects Versions: 5.3.1, 5.4.1
>Reporter: Sascha Markus
>
> If any kind of similarity is defined and therefore the 
> SchemaSimilarityFactory is defined as global similarity the queryNorm is 
> always 1.0
> The PerFieldSimilarityWrapper delegates some of the methods to the desired 
> Similarity but misses to delegate public float queryNorm(float 
> valueForNormalization)
> Instead the IndexReader calls this method on the base class Similarity.
> The result is that all scores are much higher.
> I created a custom similarity which extends ClassicSimilarity.
> To have the calculation fixed I did a local "hotfix"  which always uses the 
> default similarity. Also wrong for some cases but fine in my scenario.
>   @Override
>   public float queryNorm(float valueForNormalization) {
> return get("").queryNorm(valueForNormalization); // use default 
> similarity to calculate
>   }



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

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (LUCENE-7395) Query Norm and coordination factor not calculated when PerFieldSimilarityWrapper is used

2016-07-25 Thread David Smiley (JIRA)

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

David Smiley commented on LUCENE-7395:
--

Is this a duplicate of SOLR-9315?

> Query Norm and coordination factor not calculated when 
> PerFieldSimilarityWrapper is used 
> -
>
> Key: LUCENE-7395
> URL: https://issues.apache.org/jira/browse/LUCENE-7395
> Project: Lucene - Core
>  Issue Type: Bug
>Affects Versions: 5.3.1, 5.4.1
>Reporter: Sascha Markus
>
> If any kind of similarity is defined and therefore the 
> SchemaSimilarityFactory is defined as global similarity the queryNorm is 
> always 1.0
> The PerFieldSimilarityWrapper delegates some of the methods to the desired 
> Similarity but misses to delegate public float queryNorm(float 
> valueForNormalization)
> Instead the IndexReader calls this method on the base class Similarity.
> The result is that all scores are much higher.
> I created a custom similarity which extends ClassicSimilarity.
> To have the calculation fixed I did a local "hotfix"  which always uses the 
> default similarity. Also wrong for some cases but fine in my scenario.
>   @Override
>   public float queryNorm(float valueForNormalization) {
> return get("").queryNorm(valueForNormalization); // use default 
> similarity to calculate
>   }



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

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org