LUCENE-4023: Forward port DisjunctionMaxScorer's access to children

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1331303 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2012-04-27 08:55:28 +00:00
parent efcd62f311
commit a5bd0e63cb
1 changed files with 11 additions and 0 deletions

View File

@ -17,6 +17,9 @@ package org.apache.lucene.search;
*/
import java.io.IOException;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
/**
* The Scorer for DisjunctionMaxQuery. The union of all documents generated by the the subquery scorers
@ -183,4 +186,12 @@ class DisjunctionMaxScorer extends Scorer {
}
}
@Override
public Collection<ChildScorer> getChildren() {
final ChildScorer[] children = new ChildScorer[numScorers];
for (int i = 0; i< numScorers; i++) {
children[i] = new ChildScorer(subScorers[i], BooleanClause.Occur.SHOULD.toString());
}
return Collections.unmodifiableCollection(Arrays.asList(children));
}
}