lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1633296 [2/2] - in /lucene/dev/trunk: lucene/ lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/ lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene42/ lucene/backward-codecs/src/java/org/apache/lucene/codecs/lu...
Date Tue, 21 Oct 2014 07:32:39 GMT
Modified: lucene/dev/trunk/lucene/memory/src/test/org/apache/lucene/index/memory/TestMemoryIndexAgainstRAMDir.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/memory/src/test/org/apache/lucene/index/memory/TestMemoryIndexAgainstRAMDir.java?rev=1633296&r1=1633295&r2=1633296&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/memory/src/test/org/apache/lucene/index/memory/TestMemoryIndexAgainstRAMDir.java
(original)
+++ lucene/dev/trunk/lucene/memory/src/test/org/apache/lucene/index/memory/TestMemoryIndexAgainstRAMDir.java
Tue Oct 21 07:32:38 2014
@@ -432,7 +432,7 @@ public class TestMemoryIndexAgainstRAMDi
       Document nextDoc = lineFileDocs.nextDoc();
       Document doc = new Document();
       for (Field field : nextDoc.getFields()) {
-        if (field.fieldType().indexed()) {
+        if (field.fieldType().indexOptions() != null) {
           doc.add(field);
           if (random().nextInt(3) == 0) {
             doc.add(field);  // randomly add the same field twice
@@ -443,7 +443,7 @@ public class TestMemoryIndexAgainstRAMDi
       writer.addDocument(doc);
       writer.close();
       for (IndexableField field : doc.indexableFields()) {
-          memory.addField(field.name(), ((Field)field).stringValue(), mockAnalyzer);  
+        memory.addField(field.name(), ((Field)field).stringValue(), mockAnalyzer);  
       }
       DirectoryReader competitor = DirectoryReader.open(dir);
       LeafReader memIndexReader= (LeafReader) memory.createSearcher().getIndexReader();

Modified: lucene/dev/trunk/lucene/misc/src/java/org/apache/lucene/uninverting/UninvertingReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/misc/src/java/org/apache/lucene/uninverting/UninvertingReader.java?rev=1633296&r1=1633295&r2=1633296&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/misc/src/java/org/apache/lucene/uninverting/UninvertingReader.java
(original)
+++ lucene/dev/trunk/lucene/misc/src/java/org/apache/lucene/uninverting/UninvertingReader.java
Tue Oct 21 07:32:38 2014
@@ -212,7 +212,7 @@ public class UninvertingReader extends F
           }
         }
       }
-      filteredInfos.add(new FieldInfo(fi.name, fi.isIndexed(), fi.number, fi.hasVectors(),
fi.omitsNorms(),
+      filteredInfos.add(new FieldInfo(fi.name, fi.number, fi.hasVectors(), fi.omitsNorms(),
                                       fi.hasPayloads(), fi.getIndexOptions(), type, -1, null));
     }
     fieldInfos = new FieldInfos(filteredInfos.toArray(new FieldInfo[filteredInfos.size()]));

Modified: lucene/dev/trunk/lucene/misc/src/test/org/apache/lucene/document/TestLazyDocument.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/misc/src/test/org/apache/lucene/document/TestLazyDocument.java?rev=1633296&r1=1633295&r2=1633296&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/misc/src/test/org/apache/lucene/document/TestLazyDocument.java
(original)
+++ lucene/dev/trunk/lucene/misc/src/test/org/apache/lucene/document/TestLazyDocument.java
Tue Oct 21 07:32:38 2014
@@ -212,7 +212,6 @@ public class TestLazyDocument extends Lu
     public void stringField(FieldInfo fieldInfo, String value) throws IOException {
       final FieldType ft = new FieldType(TextField.TYPE_STORED);
       ft.setStoreTermVectors(fieldInfo.hasVectors());
-      ft.setIndexed(fieldInfo.isIndexed());
       ft.setOmitNorms(fieldInfo.omitsNorms());
       ft.setIndexOptions(fieldInfo.getIndexOptions());
       doc.add(new Field(fieldInfo.name, value, ft));

Modified: lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/analyzing/TestAnalyzingQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/analyzing/TestAnalyzingQueryParser.java?rev=1633296&r1=1633295&r2=1633296&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/analyzing/TestAnalyzingQueryParser.java
(original)
+++ lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/analyzing/TestAnalyzingQueryParser.java
Tue Oct 21 07:32:38 2014
@@ -34,6 +34,7 @@ import org.apache.lucene.document.Docume
 import org.apache.lucene.document.Field;
 import org.apache.lucene.document.FieldType;
 import org.apache.lucene.index.DirectoryReader;
+import org.apache.lucene.index.FieldInfo.IndexOptions;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.queryparser.classic.ParseException;
 import org.apache.lucene.queryparser.classic.QueryParser;
@@ -272,7 +273,7 @@ public class TestAnalyzingQueryParser ex
     RandomIndexWriter writer = new RandomIndexWriter(random(), ramDir, analyzer);
     Document doc = new Document();
     FieldType fieldType = new FieldType();
-    fieldType.setIndexed(true);
+    fieldType.setIndexOptions(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS);
     fieldType.setTokenized(true);
     fieldType.setStored(true);
     Field field = new Field(FIELD, content, fieldType);
@@ -292,4 +293,4 @@ public class TestAnalyzingQueryParser ex
     }
 
   }
-}
\ No newline at end of file
+}

Modified: lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/codecs/idversion/StringAndPayloadField.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/codecs/idversion/StringAndPayloadField.java?rev=1633296&r1=1633295&r2=1633296&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/codecs/idversion/StringAndPayloadField.java
(original)
+++ lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/codecs/idversion/StringAndPayloadField.java
Tue Oct 21 07:32:38 2014
@@ -36,7 +36,6 @@ class StringAndPayloadField extends Fiel
   public static final FieldType TYPE = new FieldType();
 
   static {
-    TYPE.setIndexed(true);
     TYPE.setOmitNorms(true);
     TYPE.setIndexOptions(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS);
     TYPE.setTokenized(true);

Modified: lucene/dev/trunk/lucene/spatial/src/java/org/apache/lucene/spatial/bbox/BBoxStrategy.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/spatial/src/java/org/apache/lucene/spatial/bbox/BBoxStrategy.java?rev=1633296&r1=1633295&r2=1633296&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/spatial/src/java/org/apache/lucene/spatial/bbox/BBoxStrategy.java
(original)
+++ lucene/dev/trunk/lucene/spatial/src/java/org/apache/lucene/spatial/bbox/BBoxStrategy.java
Tue Oct 21 07:32:38 2014
@@ -130,7 +130,7 @@ public class BBoxStrategy extends Spatia
     //for xdlFieldType, copy some similar options. Don't do docValues since it isn't needed
here.
     xdlFieldType = new FieldType(StringField.TYPE_NOT_STORED);
     xdlFieldType.setStored(fieldType.stored());
-    xdlFieldType.setIndexed(fieldType.indexed());
+    xdlFieldType.setIndexOptions(fieldType.indexOptions());
     xdlFieldType.freeze();
   }
 

Modified: lucene/dev/trunk/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/PrefixTreeStrategy.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/PrefixTreeStrategy.java?rev=1633296&r1=1633295&r2=1633296&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/PrefixTreeStrategy.java
(original)
+++ lucene/dev/trunk/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/PrefixTreeStrategy.java
Tue Oct 21 07:32:38 2014
@@ -142,7 +142,6 @@ public abstract class PrefixTreeStrategy
   public static final FieldType FIELD_TYPE = new FieldType();
 
   static {
-    FIELD_TYPE.setIndexed(true);
     FIELD_TYPE.setTokenized(true);
     FIELD_TYPE.setOmitNorms(true);
     FIELD_TYPE.setIndexOptions(FieldInfo.IndexOptions.DOCS_ONLY);

Modified: lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/DistanceStrategyTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/DistanceStrategyTest.java?rev=1633296&r1=1633295&r2=1633296&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/DistanceStrategyTest.java
(original)
+++ lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/DistanceStrategyTest.java
Tue Oct 21 07:32:38 2014
@@ -96,7 +96,7 @@ public class DistanceStrategyTest extend
     if (strategy instanceof BBoxStrategy && random().nextBoolean()) {//disable indexing
sometimes
       BBoxStrategy bboxStrategy = (BBoxStrategy)strategy;
       final FieldType fieldType = new FieldType(bboxStrategy.getFieldType());
-      fieldType.setIndexed(false);
+      fieldType.setIndexOptions(null);
       bboxStrategy.setFieldType(fieldType);
     }
   }

Modified: lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/bbox/TestBBoxStrategy.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/bbox/TestBBoxStrategy.java?rev=1633296&r1=1633295&r2=1633296&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/bbox/TestBBoxStrategy.java
(original)
+++ lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/bbox/TestBBoxStrategy.java
Tue Oct 21 07:32:38 2014
@@ -292,7 +292,7 @@ public class TestBBoxStrategy extends Ra
     BBoxStrategy bboxStrategy = (BBoxStrategy) strategy;
     if (random().nextBoolean()) {
       FieldType fieldType = new FieldType(bboxStrategy.getFieldType());
-      fieldType.setIndexed(false);
+      fieldType.setIndexOptions(null);
       bboxStrategy.setFieldType(fieldType);
     }
 

Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/BaseFieldInfoFormatTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/BaseFieldInfoFormatTestCase.java?rev=1633296&r1=1633295&r2=1633296&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/BaseFieldInfoFormatTestCase.java
(original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/BaseFieldInfoFormatTestCase.java
Tue Oct 21 07:32:38 2014
@@ -84,7 +84,7 @@ public abstract class BaseFieldInfoForma
     for (String field : fieldNames) {
       IndexableFieldType fieldType = randomFieldType(random());
       FieldInfo fi = builder.addOrUpdate(field, fieldType);
-      if (fieldType.indexOptions().compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS) >=
0) {
+      if (fieldType.indexOptions() != null && fieldType.indexOptions().compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS)
>= 0) {
         if (random().nextBoolean()) {
           fi.setStorePayloads();
         }
@@ -101,8 +101,7 @@ public abstract class BaseFieldInfoForma
   private final IndexableFieldType randomFieldType(Random r) {
     FieldType type = new FieldType();
     
-    type.setIndexed(r.nextBoolean());
-    if (type.indexed()) {
+    if (r.nextBoolean()) {
       IndexOptions values[] = IndexOptions.values();
       type.setIndexOptions(values[r.nextInt(values.length)]);
       type.setOmitNorms(r.nextBoolean());

Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/BasePostingsFormatTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/BasePostingsFormatTestCase.java?rev=1633296&r1=1633295&r2=1633296&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/BasePostingsFormatTestCase.java
(original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/BasePostingsFormatTestCase.java
Tue Oct 21 07:32:38 2014
@@ -370,7 +370,7 @@ public abstract class BasePostingsFormat
         continue;
       }
 
-      fieldInfoArray[fieldUpto] = new FieldInfo(field, true, fieldUpto, false, false, true,
+      fieldInfoArray[fieldUpto] = new FieldInfo(field, fieldUpto, false, false, true,
                                                 IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS,
                                                 null, -1, null);
       fieldUpto++;
@@ -694,7 +694,6 @@ public abstract class BasePostingsFormat
       boolean doPayloads = indexOptions.compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS)
>= 0 && allowPayloads;
 
       newFieldInfoArray[fieldUpto] = new FieldInfo(oldFieldInfo.name,
-                                                   true,
                                                    fieldUpto,
                                                    false,
                                                    false,
@@ -1739,7 +1738,6 @@ public abstract class BasePostingsFormat
     for (IndexOptions opts : IndexOptions.values()) {
       FieldType ft = new FieldType();
       ft.setIndexOptions(opts);
-      ft.setIndexed(true);
       ft.freeze();
       final int numFields = random().nextInt(5);
       for (int j = 0; j < numFields; ++j) {

Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/BaseStoredFieldsFormatTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/BaseStoredFieldsFormatTestCase.java?rev=1633296&r1=1633295&r2=1633296&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/BaseStoredFieldsFormatTestCase.java
(original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/BaseStoredFieldsFormatTestCase.java
Tue Oct 21 07:32:38 2014
@@ -321,8 +321,8 @@ public abstract class BaseStoredFieldsFo
     w.addDocument(doc);
     IndexReader r = w.getReader();
     w.close();
-    assertFalse(r.document(0).getField("field").fieldType().indexed());
-    assertTrue(r.document(0).getField("field2").fieldType().indexed());
+    assertNull(r.document(0).getField("field").fieldType().indexOptions());
+    assertNotNull(r.document(0).getField("field2").fieldType().indexOptions());
     r.close();
     dir.close();
   }
@@ -516,7 +516,7 @@ public abstract class BaseStoredFieldsFo
     }
 
     final FieldType type = new FieldType(StringField.TYPE_STORED);
-    type.setIndexed(false);
+    type.setIndexOptions(null);
     type.freeze();
     IntField id = new IntField("id", 0, Store.YES);
     for (int i = 0; i < data.length; ++i) {
@@ -606,7 +606,7 @@ public abstract class BaseStoredFieldsFo
     bigDoc2.add(idField);
 
     final FieldType onlyStored = new FieldType(StringField.TYPE_STORED);
-    onlyStored.setIndexed(false);
+    onlyStored.setIndexOptions(null);
 
     final Field smallField = new Field("fld", randomByteArray(random().nextInt(10), 256),
onlyStored);
     final int numFields = RandomInts.randomIntBetween(random(), 500000, 1000000);

Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/DocHelper.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/DocHelper.java?rev=1633296&r1=1633295&r2=1633296&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/DocHelper.java
(original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/DocHelper.java
Tue Oct 21 07:32:38 2014
@@ -204,10 +204,10 @@ class DocHelper {
     for (int i=0; i<fields.length; i++) {
       IndexableField f = fields[i];
       add(all,f);
-      if (f.fieldType().indexed()) add(indexed,f);
+      if (f.fieldType().indexOptions() != null) add(indexed,f);
       else add(unindexed,f);
       if (f.fieldType().storeTermVectors()) add(termvector,f);
-      if (f.fieldType().indexed() && !f.fieldType().storeTermVectors()) add(notermvector,f);
+      if (f.fieldType().indexOptions() != null && !f.fieldType().storeTermVectors())
add(notermvector,f);
       if (f.fieldType().stored()) add(stored,f);
       else add(unstored,f);
       if (f.fieldType().indexOptions() == IndexOptions.DOCS_ONLY) add(noTf,f);

Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/LineFileDocs.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/LineFileDocs.java?rev=1633296&r1=1633295&r2=1633296&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/LineFileDocs.java
(original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/LineFileDocs.java
Tue Oct 21 07:32:38 2014
@@ -41,6 +41,7 @@ import org.apache.lucene.document.IntFie
 import org.apache.lucene.document.SortedDocValuesField;
 import org.apache.lucene.document.StringField;
 import org.apache.lucene.document.TextField;
+import org.apache.lucene.index.FieldInfo.IndexOptions;
 
 /** Minimal port of benchmark's LneDocSource +
  * DocMaker, so tests can enum docs from a line file created
@@ -170,6 +171,7 @@ public class LineFileDocs implements Clo
       doc.add(title);
 
       FieldType ft = new FieldType(TextField.TYPE_STORED);
+      ft.setIndexOptions(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS);
       ft.setStoreTermVectors(true);
       ft.setStoreTermVectorOffsets(true);
       ft.setStoreTermVectorPositions(true);

Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java?rev=1633296&r1=1633295&r2=1633296&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
(original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
Tue Oct 21 07:32:38 2014
@@ -1338,7 +1338,7 @@ public abstract class LuceneTestCase ext
   /** Returns a FieldType derived from newType but whose
    *  term vector options match the old type */
   private static FieldType mergeTermVectorOptions(FieldType newType, FieldType oldType) {
-    if (newType.indexed() && oldType.storeTermVectors() == true && newType.storeTermVectors()
== false) {
+    if (newType.indexOptions() != null && oldType.storeTermVectors() == true &&
newType.storeTermVectors() == false) {
       newType = new FieldType(newType);
       newType.setStoreTermVectors(oldType.storeTermVectors());
       newType.setStoreTermVectorPositions(oldType.storeTermVectorPositions());
@@ -1363,7 +1363,7 @@ public abstract class LuceneTestCase ext
 
     FieldType prevType = fieldToType.get(name);
 
-    if (usually(random) || !type.indexed() || prevType != null) {
+    if (usually(random) || type.indexOptions() == null || prevType != null) {
       // most of the time, don't modify the params
       if (prevType == null) {
         fieldToType.put(name, new FieldType(type));

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/admin/LukeRequestHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/admin/LukeRequestHandler.java?rev=1633296&r1=1633295&r2=1633296&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/admin/LukeRequestHandler.java
(original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/admin/LukeRequestHandler.java
Tue Oct 21 07:32:38 2014
@@ -176,7 +176,7 @@ public class LukeRequestHandler extends 
 
     StringBuilder flags = new StringBuilder();
 
-    flags.append( (f != null && f.fieldType().indexed())                     ? FieldFlag.INDEXED.getAbbreviation()
: '-' );
+    flags.append( (f != null && f.fieldType().indexOptions() != null)           
         ? FieldFlag.INDEXED.getAbbreviation() : '-' );
     flags.append( (f != null && f.fieldType().tokenized())                   ? FieldFlag.TOKENIZED.getAbbreviation()
: '-' );
     flags.append( (f != null && f.fieldType().stored())                      ? FieldFlag.STORED.getAbbreviation()
: '-' );
     flags.append( (f != null && f.fieldType().docValueType() != null)        ? FieldFlag.DOC_VALUES.getAbbreviation()
: "-" );

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/EnumField.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/EnumField.java?rev=1633296&r1=1633295&r2=1633296&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/EnumField.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/EnumField.java Tue Oct 21 07:32:38
2014
@@ -381,11 +381,10 @@ public class EnumField extends Primitive
     String intAsString =  intValue.toString();
     final FieldType newType = new FieldType();
 
-    newType.setIndexed(field.indexed());
     newType.setTokenized(field.isTokenized());
     newType.setStored(field.stored());
     newType.setOmitNorms(field.omitNorms());
-    newType.setIndexOptions(getIndexOptions(field, intAsString));
+    newType.setIndexOptions(field.indexed() ? getIndexOptions(field, intAsString) : null);
     newType.setStoreTermVectors(field.storeTermVector());
     newType.setStoreTermVectorOffsets(field.storeTermOffsets());
     newType.setStoreTermVectorPositions(field.storeTermPositions());

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/FieldType.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/FieldType.java?rev=1633296&r1=1633295&r2=1633296&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/FieldType.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/FieldType.java Tue Oct 21 07:32:38
2014
@@ -265,11 +265,10 @@ public abstract class FieldType extends 
     if (val==null) return null;
 
     org.apache.lucene.document.FieldType newType = new org.apache.lucene.document.FieldType();
-    newType.setIndexed(field.indexed());
     newType.setTokenized(field.isTokenized());
     newType.setStored(field.stored());
     newType.setOmitNorms(field.omitNorms());
-    newType.setIndexOptions(getIndexOptions(field, val));
+    newType.setIndexOptions(field.indexed() ? getIndexOptions(field, val) : null);
     newType.setStoreTermVectors(field.storeTermVector());
     newType.setStoreTermVectorOffsets(field.storeTermOffsets());
     newType.setStoreTermVectorPositions(field.storeTermPositions());

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/PreAnalyzedField.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/PreAnalyzedField.java?rev=1633296&r1=1633295&r2=1633296&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/PreAnalyzedField.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/PreAnalyzedField.java Tue Oct
21 07:32:38 2014
@@ -163,7 +163,6 @@ public class PreAnalyzedField extends Fi
       return null;
     }
     org.apache.lucene.document.FieldType newType = new org.apache.lucene.document.FieldType();
-    newType.setIndexed(field.indexed());
     newType.setTokenized(field.isTokenized());
     newType.setStored(field.stored());
     newType.setOmitNorms(field.omitNorms());
@@ -243,7 +242,6 @@ public class PreAnalyzedField extends Fi
     
     if (parse.hasTokenStream()) {
       if (field.indexed()) {
-        type.setIndexed(true);
         type.setTokenized(true);
         if (f != null) {
           f.setTokenStream(parse);
@@ -252,7 +250,7 @@ public class PreAnalyzedField extends Fi
         }
       } else {
         if (f != null) {
-          f.fieldType().setIndexed(false);
+          f.fieldType().setIndexOptions(null);
           f.fieldType().setTokenized(false);
         }
       }

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/TrieField.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/TrieField.java?rev=1633296&r1=1633295&r2=1633296&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/TrieField.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/TrieField.java Tue Oct 21 07:32:38
2014
@@ -600,9 +600,8 @@ public class TrieField extends Primitive
     FieldType ft = new FieldType();
     ft.setStored(stored);
     ft.setTokenized(true);
-    ft.setIndexed(indexed);
     ft.setOmitNorms(field.omitNorms());
-    ft.setIndexOptions(getIndexOptions(field, value.toString()));
+    ft.setIndexOptions(indexed ? getIndexOptions(field, value.toString()) : null);
 
     switch (type) {
       case INTEGER:

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/Insanity.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/Insanity.java?rev=1633296&r1=1633295&r2=1633296&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/Insanity.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/Insanity.java Tue Oct 21 07:32:38
2014
@@ -64,7 +64,7 @@ public class Insanity {
       ArrayList<FieldInfo> filteredInfos = new ArrayList<>();
       for (FieldInfo fi : in.getFieldInfos()) {
         if (fi.name.equals(insaneField)) {
-          filteredInfos.add(new FieldInfo(fi.name, fi.isIndexed(), fi.number, fi.hasVectors(),
fi.omitsNorms(),
+          filteredInfos.add(new FieldInfo(fi.name, fi.number, fi.hasVectors(), fi.omitsNorms(),
                                           fi.hasPayloads(), fi.getIndexOptions(), null, -1,
null));
         } else {
           filteredInfos.add(fi);

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java?rev=1633296&r1=1633295&r2=1633296&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java Tue
Oct 21 07:32:38 2014
@@ -608,7 +608,6 @@ public class SolrIndexSearcher extends I
     public void stringField(FieldInfo fieldInfo, String value) throws IOException {
       final FieldType ft = new FieldType(TextField.TYPE_STORED);
       ft.setStoreTermVectors(fieldInfo.hasVectors());
-      ft.setIndexed(fieldInfo.isIndexed());
       ft.setOmitNorms(fieldInfo.omitsNorms());
       ft.setIndexOptions(fieldInfo.getIndexOptions());
       doc.add(new Field(fieldInfo.name, value, ft));
@@ -618,7 +617,7 @@ public class SolrIndexSearcher extends I
     public void intField(FieldInfo fieldInfo, int value) {
       FieldType ft = new FieldType(IntField.TYPE_NOT_STORED);
       ft.setStored(true);
-      ft.setIndexed(fieldInfo.isIndexed());
+      ft.setIndexOptions(fieldInfo.getIndexOptions());
       doc.add(new IntField(fieldInfo.name, value, ft));
     }
 
@@ -626,7 +625,7 @@ public class SolrIndexSearcher extends I
     public void longField(FieldInfo fieldInfo, long value) {
       FieldType ft = new FieldType(LongField.TYPE_NOT_STORED);
       ft.setStored(true);
-      ft.setIndexed(fieldInfo.isIndexed());
+      ft.setIndexOptions(fieldInfo.getIndexOptions());
       doc.add(new LongField(fieldInfo.name, value, ft));
     }
 
@@ -634,7 +633,7 @@ public class SolrIndexSearcher extends I
     public void floatField(FieldInfo fieldInfo, float value) {
       FieldType ft = new FieldType(FloatField.TYPE_NOT_STORED);
       ft.setStored(true);
-      ft.setIndexed(fieldInfo.isIndexed());
+      ft.setIndexOptions(fieldInfo.getIndexOptions());
       doc.add(new FloatField(fieldInfo.name, value, ft));
     }
 
@@ -642,7 +641,7 @@ public class SolrIndexSearcher extends I
     public void doubleField(FieldInfo fieldInfo, double value) {
       FieldType ft = new FieldType(DoubleField.TYPE_NOT_STORED);
       ft.setStored(true);
-      ft.setIndexed(fieldInfo.isIndexed());
+      ft.setIndexOptions(fieldInfo.getIndexOptions());
       doc.add(new DoubleField(fieldInfo.name, value, ft));
     }
   }

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestStressLucene.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestStressLucene.java?rev=1633296&r1=1633295&r2=1633296&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestStressLucene.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestStressLucene.java Tue Oct
21 07:32:38 2014
@@ -83,14 +83,12 @@ public class TestStressLucene extends Te
 
 
     final FieldType idFt = new FieldType();
-    idFt.setIndexed(true);
     idFt.setStored(true);
     idFt.setOmitNorms(true);
     idFt.setTokenized(false);
     idFt.setIndexOptions(FieldInfo.IndexOptions.DOCS_ONLY);
 
     final FieldType ft2 = new FieldType();
-    ft2.setIndexed(false);
     ft2.setStored(true);
 
 

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/update/TestExceedMaxTermLength.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/update/TestExceedMaxTermLength.java?rev=1633296&r1=1633295&r2=1633296&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/update/TestExceedMaxTermLength.java
(original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/update/TestExceedMaxTermLength.java
Tue Oct 21 07:32:38 2014
@@ -34,7 +34,7 @@ public class TestExceedMaxTermLength ext
   public final static String TEST_SCHEMAXML_NAME = "schema11.xml";
 
   private final static int minTestTermLength = IndexWriter.MAX_TERM_LENGTH + 1;
-  private final static int maxTestTermLegnth = IndexWriter.MAX_TERM_LENGTH * 2;
+  private final static int maxTestTermLength = IndexWriter.MAX_TERM_LENGTH * 2;
 
   @BeforeClass
   public static void beforeTests() throws Exception {
@@ -54,12 +54,12 @@ public class TestExceedMaxTermLength ext
     final String longFieldName = "cat";
     final String longFieldValue = TestUtil.randomSimpleString(random(),
         minTestTermLength,
-        maxTestTermLegnth);
+        maxTestTermLength);
 
     final String okayFieldName = TestUtil.randomSimpleString(random(), 1, 50) + "_sS" ; //Dynamic
field
     final String okayFieldValue = TestUtil.randomSimpleString(random(),
         minTestTermLength,
-        maxTestTermLegnth);
+        maxTestTermLength);
 
     boolean includeOkayFields = random().nextBoolean();
 
@@ -105,12 +105,12 @@ public class TestExceedMaxTermLength ext
     final String longFieldName = "cat_length";
     final String longFieldValue = TestUtil.randomSimpleString(random(),
         minTestTermLength,
-        maxTestTermLegnth);
+        maxTestTermLength);
 
     final String okayFieldName = TestUtil.randomSimpleString(random(), 1, 50) + "_sS" ; //Dynamic
field
     final String okayFieldValue = TestUtil.randomSimpleString(random(),
         minTestTermLength,
-        maxTestTermLegnth);
+        maxTestTermLength);
 
     boolean includeOkayFields = random().nextBoolean();
 
@@ -138,7 +138,6 @@ public class TestExceedMaxTermLength ext
           updateJ(json(jsonStr), null);
         }
       } catch (Exception e) {
-        //expected
         fail("Should not have failed adding doc " + jsonStr);
         String msg= e.getCause().getMessage();
         assertTrue(msg.contains("one immense term in field=\"cat\""));



Mime
View raw message