mirror of https://github.com/apache/lucene.git
improve comments; throw UOE from BS.freq() since it's not a doc-at-a-time scorer
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1384852 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
71a8203a06
commit
67141af6cd
|
@ -333,6 +333,13 @@ public class BooleanQuery extends Query implements Iterable<BooleanClause> {
|
|||
}
|
||||
}
|
||||
|
||||
// NOTE: we could also use BooleanScorer, if we knew
|
||||
// this BooleanQuery was embedded in another
|
||||
// BooleanQuery that was also using BooleanScorer (ie,
|
||||
// BooleanScorer can nest). But this is hard to
|
||||
// detect and we never do so today... (ie, we only
|
||||
// return BooleanScorer for topScorer):
|
||||
|
||||
// Check if we can return a BooleanScorer
|
||||
if (!scoreDocsInOrder && topScorer && required.size() == 0) {
|
||||
return new BooleanScorer(this, disableCoord, minNrShouldMatch, optional, prohibited, maxCoord);
|
||||
|
|
|
@ -254,7 +254,12 @@ final class BooleanScorer extends Scorer {
|
|||
// clauses
|
||||
//&& (current.bits & requiredMask) == requiredMask) {
|
||||
|
||||
// TODO: can we remove this?
|
||||
// NOTE: Lucene always passes max =
|
||||
// Integer.MAX_VALUE today, because we never embed
|
||||
// a BooleanScorer inside another (even though
|
||||
// that should work)... but in theory an outside
|
||||
// app could pass a different max so we must check
|
||||
// it:
|
||||
if (current.doc >= max){
|
||||
tmp = current;
|
||||
current = current.next;
|
||||
|
@ -318,7 +323,7 @@ final class BooleanScorer extends Scorer {
|
|||
|
||||
@Override
|
||||
public float freq() throws IOException {
|
||||
return current.coord;
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue