mirror of https://github.com/apache/lucene.git
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:
parent
a097a01f48
commit
f485798685
|
@ -352,6 +352,9 @@ Bug Fixes
|
||||||
DEFAULT_ARTICLES list passed to ElisionFilter. (David Leunen via Steve Rowe)
|
DEFAULT_ARTICLES list passed to ElisionFilter. (David Leunen via Steve Rowe)
|
||||||
|
|
||||||
* 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
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue