mirror of https://github.com/apache/lucene.git
leverage AcceptStatus.END
This commit is contained in:
parent
082a4c7436
commit
1f8c07553f
|
@ -149,18 +149,15 @@ public class PrefixQuery extends MultiTermQuery {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected BytesRef nextSeekTerm(BytesRef currentTerm) {
|
protected BytesRef nextSeekTerm(BytesRef currentTerm) {
|
||||||
if (currentTerm == null) {
|
assert currentTerm == null;
|
||||||
return startTerm;
|
return startTerm;
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected AcceptStatus accept(BytesRef candidate) {
|
protected AcceptStatus accept(BytesRef candidate) {
|
||||||
if (thresholdLength == candidate.length
|
if (thresholdLength == candidate.length
|
||||||
&& determinant == Byte.toUnsignedInt(candidate.bytes[candidate.offset + tdi])) {
|
&& determinant == Byte.toUnsignedInt(candidate.bytes[candidate.offset + tdi])) {
|
||||||
return AcceptStatus.NO_AND_SEEK;
|
return AcceptStatus.END;
|
||||||
} else {
|
} else {
|
||||||
return AcceptStatus.YES;
|
return AcceptStatus.YES;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue