mirror of https://github.com/apache/lucene.git
LUCENE-6246: fix missed checks on PostingsEnum.POSITIONS
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1662129 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2cd3fb807d
commit
d59b1e944a
|
@ -860,7 +860,7 @@ public final class DirectPostingsFormat extends PostingsFormat {
|
|||
// TODO: implement reuse
|
||||
// it's hairy!
|
||||
|
||||
if ((flags & PostingsEnum.POSITIONS) >= PostingsEnum.POSITIONS) {
|
||||
if (PostingsEnum.featureRequested(flags, PostingsEnum.POSITIONS)) {
|
||||
if (!hasPos) {
|
||||
return null;
|
||||
}
|
||||
|
@ -1454,7 +1454,7 @@ public final class DirectPostingsFormat extends PostingsFormat {
|
|||
public PostingsEnum postings(Bits liveDocs, PostingsEnum reuse, int flags) {
|
||||
// TODO: implement reuse
|
||||
// it's hairy!
|
||||
if ((flags & PostingsEnum.POSITIONS) >= PostingsEnum.POSITIONS) {
|
||||
if (PostingsEnum.featureRequested(flags, PostingsEnum.POSITIONS)) {
|
||||
if (!hasPos) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -829,7 +829,7 @@ public final class MemoryPostingsFormat extends PostingsFormat {
|
|||
@Override
|
||||
public PostingsEnum postings(Bits liveDocs, PostingsEnum reuse, int flags) {
|
||||
|
||||
if ((flags & PostingsEnum.POSITIONS) >= PostingsEnum.POSITIONS) {
|
||||
if (PostingsEnum.featureRequested(flags, PostingsEnum.POSITIONS)) {
|
||||
if (field.getIndexOptions().compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS) < 0) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -937,7 +937,7 @@ public final class CompressingTermVectorsReader extends TermVectorsReader implem
|
|||
@Override
|
||||
public final PostingsEnum postings(Bits liveDocs, PostingsEnum reuse, int flags) throws IOException {
|
||||
|
||||
if ((flags & PostingsEnum.POSITIONS) >= PostingsEnum.POSITIONS) {
|
||||
if (PostingsEnum.featureRequested(flags, PostingsEnum.POSITIONS)) {
|
||||
if (positions == null && startOffsets == null)
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -194,7 +194,7 @@ public final class Lucene50PostingsReader extends PostingsReaderBase {
|
|||
@Override
|
||||
public PostingsEnum postings(FieldInfo fieldInfo, BlockTermState termState, Bits liveDocs, PostingsEnum reuse, int flags) throws IOException {
|
||||
|
||||
if ((flags & PostingsEnum.POSITIONS) < PostingsEnum.POSITIONS) {
|
||||
if (PostingsEnum.featureRequested(flags, PostingsEnum.POSITIONS) == false) {
|
||||
BlockDocsEnum docsEnum;
|
||||
if (reuse instanceof BlockDocsEnum) {
|
||||
docsEnum = (BlockDocsEnum) reuse;
|
||||
|
|
|
@ -235,7 +235,7 @@ class FreqProxFields extends Fields {
|
|||
throw new IllegalArgumentException("liveDocs must be null");
|
||||
}
|
||||
|
||||
if ((flags & PostingsEnum.POSITIONS) >= PostingsEnum.POSITIONS) {
|
||||
if (PostingsEnum.featureRequested(flags, PostingsEnum.POSITIONS)) {
|
||||
FreqProxPostingsEnum posEnum;
|
||||
|
||||
if (!terms.hasProx) {
|
||||
|
|
Loading…
Reference in New Issue