jimczi commented on issue #15239: URL: https://github.com/apache/lucene/issues/15239#issuecomment-3355443168
The tests fail because `setMinCompetitiveScore` is being called when the score mode is not compatible. It is the responsibility of the collector to prevent such calls, so this is not a bug. For example, see the [`MultiCollector`](https://github.com/apache/lucene/blob/cd88a97a63a97dc857d692ec3eb73b229bb5f372/lucene/core/src/java/org/apache/lucene/search/MultiCollector.java#L197). When passing the scorer into the leaf collector, you need to wrap it so that it ignores calls to `setMinCompetitiveScore`. You can fix this by changing the simple collector in your test as follows: ```java @Override public void setScorer(Scorable scorer) throws IOException { scorer = new FilterScorable(scorer) { @Override public void setMinCompetitiveScore(float minScore) throws IOException { // Ignore calls to setMinCompetitiveScore } }; leafIn.setScorer(scorer); } ``` Alternatively, you can use the option provided by the `TopScoreDocCollectorManager`. If you want to see all hits, simply set the `totalHitsThreshold` to `Integer.MAX_VALUE`. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
