mirror of https://github.com/apache/lucene.git
skipTo jumped one document too far
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150281 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
17338f4680
commit
360e7e234c
|
@ -58,7 +58,7 @@ abstract class PhraseScorer extends Scorer {
|
|||
|
||||
public boolean next() throws IOException {
|
||||
if (firstTime) {
|
||||
sort();
|
||||
init();
|
||||
firstTime = false;
|
||||
} else if (more) {
|
||||
more = last.next(); // trigger further scanning
|
||||
|
@ -97,19 +97,19 @@ abstract class PhraseScorer extends Scorer {
|
|||
return more;
|
||||
}
|
||||
|
||||
|
||||
protected abstract float phraseFreq() throws IOException;
|
||||
|
||||
private void sort() throws IOException {
|
||||
pq.clear();
|
||||
for (PhrasePositions pp = first; more && pp != null; pp = pp.next) {
|
||||
private void init() throws IOException {
|
||||
for (PhrasePositions pp = first; more && pp != null; pp = pp.next)
|
||||
more = pp.next();
|
||||
if (more) {
|
||||
pq.put(pp);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(more)
|
||||
sort();
|
||||
}
|
||||
|
||||
private void sort() {
|
||||
pq.clear();
|
||||
for (PhrasePositions pp = first; pp != null; pp = pp.next)
|
||||
pq.put(pp);
|
||||
pqToList();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue