Re: [PR] Update lastDoc in ScoreCachingWrappingScorer [lucene]

2024-11-25 Thread via GitHub
msfroh commented on PR #13987: URL: https://github.com/apache/lucene/pull/13987#issuecomment-2498931094 Closing in favor of https://github.com/apache/lucene/pull/14012 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use th

Re: [PR] Update lastDoc in ScoreCachingWrappingScorer [lucene]

2024-11-25 Thread via GitHub
msfroh closed pull request #13987: Update lastDoc in ScoreCachingWrappingScorer URL: https://github.com/apache/lucene/pull/13987 -- 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.

Re: [PR] Update lastDoc in ScoreCachingWrappingScorer [lucene]

2024-11-25 Thread via GitHub
jpountz commented on PR #13987: URL: https://github.com/apache/lucene/pull/13987#issuecomment-2498260663 > In that case, the unit test that I added can be removed This works for me. Sorry for putting you on the wrong track by suggesting that a test is added, it took me a while to unde

Re: [PR] Update lastDoc in ScoreCachingWrappingScorer [lucene]

2024-11-22 Thread via GitHub
msfroh commented on PR #13987: URL: https://github.com/apache/lucene/pull/13987#issuecomment-2494486990 > @msfroh FWIW I'm happy to merge this PR when we remove the double call to LeafCollector#collect on the same doc ID in tests. In that case, the unit test that I added can be remove

Re: [PR] Update lastDoc in ScoreCachingWrappingScorer [lucene]

2024-11-22 Thread via GitHub
jpountz commented on PR #13987: URL: https://github.com/apache/lucene/pull/13987#issuecomment-2494272651 @msfroh FWIW I'm happy to merge this PR when we remove the double call to LeafCollector#collect on the same doc ID in tests. -- This is an automated message from the Apache Git Service

Re: [PR] Update lastDoc in ScoreCachingWrappingScorer [lucene]

2024-11-18 Thread via GitHub
jpountz commented on code in PR #13987: URL: https://github.com/apache/lucene/pull/13987#discussion_r1846948010 ## lucene/core/src/test/org/apache/lucene/search/TestScoreCachingWrappingScorer.java: ## @@ -157,4 +157,40 @@ public void testGetScores() throws Exception { ir.cl

Re: [PR] Update lastDoc in ScoreCachingWrappingScorer [lucene]

2024-11-14 Thread via GitHub
msfroh commented on code in PR #13987: URL: https://github.com/apache/lucene/pull/13987#discussion_r1842729383 ## lucene/core/src/test/org/apache/lucene/search/TestTopFieldCollector.java: ## @@ -359,7 +359,7 @@ public void testTotalHitsWithScore() throws Exception { leafC

Re: [PR] Update lastDoc in ScoreCachingWrappingScorer [lucene]

2024-11-13 Thread via GitHub
msfroh commented on code in PR #13987: URL: https://github.com/apache/lucene/pull/13987#discussion_r1841125795 ## lucene/core/src/test/org/apache/lucene/search/TestScoreCachingWrappingScorer.java: ## @@ -157,4 +157,40 @@ public void testGetScores() throws Exception { ir.clo

Re: [PR] Update lastDoc in ScoreCachingWrappingScorer [lucene]

2024-11-13 Thread via GitHub
msfroh commented on code in PR #13987: URL: https://github.com/apache/lucene/pull/13987#discussion_r1841119813 ## lucene/core/src/test/org/apache/lucene/search/TestScoreCachingWrappingScorer.java: ## @@ -157,4 +157,40 @@ public void testGetScores() throws Exception { ir.clo

Re: [PR] Update lastDoc in ScoreCachingWrappingScorer [lucene]

2024-11-13 Thread via GitHub
mikemccand commented on code in PR #13987: URL: https://github.com/apache/lucene/pull/13987#discussion_r1840911855 ## lucene/core/src/test/org/apache/lucene/search/TestScoreCachingWrappingScorer.java: ## @@ -157,4 +157,40 @@ public void testGetScores() throws Exception { ir

Re: [PR] Update lastDoc in ScoreCachingWrappingScorer [lucene]

2024-11-13 Thread via GitHub
jpountz commented on code in PR #13987: URL: https://github.com/apache/lucene/pull/13987#discussion_r1840904596 ## lucene/core/src/test/org/apache/lucene/search/TestScoreCachingWrappingScorer.java: ## @@ -157,4 +157,40 @@ public void testGetScores() throws Exception { ir.cl

Re: [PR] Update lastDoc in ScoreCachingWrappingScorer [lucene]

2024-11-13 Thread via GitHub
msfroh commented on code in PR #13987: URL: https://github.com/apache/lucene/pull/13987#discussion_r1840841444 ## lucene/core/src/test/org/apache/lucene/search/TestScoreCachingWrappingScorer.java: ## @@ -157,4 +157,40 @@ public void testGetScores() throws Exception { ir.clo

Re: [PR] Update lastDoc in ScoreCachingWrappingScorer [lucene]

2024-11-13 Thread via GitHub
msfroh commented on code in PR #13987: URL: https://github.com/apache/lucene/pull/13987#discussion_r1840841444 ## lucene/core/src/test/org/apache/lucene/search/TestScoreCachingWrappingScorer.java: ## @@ -157,4 +157,40 @@ public void testGetScores() throws Exception { ir.clo

Re: [PR] Update lastDoc in ScoreCachingWrappingScorer [lucene]

2024-11-12 Thread via GitHub
msfroh commented on PR #13987: URL: https://github.com/apache/lucene/pull/13987#issuecomment-2472044035 I think the caching worked fine, albeit in a funny way. When you call `collect()` with any valid doc ID, it invalidates the cache, causing scores to be computed. After the score wa

Re: [PR] Update lastDoc in ScoreCachingWrappingScorer [lucene]

2024-11-12 Thread via GitHub
msfroh commented on PR #13987: URL: https://github.com/apache/lucene/pull/13987#issuecomment-2471331326 Luckily, this is a Lucene 10-only bug (from when `docId()` was removed from `Scorable`). I came across it when updating OpenSearch to support Lucene 10 and needed to refactor some

Re: [PR] Update lastDoc in ScoreCachingWrappingScorer [lucene]

2024-11-12 Thread via GitHub
mikemccand commented on code in PR #13987: URL: https://github.com/apache/lucene/pull/13987#discussion_r1837971840 ## lucene/core/src/test/org/apache/lucene/search/TestTopFieldCollector.java: ## @@ -359,7 +359,7 @@ public void testTotalHitsWithScore() throws Exception { l

Re: [PR] Update lastDoc in ScoreCachingWrappingScorer [lucene]

2024-11-12 Thread via GitHub
mikemccand commented on PR #13987: URL: https://github.com/apache/lucene/pull/13987#issuecomment-2470331708 Wow, good catch @msfroh. Could we maybe add a new test case that explicitly confirms that the wrapped `Scorable`'s `score` method is indeed only called once even if the outer user ca

[PR] Update lastDoc in ScoreCachingWrappingScorer [lucene]

2024-11-11 Thread via GitHub
msfroh opened a new pull request, #13987: URL: https://github.com/apache/lucene/pull/13987 ### Description I noticed that ScoreCachingWrappingScorer never updates lastDoc, so it's always -1. Technically, it's probably fine, since it still ends up returning the same score for multiple