mirror of https://github.com/apache/lucene.git
LUCENE-6256: Change PostingsEnum.nextPosition() to consistently return -1 when positions are not available
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1661061 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
df3471a1b4
commit
d3e7357d28
|
@ -127,6 +127,10 @@ API Changes
|
|||
* LUCENE-6245: Force Filter subclasses to implement toString API from Query.
|
||||
(Ryan Ernst)
|
||||
|
||||
* LUCENE-6256: Change PostingsEnum.nextPosition() to consistently return -1 when
|
||||
positions are not available.
|
||||
(Ryan Ernst)
|
||||
|
||||
Other
|
||||
|
||||
* LUCENE-6248: Remove unused odd constants from StandardSyntaxParser.jj
|
||||
|
|
|
@ -1566,7 +1566,6 @@ public final class DirectPostingsFormat extends PostingsFormat {
|
|||
|
||||
@Override
|
||||
public int nextPosition() throws IOException {
|
||||
assert false : "Shouldn't be calling nextPosition() if you haven't asked for positions";
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -1655,7 +1654,6 @@ public final class DirectPostingsFormat extends PostingsFormat {
|
|||
|
||||
@Override
|
||||
public int nextPosition() throws IOException {
|
||||
assert false : "Shouldn't be calling nextPosition() if you haven't asked for positions";
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -1760,7 +1758,6 @@ public final class DirectPostingsFormat extends PostingsFormat {
|
|||
|
||||
@Override
|
||||
public int nextPosition() throws IOException {
|
||||
assert false : "should be using LowFreqDocsAndPositionsEnum";
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -278,7 +278,6 @@ class SimpleTextFieldsReader extends FieldsProducer {
|
|||
|
||||
@Override
|
||||
public int nextPosition() throws IOException {
|
||||
assert false : "Shouldn't be calling nextPosition() if you haven't asked for positions";
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -423,7 +423,6 @@ public class SimpleTextTermVectorsReader extends TermVectorsReader {
|
|||
|
||||
@Override
|
||||
public int nextPosition() throws IOException {
|
||||
assert false;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -336,7 +336,6 @@ public final class Lucene50PostingsReader extends PostingsReaderBase {
|
|||
|
||||
@Override
|
||||
public int nextPosition() throws IOException {
|
||||
assert false; // shouldn't be calling nextPosition() on this
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -345,7 +345,6 @@ class FreqProxFields extends Fields {
|
|||
|
||||
@Override
|
||||
public int nextPosition() throws IOException {
|
||||
assert false : "Shouldn't be calling nextPositions on DocsEnum";
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -92,9 +92,9 @@ public abstract class PostingsEnum extends DocIdSetIterator {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the next position. If there are no more
|
||||
* positions, or the iterator does not support positions,
|
||||
* this will return DocsEnum.NO_MORE_POSITIONS */
|
||||
* Returns the next position, or -1 if positions were not indexed.
|
||||
* Calling this more than {@link #freq()} times is undefined.
|
||||
*/
|
||||
public abstract int nextPosition() throws IOException;
|
||||
|
||||
/** Returns start offset for the current position, or -1
|
||||
|
|
|
@ -231,7 +231,7 @@ public abstract class BasePostingsFormatTestCase extends BaseIndexFileFormatTest
|
|||
public int nextPosition() {
|
||||
if (!doPositions) {
|
||||
posUpto = freq;
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
assert posUpto < freq;
|
||||
|
||||
|
|
Loading…
Reference in New Issue