LUCENE-4465: Let ConstantScoreQuery's Scorer return its child scorer.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1433652 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2013-01-15 21:16:49 +00:00
parent a097a01f48
commit f485798685
2 changed files with 13 additions and 0 deletions

View File

@ -353,6 +353,9 @@ Bug Fixes
* LUCENE-4671: Fix CharsRef.subSequence method. (Tim Smith via Robert Muir) * LUCENE-4671: Fix CharsRef.subSequence method. (Tim Smith via Robert Muir)
* LUCENE-4465: Let ConstantScoreQuery's Scorer return its child scorer.
(selckin via Uwe Schindler)
Changes in Runtime Behavior Changes in Runtime Behavior
* LUCENE-4586: Change default ResultMode of FacetRequest to PER_NODE_IN_TREE. * LUCENE-4586: Change default ResultMode of FacetRequest to PER_NODE_IN_TREE.

View File

@ -24,6 +24,8 @@ import org.apache.lucene.util.Bits;
import org.apache.lucene.util.ToStringUtils; import org.apache.lucene.util.ToStringUtils;
import java.io.IOException; import java.io.IOException;
import java.util.Collection;
import java.util.Collections;
import java.util.Set; import java.util.Set;
/** /**
@ -248,6 +250,14 @@ public class ConstantScoreQuery extends Query {
return super.score(collector, max, firstDocID); return super.score(collector, max, firstDocID);
} }
} }
@Override
public Collection<ChildScorer> getChildren() {
if (docIdSetIterator instanceof Scorer)
return Collections.singletonList(new ChildScorer((Scorer) docIdSetIterator, "constant"));
else
return Collections.emptyList();
}
} }
@Override @Override