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 {
|
public boolean next() throws IOException {
|
||||||
if (firstTime) {
|
if (firstTime) {
|
||||||
sort();
|
init();
|
||||||
firstTime = false;
|
firstTime = false;
|
||||||
} else if (more) {
|
} else if (more) {
|
||||||
more = last.next(); // trigger further scanning
|
more = last.next(); // trigger further scanning
|
||||||
|
@ -97,19 +97,19 @@ abstract class PhraseScorer extends Scorer {
|
||||||
return more;
|
return more;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected abstract float phraseFreq() throws IOException;
|
protected abstract float phraseFreq() throws IOException;
|
||||||
|
|
||||||
private void sort() throws IOException {
|
private void init() throws IOException {
|
||||||
pq.clear();
|
for (PhrasePositions pp = first; more && pp != null; pp = pp.next)
|
||||||
for (PhrasePositions pp = first; more && pp != null; pp = pp.next) {
|
|
||||||
more = pp.next();
|
more = pp.next();
|
||||||
if (more) {
|
if(more)
|
||||||
pq.put(pp);
|
sort();
|
||||||
} else {
|
}
|
||||||
return;
|
|
||||||
}
|
private void sort() {
|
||||||
}
|
pq.clear();
|
||||||
|
for (PhrasePositions pp = first; pp != null; pp = pp.next)
|
||||||
|
pq.put(pp);
|
||||||
pqToList();
|
pqToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue