You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2012/08/11 21:37:45 UTC
svn commit: r1372010 [2/2] - in /lucene/dev/branches/branch_4x: ./ lucene/
lucene/core/ lucene/core/src/java/org/apache/lucene/codecs/
lucene/core/src/java/org/apache/lucene/codecs/bloom/
lucene/core/src/java/org/apache/lucene/codecs/lucene3x/ lucene/c...
Modified: lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/codecs/ramonly/RAMOnlyPostingsFormat.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/codecs/ramonly/RAMOnlyPostingsFormat.java?rev=1372010&r1=1372009&r2=1372010&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/codecs/ramonly/RAMOnlyPostingsFormat.java (original)
+++ lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/codecs/ramonly/RAMOnlyPostingsFormat.java Sat Aug 11 19:37:44 2012
@@ -127,11 +127,11 @@ public class RAMOnlyPostingsFormat exten
long sumTotalTermFreq;
long sumDocFreq;
int docCount;
- final FieldInfo.IndexOptions options;
+ final FieldInfo info;
- RAMField(String field, FieldInfo.IndexOptions options) {
+ RAMField(String field, FieldInfo info) {
this.field = field;
- this.options = options;
+ this.info = info;
}
@Override
@@ -166,12 +166,17 @@ public class RAMOnlyPostingsFormat exten
@Override
public boolean hasOffsets() {
- return options.compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS) >= 0;
+ return info.getIndexOptions().compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS) >= 0;
}
@Override
public boolean hasPositions() {
- return options.compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS) >= 0;
+ return info.getIndexOptions().compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS) >= 0;
+ }
+
+ @Override
+ public boolean hasPayloads() {
+ return info.hasPayloads();
}
}
@@ -210,7 +215,7 @@ public class RAMOnlyPostingsFormat exten
if (field.getIndexOptions().compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS) >= 0) {
throw new UnsupportedOperationException("this codec cannot index offsets");
}
- RAMField ramField = new RAMField(field.name, field.getIndexOptions());
+ RAMField ramField = new RAMField(field.name, field);
postings.fieldToTerms.put(field.name, ramField);
termsConsumer.reset(ramField);
return termsConsumer;
Modified: lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java?rev=1372010&r1=1372009&r2=1372010&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java (original)
+++ lucene/dev/branches/branch_4x/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java Sat Aug 11 19:37:44 2012
@@ -937,6 +937,10 @@ public abstract class LuceneTestCase ext
}
if (!newType.storeTermVectorPositions()) {
newType.setStoreTermVectorPositions(random.nextBoolean());
+
+ if (newType.storeTermVectorPositions() && !newType.storeTermVectorPayloads() && !PREFLEX_IMPERSONATION_IS_ACTIVE) {
+ newType.setStoreTermVectorPayloads(random.nextBoolean());
+ }
}
}