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 2013/01/31 05:16:06 UTC
svn commit: r1440842 - in /lucene/dev/branches/lucene4547/lucene/core/src:
java/org/apache/lucene/index/FieldInfos.java
test/org/apache/lucene/index/TestCodecs.java
Author: rmuir
Date: Thu Jan 31 04:16:06 2013
New Revision: 1440842
URL: http://svn.apache.org/viewvc?rev=1440842&view=rev
Log:
nuke unnecessary FIS method (only used by this one test)
Modified:
lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/index/FieldInfos.java
lucene/dev/branches/lucene4547/lucene/core/src/test/org/apache/lucene/index/TestCodecs.java
Modified: lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/index/FieldInfos.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/index/FieldInfos.java?rev=1440842&r1=1440841&r2=1440842&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/index/FieldInfos.java (original)
+++ lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/index/FieldInfos.java Thu Jan 31 04:16:06 2013
@@ -274,24 +274,6 @@ public class FieldInfos implements Itera
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
Modified: lucene/dev/branches/lucene4547/lucene/core/src/test/org/apache/lucene/index/TestCodecs.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/lucene/core/src/test/org/apache/lucene/index/TestCodecs.java?rev=1440842&r1=1440841&r2=1440842&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/lucene/core/src/test/org/apache/lucene/index/TestCodecs.java (original)
+++ lucene/dev/branches/lucene4547/lucene/core/src/test/org/apache/lucene/index/TestCodecs.java Thu Jan 31 04:16:06 2013
@@ -36,6 +36,7 @@ import org.apache.lucene.document.Field.
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 LuceneTe
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;