Skip to content

Apache Lucene open-source search software

nuke unnecessary FIS method (only used by this one test)

Robert Muirfddc40fcc001
diff --git a/lucene/core/src/java/org/apache/lucene/index/FieldInfos.java b/lucene/core/src/java/org/apache/lucene/index/FieldInfos.java
index be18ffe1d03..ffee6fa0a1f 100644
--- a/lucene/core/src/java/org/apache/lucene/index/FieldInfos.java
+++ b/lucene/core/src/java/org/apache/lucene/index/FieldInfos.java
@@ -274,24 +274,6 @@ public class FieldInfos implements Iterable<FieldInfo> {
assert globalFieldNumbers.containsConsistent(Integer.valueOf(fi.number), fi.name, fi.getDocValuesType());
byName.put(fi.name, fi);
}
-
- /** If the field is not yet known, adds it. If it is known, checks to make
- * sure that the isIndexed flag is the same as was given previously for this
- * field. If not - marks it as being indexed. Same goes for the TermVector
- * parameters.
- *
- * @param name The name of the field
- * @param isIndexed true if the field is indexed
- * @param storeTermVector true if the term vector should be stored
- * @param omitNorms true if the norms for the indexed field should be omitted
- * @param storePayloads true if payloads should be stored for this field
- * @param indexOptions if term freqs should be omitted for this field
- */
- // TODO: fix testCodecs to do this another way, its the only user of this
- FieldInfo addOrUpdate(String name, boolean isIndexed, boolean storeTermVector,
- boolean omitNorms, boolean storePayloads, IndexOptions indexOptions, DocValuesType docValues, DocValuesType normType) {
- return addOrUpdateInternal(name, -1, isIndexed, storeTermVector, omitNorms, storePayloads, indexOptions, docValues, normType);
- }
/** NOTE: this method does not carry over termVector
* booleans nor docValuesType; the indexer chain
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestCodecs.java b/lucene/core/src/test/org/apache/lucene/index/TestCodecs.java
index af1b75a5382..16107613806 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestCodecs.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestCodecs.java
@@ -36,6 +36,7 @@ import org.apache.lucene.document.Field.Store;
import org.apache.lucene.document.FieldType;
import org.apache.lucene.document.StringField;
import org.apache.lucene.document.TextField;
+import org.apache.lucene.index.FieldInfo.DocValuesType;
import org.apache.lucene.index.FieldInfo.IndexOptions;
import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.search.IndexSearcher;
@@ -94,8 +95,41 @@ public class TestCodecs extends LuceneTestCase {
this.omitTF = omitTF;
this.storePayloads = storePayloads;
// TODO: change this test to use all three
- fieldInfos.addOrUpdate(name, true, false, false, storePayloads, omitTF ? IndexOptions.DOCS_ONLY : IndexOptions.DOCS_AND_FREQS_AND_POSITIONS, null, null);
- fieldInfo = fieldInfos.fieldInfo(name);
+ fieldInfo = fieldInfos.addOrUpdate(name, new IndexableFieldType() {
+
+ @Override
+ public boolean indexed() { return true; }
+
+ @Override
+ public boolean stored() { return false; }
+
+ @Override
+ public boolean tokenized() { return false; }
+
+ @Override
+ public boolean storeTermVectors() { return false; }
+
+ @Override
+ public boolean storeTermVectorOffsets() { return false; }
+
+ @Override
+ public boolean storeTermVectorPositions() { return false; }
+
+ @Override
+ public boolean storeTermVectorPayloads() { return false; }
+
+ @Override
+ public boolean omitNorms() { return false; }
+
+ @Override
+ public IndexOptions indexOptions() { return omitTF ? IndexOptions.DOCS_ONLY : IndexOptions.DOCS_AND_FREQS_AND_POSITIONS; }
+
+ @Override
+ public DocValuesType docValueType() { return null; }
+ });
+ if (storePayloads) {
+ fieldInfo.setStorePayloads();
+ }
this.terms = terms;
for(int i=0;i<terms.length;i++)
terms[i].field = this;