factor out (public static) MultiCollector.scoreMode(Collector[]) method

This commit is contained in:
Christine Poerschke 2024-02-21 17:37:12 +00:00
parent 568c8eba97
commit ada853e3df
1 changed files with 6 additions and 2 deletions

View File

@ -101,8 +101,7 @@ public class MultiCollector implements Collector {
this.cacheScores = numNeedsScores >= 2;
}
@Override
public ScoreMode scoreMode() {
public static ScoreMode scoreMode(Collector[] collectors) {
ScoreMode scoreMode = null;
for (Collector collector : collectors) {
if (scoreMode == null) {
@ -120,6 +119,11 @@ public class MultiCollector implements Collector {
return scoreMode;
}
@Override
public ScoreMode scoreMode() {
return scoreMode(collectors);
}
@Override
public LeafCollector getLeafCollector(LeafReaderContext context) throws IOException {
final List<LeafCollector> leafCollectors = new ArrayList<>(collectors.length);