You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2022/05/02 13:35:27 UTC

[GitHub] [lucene] jpountz opened a new pull request, #860: LUCENE-10553: Fix WANDScorer's handling of 0 and +Infty.

jpountz opened a new pull request, #860:
URL: https://github.com/apache/lucene/pull/860

   The computation of the scaling factor has special cases for these two values,
   but the current logic is backwards.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] romseygeek merged pull request #860: LUCENE-10553: Fix WANDScorer's handling of 0 and +Infty.

Posted by GitBox <gi...@apache.org>.
romseygeek merged PR #860:
URL: https://github.com/apache/lucene/pull/860


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] jpountz commented on a diff in pull request #860: LUCENE-10553: Fix WANDScorer's handling of 0 and +Infty.

Posted by GitBox <gi...@apache.org>.
jpountz commented on code in PR #860:
URL: https://github.com/apache/lucene/pull/860#discussion_r864859715


##########
lucene/core/src/java/org/apache/lucene/search/WANDScorer.java:
##########
@@ -86,7 +86,6 @@ static int scalingFactor(float f) {
    * sure we do not miss any matches.
    */
   static long scaleMaxScore(float maxScore, int scalingFactor) {
-    assert scalingFactor(maxScore) >= scalingFactor;

Review Comment:
   Yeah. We wouldn't want to do this check at search time because these max scores are computed lazily based on lists of (freq,norm) pairs, but maybe we could add the restriction on the Scorer#getMaxScore API that max scores must be non decreasing as upTo increases.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] romseygeek commented on a diff in pull request #860: LUCENE-10553: Fix WANDScorer's handling of 0 and +Infty.

Posted by GitBox <gi...@apache.org>.
romseygeek commented on code in PR #860:
URL: https://github.com/apache/lucene/pull/860#discussion_r864686490


##########
lucene/core/src/java/org/apache/lucene/search/WANDScorer.java:
##########
@@ -86,7 +86,6 @@ static int scalingFactor(float f) {
    * sure we do not miss any matches.
    */
   static long scaleMaxScore(float maxScore, int scalingFactor) {
-    assert scalingFactor(maxScore) >= scalingFactor;

Review Comment:
   > However it is currently not illegal for a clause to return a higher score on a subset of doc IDs than on the entire doc ID space
   
   OK.  Maybe this is something we can think about restricting more in the future?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] jpountz commented on a diff in pull request #860: LUCENE-10553: Fix WANDScorer's handling of 0 and +Infty.

Posted by GitBox <gi...@apache.org>.
jpountz commented on code in PR #860:
URL: https://github.com/apache/lucene/pull/860#discussion_r864517912


##########
lucene/core/src/java/org/apache/lucene/search/WANDScorer.java:
##########
@@ -86,7 +86,6 @@ static int scalingFactor(float f) {
    * sure we do not miss any matches.
    */
   static long scaleMaxScore(float maxScore, int scalingFactor) {
-    assert scalingFactor(maxScore) >= scalingFactor;

Review Comment:
   Good question, I'm a bit torn about it too and it's related to the comment that I updated. This assertion verifies that the max score of a sub clause over a range of doc IDs cannot be greater than the sum of the max scores of sub clauses over the entire doc ID range. However it is currently not illegal for a clause to return a higher score on a subset of doc IDs than on the entire doc ID space, so I was a bit nervous about keeping this assertion.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [lucene] romseygeek commented on a diff in pull request #860: LUCENE-10553: Fix WANDScorer's handling of 0 and +Infty.

Posted by GitBox <gi...@apache.org>.
romseygeek commented on code in PR #860:
URL: https://github.com/apache/lucene/pull/860#discussion_r863538587


##########
lucene/core/src/java/org/apache/lucene/search/WANDScorer.java:
##########
@@ -86,7 +86,6 @@ static int scalingFactor(float f) {
    * sure we do not miss any matches.
    */
   static long scaleMaxScore(float maxScore, int scalingFactor) {
-    assert scalingFactor(maxScore) >= scalingFactor;

Review Comment:
   Does this assertion no longer hold? I'm a bit nervous about removing it, as it tripping was what alerted us to the bug in the first place.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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