lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1635790 [2/4] - in /lucene/dev/trunk: lucene/ lucene/backward-codecs/src/test/org/apache/lucene/index/ lucene/codecs/src/java/org/apache/lucene/codecs/blockterms/ lucene/codecs/src/java/org/apache/lucene/codecs/blocktreeords/ lucene/codecs...
Date Fri, 31 Oct 2014 15:10:11 GMT
Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/DoubleField.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/DoubleField.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/DoubleField.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/DoubleField.java Fri Oct 31 15:10:08 2014
@@ -18,7 +18,7 @@ package org.apache.lucene.document;
  */
 
 import org.apache.lucene.analysis.NumericTokenStream; // javadocs
-import org.apache.lucene.index.FieldInfo.IndexOptions;
+import org.apache.lucene.index.IndexOptions;
 import org.apache.lucene.search.NumericRangeFilter; // javadocs
 import org.apache.lucene.search.NumericRangeQuery; // javadocs
 import org.apache.lucene.util.NumericUtils;
@@ -121,7 +121,7 @@ public final class DoubleField extends F
   static {
     TYPE_NOT_STORED.setTokenized(true);
     TYPE_NOT_STORED.setOmitNorms(true);
-    TYPE_NOT_STORED.setIndexOptions(IndexOptions.DOCS_ONLY);
+    TYPE_NOT_STORED.setIndexOptions(IndexOptions.DOCS);
     TYPE_NOT_STORED.setNumericType(FieldType.NumericType.DOUBLE);
     TYPE_NOT_STORED.freeze();
   }
@@ -134,7 +134,7 @@ public final class DoubleField extends F
   static {
     TYPE_STORED.setTokenized(true);
     TYPE_STORED.setOmitNorms(true);
-    TYPE_STORED.setIndexOptions(IndexOptions.DOCS_ONLY);
+    TYPE_STORED.setIndexOptions(IndexOptions.DOCS);
     TYPE_STORED.setNumericType(FieldType.NumericType.DOUBLE);
     TYPE_STORED.setStored(true);
     TYPE_STORED.freeze();

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/Field.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/Field.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/Field.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/Field.java Fri Oct 31 15:10:08 2014
@@ -26,12 +26,13 @@ import org.apache.lucene.analysis.TokenS
 import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
 import org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
 import org.apache.lucene.document.FieldType.NumericType;
+import org.apache.lucene.index.FieldInvertState; // javadocs
+import org.apache.lucene.index.IndexOptions;
 import org.apache.lucene.index.IndexWriter; // javadocs
 import org.apache.lucene.index.IndexableField;
 import org.apache.lucene.index.IndexableFieldType;
 import org.apache.lucene.index.StorableField;
 import org.apache.lucene.util.BytesRef;
-import org.apache.lucene.index.FieldInvertState; // javadocs
 
 /**
  * Expert: directly create a field for a document.  Most
@@ -122,7 +123,7 @@ public class Field implements IndexableF
     if (type.stored()) {
       throw new IllegalArgumentException("fields with a Reader value cannot be stored");
     }
-    if (type.indexOptions() != null && !type.tokenized()) {
+    if (type.indexOptions() != IndexOptions.NO && !type.tokenized()) {
       throw new IllegalArgumentException("non-tokenized fields must use String values");
     }
     
@@ -148,7 +149,7 @@ public class Field implements IndexableF
     if (tokenStream == null) {
       throw new NullPointerException("tokenStream cannot be null");
     }
-    if (type.indexOptions() == null || !type.tokenized()) {
+    if (type.indexOptions() == IndexOptions.NO || !type.tokenized()) {
       throw new IllegalArgumentException("TokenStream fields must be indexed and tokenized");
     }
     if (type.stored()) {
@@ -214,7 +215,7 @@ public class Field implements IndexableF
     if (bytes == null) {
       throw new IllegalArgumentException("bytes cannot be null");
     }
-    if (type.indexOptions() != null) {
+    if (type.indexOptions() != IndexOptions.NO) {
       throw new IllegalArgumentException("Fields with BytesRef values cannot be indexed");
     }
     this.fieldsData = bytes;
@@ -241,7 +242,7 @@ public class Field implements IndexableF
     if (value == null) {
       throw new IllegalArgumentException("value cannot be null");
     }
-    if (!type.stored() && type.indexOptions() == null) {
+    if (!type.stored() && type.indexOptions() == IndexOptions.NO) {
       throw new IllegalArgumentException("it doesn't make sense to have a field that "
         + "is neither indexed nor stored");
     }
@@ -338,7 +339,7 @@ public class Field implements IndexableF
     if (!(fieldsData instanceof BytesRef)) {
       throw new IllegalArgumentException("cannot change value type from " + fieldsData.getClass().getSimpleName() + " to BytesRef");
     }
-    if (type.indexOptions() != null) {
+    if (type.indexOptions() != IndexOptions.NO) {
       throw new IllegalArgumentException("cannot set a BytesRef value on an indexed field");
     }
     if (value == null) {
@@ -419,7 +420,7 @@ public class Field implements IndexableF
    * values from stringValue() or getBinaryValue()
    */
   public void setTokenStream(TokenStream tokenStream) {
-    if (type.indexOptions() == null || !type.tokenized()) {
+    if (type.indexOptions() == IndexOptions.NO || !type.tokenized()) {
       throw new IllegalArgumentException("TokenStream fields must be indexed and tokenized");
     }
     if (type.numericType() != null) {
@@ -452,7 +453,7 @@ public class Field implements IndexableF
    */
   public void setBoost(float boost) {
     if (boost != 1.0f) {
-      if (type.indexOptions() == null || type.omitNorms()) {
+      if (type.indexOptions() == IndexOptions.NO || type.omitNorms()) {
         throw new IllegalArgumentException("You cannot set an index-time boost on an unindexed field, or one that omits norms");
       }
     }
@@ -502,7 +503,7 @@ public class Field implements IndexableF
 
   @Override
   public TokenStream tokenStream(Analyzer analyzer, TokenStream reuse) throws IOException {
-    if (fieldType().indexOptions() == null) {
+    if (fieldType().indexOptions() == IndexOptions.NO) {
       // Not indexed
       return null;
     }

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/FieldType.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/FieldType.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/FieldType.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/FieldType.java Fri Oct 31 15:10:08 2014
@@ -18,8 +18,8 @@ package org.apache.lucene.document;
  */
 
 import org.apache.lucene.analysis.Analyzer; // javadocs
-import org.apache.lucene.index.FieldInfo.DocValuesType;
-import org.apache.lucene.index.FieldInfo.IndexOptions;
+import org.apache.lucene.index.DocValuesType;
+import org.apache.lucene.index.IndexOptions;
 import org.apache.lucene.index.IndexableFieldType;
 import org.apache.lucene.search.NumericRangeQuery; // javadocs
 import org.apache.lucene.util.NumericUtils;
@@ -50,11 +50,11 @@ public class FieldType implements Indexa
   private boolean storeTermVectorPositions;
   private boolean storeTermVectorPayloads;
   private boolean omitNorms;
-  private IndexOptions indexOptions;
+  private IndexOptions indexOptions = IndexOptions.NO;
   private NumericType numericType;
   private boolean frozen;
   private int numericPrecisionStep = NumericUtils.PRECISION_STEP_DEFAULT;
-  private DocValuesType docValueType;
+  private DocValuesType docValueType = DocValuesType.NO;
 
   /**
    * Create a new mutable FieldType with all of the properties from <code>ref</code>
@@ -263,7 +263,7 @@ public class FieldType implements Indexa
    * {@inheritDoc}
    * <p>
    * The default is {@link IndexOptions#DOCS_AND_FREQS_AND_POSITIONS}.
-   * @see #setIndexOptions(org.apache.lucene.index.FieldInfo.IndexOptions)
+   * @see #setIndexOptions(IndexOptions)
    */
   @Override
   public IndexOptions indexOptions() {
@@ -279,6 +279,9 @@ public class FieldType implements Indexa
    */
   public void setIndexOptions(IndexOptions value) {
     checkIfFrozen();
+    if (value == null) {
+      throw new NullPointerException("IndexOptions cannot be null");
+    }
     this.indexOptions = value;
   }
 
@@ -341,7 +344,7 @@ public class FieldType implements Indexa
     if (stored()) {
       result.append("stored");
     }
-    if (indexOptions != null) {
+    if (indexOptions != IndexOptions.NO) {
       if (result.length() > 0)
         result.append(",");
       result.append("indexed");
@@ -374,9 +377,10 @@ public class FieldType implements Indexa
         result.append(numericPrecisionStep);
       }
     }
-    if (docValueType != null) {
-      if (result.length() > 0)
+    if (docValueType != DocValuesType.NO) {
+      if (result.length() > 0) {
         result.append(",");
+      }
       result.append("docValueType=");
       result.append(docValueType);
     }
@@ -390,7 +394,7 @@ public class FieldType implements Indexa
    * {@inheritDoc}
    * <p>
    * The default is <code>null</code> (no docValues) 
-   * @see #setDocValueType(org.apache.lucene.index.FieldInfo.DocValuesType)
+   * @see #setDocValueType(DocValuesType)
    */
   @Override
   public DocValuesType docValueType() {
@@ -406,6 +410,9 @@ public class FieldType implements Indexa
    */
   public void setDocValueType(DocValuesType type) {
     checkIfFrozen();
+    if (type == null) {
+      throw new NullPointerException("DocValuesType cannot be null");
+    }
     docValueType = type;
   }
 
@@ -414,7 +421,7 @@ public class FieldType implements Indexa
     final int prime = 31;
     int result = 1;
     result = prime * result + ((docValueType == null) ? 0 : docValueType.hashCode());
-    result = prime * result + ((indexOptions == null) ? 0 : indexOptions.hashCode());
+    result = prime * result + indexOptions.hashCode();
     result = prime * result + numericPrecisionStep;
     result = prime * result + ((numericType == null) ? 0 : numericType.hashCode());
     result = prime * result + (omitNorms ? 1231 : 1237);

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/FloatField.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/FloatField.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/FloatField.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/FloatField.java Fri Oct 31 15:10:08 2014
@@ -18,7 +18,7 @@ package org.apache.lucene.document;
  */
 
 import org.apache.lucene.analysis.NumericTokenStream; // javadocs
-import org.apache.lucene.index.FieldInfo.IndexOptions;
+import org.apache.lucene.index.IndexOptions;
 import org.apache.lucene.search.NumericRangeFilter; // javadocs
 import org.apache.lucene.search.NumericRangeQuery; // javadocs
 import org.apache.lucene.util.NumericUtils;
@@ -121,7 +121,7 @@ public final class FloatField extends Fi
   static {
     TYPE_NOT_STORED.setTokenized(true);
     TYPE_NOT_STORED.setOmitNorms(true);
-    TYPE_NOT_STORED.setIndexOptions(IndexOptions.DOCS_ONLY);
+    TYPE_NOT_STORED.setIndexOptions(IndexOptions.DOCS);
     TYPE_NOT_STORED.setNumericType(FieldType.NumericType.FLOAT);
     TYPE_NOT_STORED.setNumericPrecisionStep(NumericUtils.PRECISION_STEP_DEFAULT_32);
     TYPE_NOT_STORED.freeze();
@@ -135,7 +135,7 @@ public final class FloatField extends Fi
   static {
     TYPE_STORED.setTokenized(true);
     TYPE_STORED.setOmitNorms(true);
-    TYPE_STORED.setIndexOptions(IndexOptions.DOCS_ONLY);
+    TYPE_STORED.setIndexOptions(IndexOptions.DOCS);
     TYPE_STORED.setNumericType(FieldType.NumericType.FLOAT);
     TYPE_STORED.setNumericPrecisionStep(NumericUtils.PRECISION_STEP_DEFAULT_32);
     TYPE_STORED.setStored(true);

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/IntField.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/IntField.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/IntField.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/IntField.java Fri Oct 31 15:10:08 2014
@@ -18,7 +18,7 @@ package org.apache.lucene.document;
  */
 
 import org.apache.lucene.analysis.NumericTokenStream; // javadocs
-import org.apache.lucene.index.FieldInfo.IndexOptions;
+import org.apache.lucene.index.IndexOptions;
 import org.apache.lucene.search.NumericRangeFilter; // javadocs
 import org.apache.lucene.search.NumericRangeQuery; // javadocs
 import org.apache.lucene.util.NumericUtils;
@@ -121,7 +121,7 @@ public final class IntField extends Fiel
   static {
     TYPE_NOT_STORED.setTokenized(true);
     TYPE_NOT_STORED.setOmitNorms(true);
-    TYPE_NOT_STORED.setIndexOptions(IndexOptions.DOCS_ONLY);
+    TYPE_NOT_STORED.setIndexOptions(IndexOptions.DOCS);
     TYPE_NOT_STORED.setNumericType(FieldType.NumericType.INT);
     TYPE_NOT_STORED.setNumericPrecisionStep(NumericUtils.PRECISION_STEP_DEFAULT_32);
     TYPE_NOT_STORED.freeze();
@@ -135,7 +135,7 @@ public final class IntField extends Fiel
   static {
     TYPE_STORED.setTokenized(true);
     TYPE_STORED.setOmitNorms(true);
-    TYPE_STORED.setIndexOptions(IndexOptions.DOCS_ONLY);
+    TYPE_STORED.setIndexOptions(IndexOptions.DOCS);
     TYPE_STORED.setNumericType(FieldType.NumericType.INT);
     TYPE_STORED.setNumericPrecisionStep(NumericUtils.PRECISION_STEP_DEFAULT_32);
     TYPE_STORED.setStored(true);

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/LongField.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/LongField.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/LongField.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/LongField.java Fri Oct 31 15:10:08 2014
@@ -18,7 +18,7 @@ package org.apache.lucene.document;
  */
 
 import org.apache.lucene.analysis.NumericTokenStream; // javadocs
-import org.apache.lucene.index.FieldInfo.IndexOptions;
+import org.apache.lucene.index.IndexOptions;
 import org.apache.lucene.search.NumericRangeFilter; // javadocs
 import org.apache.lucene.search.NumericRangeQuery; // javadocs
 import org.apache.lucene.util.NumericUtils;
@@ -131,7 +131,7 @@ public final class LongField extends Fie
   static {
     TYPE_NOT_STORED.setTokenized(true);
     TYPE_NOT_STORED.setOmitNorms(true);
-    TYPE_NOT_STORED.setIndexOptions(IndexOptions.DOCS_ONLY);
+    TYPE_NOT_STORED.setIndexOptions(IndexOptions.DOCS);
     TYPE_NOT_STORED.setNumericType(FieldType.NumericType.LONG);
     TYPE_NOT_STORED.freeze();
   }
@@ -144,7 +144,7 @@ public final class LongField extends Fie
   static {
     TYPE_STORED.setTokenized(true);
     TYPE_STORED.setOmitNorms(true);
-    TYPE_STORED.setIndexOptions(IndexOptions.DOCS_ONLY);
+    TYPE_STORED.setIndexOptions(IndexOptions.DOCS);
     TYPE_STORED.setNumericType(FieldType.NumericType.LONG);
     TYPE_STORED.setStored(true);
     TYPE_STORED.freeze();

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/NumericDocValuesField.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/NumericDocValuesField.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/NumericDocValuesField.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/NumericDocValuesField.java Fri Oct 31 15:10:08 2014
@@ -17,7 +17,7 @@ package org.apache.lucene.document;
  * limitations under the License.
  */
 
-import org.apache.lucene.index.FieldInfo;
+import org.apache.lucene.index.DocValuesType;
 
 /**
  * <p>
@@ -40,7 +40,7 @@ public class NumericDocValuesField exten
    */
   public static final FieldType TYPE = new FieldType();
   static {
-    TYPE.setDocValueType(FieldInfo.DocValuesType.NUMERIC);
+    TYPE.setDocValueType(DocValuesType.NUMERIC);
     TYPE.freeze();
   }
 

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/SortedDocValuesField.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/SortedDocValuesField.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/SortedDocValuesField.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/SortedDocValuesField.java Fri Oct 31 15:10:08 2014
@@ -17,7 +17,7 @@ package org.apache.lucene.document;
  * limitations under the License.
  */
 
-import org.apache.lucene.index.FieldInfo;
+import org.apache.lucene.index.DocValuesType;
 import org.apache.lucene.util.BytesRef;
 
 /**
@@ -43,7 +43,7 @@ public class SortedDocValuesField extend
    */
   public static final FieldType TYPE = new FieldType();
   static {
-    TYPE.setDocValueType(FieldInfo.DocValuesType.SORTED);
+    TYPE.setDocValueType(DocValuesType.SORTED);
     TYPE.freeze();
   }
 

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/SortedNumericDocValuesField.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/SortedNumericDocValuesField.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/SortedNumericDocValuesField.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/SortedNumericDocValuesField.java Fri Oct 31 15:10:08 2014
@@ -17,7 +17,7 @@ package org.apache.lucene.document;
  * limitations under the License.
  */
 
-import org.apache.lucene.index.FieldInfo;
+import org.apache.lucene.index.DocValuesType;
 import org.apache.lucene.util.NumericUtils;
 
 /**
@@ -50,7 +50,7 @@ public class SortedNumericDocValuesField
    */
   public static final FieldType TYPE = new FieldType();
   static {
-    TYPE.setDocValueType(FieldInfo.DocValuesType.SORTED_NUMERIC);
+    TYPE.setDocValueType(DocValuesType.SORTED_NUMERIC);
     TYPE.freeze();
   }
 

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/SortedSetDocValuesField.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/SortedSetDocValuesField.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/SortedSetDocValuesField.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/SortedSetDocValuesField.java Fri Oct 31 15:10:08 2014
@@ -17,7 +17,7 @@ package org.apache.lucene.document;
  * limitations under the License.
  */
 
-import org.apache.lucene.index.FieldInfo;
+import org.apache.lucene.index.DocValuesType;
 import org.apache.lucene.util.BytesRef;
 
 /**
@@ -44,7 +44,7 @@ public class SortedSetDocValuesField ext
    */
   public static final FieldType TYPE = new FieldType();
   static {
-    TYPE.setDocValueType(FieldInfo.DocValuesType.SORTED_SET);
+    TYPE.setDocValueType(DocValuesType.SORTED_SET);
     TYPE.freeze();
   }
 

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/StringField.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/StringField.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/StringField.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/StringField.java Fri Oct 31 15:10:08 2014
@@ -17,7 +17,7 @@ package org.apache.lucene.document;
  * limitations under the License.
  */
 
-import org.apache.lucene.index.FieldInfo.IndexOptions;
+import org.apache.lucene.index.IndexOptions;
 
 /** A field that is indexed but not tokenized: the entire
  *  String value is indexed as a single token.  For example
@@ -37,12 +37,12 @@ public final class StringField extends F
 
   static {
     TYPE_NOT_STORED.setOmitNorms(true);
-    TYPE_NOT_STORED.setIndexOptions(IndexOptions.DOCS_ONLY);
+    TYPE_NOT_STORED.setIndexOptions(IndexOptions.DOCS);
     TYPE_NOT_STORED.setTokenized(false);
     TYPE_NOT_STORED.freeze();
 
     TYPE_STORED.setOmitNorms(true);
-    TYPE_STORED.setIndexOptions(IndexOptions.DOCS_ONLY);
+    TYPE_STORED.setIndexOptions(IndexOptions.DOCS);
     TYPE_STORED.setStored(true);
     TYPE_STORED.setTokenized(false);
     TYPE_STORED.freeze();

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/TextField.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/TextField.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/TextField.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/document/TextField.java Fri Oct 31 15:10:08 2014
@@ -20,7 +20,7 @@ package org.apache.lucene.document;
 import java.io.Reader;
 
 import org.apache.lucene.analysis.TokenStream;
-import org.apache.lucene.index.FieldInfo.IndexOptions;
+import org.apache.lucene.index.IndexOptions;
 
 /** A field that is indexed and tokenized, without term
  *  vectors.  For example this would be used on a 'body'

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/BinaryDocValuesFieldUpdates.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/BinaryDocValuesFieldUpdates.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/BinaryDocValuesFieldUpdates.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/BinaryDocValuesFieldUpdates.java Fri Oct 31 15:10:08 2014
@@ -1,15 +1,5 @@
 package org.apache.lucene.index;
 
-import org.apache.lucene.document.BinaryDocValuesField;
-import org.apache.lucene.search.DocIdSetIterator;
-import org.apache.lucene.util.ArrayUtil;
-import org.apache.lucene.util.BytesRef;
-import org.apache.lucene.util.BytesRefBuilder;
-import org.apache.lucene.util.InPlaceMergeSorter;
-import org.apache.lucene.util.packed.PackedInts;
-import org.apache.lucene.util.packed.PagedGrowableWriter;
-import org.apache.lucene.util.packed.PagedMutable;
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -27,6 +17,15 @@ import org.apache.lucene.util.packed.Pag
  * limitations under the License.
  */
 
+import org.apache.lucene.document.BinaryDocValuesField;
+import org.apache.lucene.search.DocIdSetIterator;
+import org.apache.lucene.util.BytesRef;
+import org.apache.lucene.util.BytesRefBuilder;
+import org.apache.lucene.util.InPlaceMergeSorter;
+import org.apache.lucene.util.packed.PackedInts;
+import org.apache.lucene.util.packed.PagedGrowableWriter;
+import org.apache.lucene.util.packed.PagedMutable;
+
 /**
  * A {@link DocValuesFieldUpdates} which holds updates of documents, of a single
  * {@link BinaryDocValuesField}.
@@ -102,7 +101,7 @@ class BinaryDocValuesFieldUpdates extend
   private final int bitsPerValue;
   
   public BinaryDocValuesFieldUpdates(String field, int maxDoc) {
-    super(field, FieldInfo.DocValuesType.BINARY);
+    super(field, DocValuesType.BINARY);
     bitsPerValue = PackedInts.bitsRequired(maxDoc - 1);
     docs = new PagedMutable(1, PAGE_SIZE, bitsPerValue, PackedInts.COMPACT);
     offsets = new PagedGrowableWriter(1, PAGE_SIZE, 1, PackedInts.FAST);

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java Fri Oct 31 15:10:08 2014
@@ -33,7 +33,6 @@ import java.util.Map;
 import org.apache.lucene.codecs.Codec;
 import org.apache.lucene.codecs.PostingsFormat;
 import org.apache.lucene.index.CheckIndex.Status.DocValuesStatus;
-import org.apache.lucene.index.FieldInfo.IndexOptions;
 import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.store.AlreadyClosedException;
 import org.apache.lucene.store.Directory;

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java Fri Oct 31 15:10:08 2014
@@ -29,8 +29,6 @@ import org.apache.lucene.codecs.NormsCon
 import org.apache.lucene.codecs.NormsFormat;
 import org.apache.lucene.codecs.StoredFieldsWriter;
 import org.apache.lucene.document.FieldType;
-import org.apache.lucene.index.FieldInfo.DocValuesType;
-import org.apache.lucene.index.FieldInfo.IndexOptions;
 import org.apache.lucene.search.similarities.Similarity;
 import org.apache.lucene.store.IOContext;
 import org.apache.lucene.util.ArrayUtil;
@@ -364,7 +362,10 @@ final class DefaultIndexingChain extends
         }
 
         DocValuesType dvType = fieldType.docValueType();
-        if (dvType != null) {
+        if (dvType == null) {
+          throw new NullPointerException("docValueType cannot be null (field: \"" + fieldName + "\")");
+        }
+        if (dvType != DocValuesType.NO) {
           indexDocValue(fp, dvType, field);
         }
       }
@@ -378,7 +379,7 @@ final class DefaultIndexingChain extends
   }
 
   private static void verifyFieldType(String name, IndexableFieldType ft) {
-    if (ft.indexOptions() == null) {
+    if (ft.indexOptions() == IndexOptions.NO) {
       if (ft.storeTermVectors()) {
         throw new IllegalArgumentException("cannot store term vectors "
                                            + "for a field that is not indexed (field=\"" + name + "\")");

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/DocValuesFieldUpdates.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/DocValuesFieldUpdates.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/DocValuesFieldUpdates.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/DocValuesFieldUpdates.java Fri Oct 31 15:10:08 2014
@@ -1,12 +1,5 @@
 package org.apache.lucene.index;
 
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.lucene.index.NumericDocValuesFieldUpdates;
-import org.apache.lucene.search.DocIdSetIterator;
-import org.apache.lucene.util.packed.PagedGrowableWriter;
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -24,6 +17,12 @@ import org.apache.lucene.util.packed.Pag
  * limitations under the License.
  */
 
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.lucene.search.DocIdSetIterator;
+import org.apache.lucene.util.packed.PagedGrowableWriter;
+
 /**
  * Holds updates of a single DocValues field, for a set of documents.
  * 
@@ -98,7 +97,7 @@ abstract class DocValuesFieldUpdates {
       return ramBytesPerDoc;
     }
     
-    DocValuesFieldUpdates getUpdates(String field, FieldInfo.DocValuesType type) {
+    DocValuesFieldUpdates getUpdates(String field, DocValuesType type) {
       switch (type) {
         case NUMERIC:
           return numericDVUpdates.get(field);
@@ -109,7 +108,7 @@ abstract class DocValuesFieldUpdates {
       }
     }
     
-    DocValuesFieldUpdates newUpdates(String field, FieldInfo.DocValuesType type, int maxDoc) {
+    DocValuesFieldUpdates newUpdates(String field, DocValuesType type, int maxDoc) {
       switch (type) {
         case NUMERIC:
           assert numericDVUpdates.get(field) == null;
@@ -133,10 +132,13 @@ abstract class DocValuesFieldUpdates {
   }
   
   final String field;
-  final FieldInfo.DocValuesType type;
+  final DocValuesType type;
   
-  protected DocValuesFieldUpdates(String field, FieldInfo.DocValuesType type) {
+  protected DocValuesFieldUpdates(String field, DocValuesType type) {
     this.field = field;
+    if (type == null) {
+      throw new NullPointerException("DocValuesType cannot be null");
+    }
     this.type = type;
   }
   

Added: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/DocValuesType.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/DocValuesType.java?rev=1635790&view=auto
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/DocValuesType.java (added)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/DocValuesType.java Fri Oct 31 15:10:08 2014
@@ -0,0 +1,59 @@
+package org.apache.lucene.index;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+/**
+ * DocValues types. Note that DocValues is strongly typed, so a
+ * field cannot have different types across different documents.
+ */
+public enum DocValuesType {
+  /**
+   * No doc values for this field.
+   */
+  NO,
+  /** 
+   * A per-document Number
+   */
+  NUMERIC,
+  /**
+   * A per-document byte[].  Values may be larger than
+   * 32766 bytes, but different codecs may enforce their own limits.
+   */
+  BINARY,
+  /** 
+   * A pre-sorted byte[]. Fields with this type only store distinct byte values 
+   * and store an additional offset pointer per document to dereference the shared 
+   * byte[]. The stored byte[] is presorted and allows access via document id, 
+   * ordinal and by-value.  Values must be <= 32766 bytes.
+   */
+  SORTED,
+  /** 
+   * A pre-sorted Number[]. Fields with this type store numeric values in sorted
+   * order according to {@link Long#compare(long, long)}.
+   */
+  SORTED_NUMERIC,
+  /** 
+   * A pre-sorted Set&lt;byte[]&gt;. Fields with this type only store distinct byte values 
+   * and store additional offset pointers per document to dereference the shared 
+   * byte[]s. The stored byte[] is presorted and allows access via document id, 
+   * ordinal and by-value.  Values must be <= 32766 bytes.
+   */
+  SORTED_SET,
+}
+

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/DocValuesUpdate.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/DocValuesUpdate.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/DocValuesUpdate.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/DocValuesUpdate.java Fri Oct 31 15:10:08 2014
@@ -1,15 +1,5 @@
 package org.apache.lucene.index;
 
-import static org.apache.lucene.util.RamUsageEstimator.NUM_BYTES_ARRAY_HEADER;
-import static org.apache.lucene.util.RamUsageEstimator.NUM_BYTES_CHAR;
-import static org.apache.lucene.util.RamUsageEstimator.NUM_BYTES_INT;
-import static org.apache.lucene.util.RamUsageEstimator.NUM_BYTES_OBJECT_HEADER;
-import static org.apache.lucene.util.RamUsageEstimator.NUM_BYTES_OBJECT_REF;
-
-import org.apache.lucene.document.NumericDocValuesField;
-import org.apache.lucene.util.BytesRef;
-import org.apache.lucene.util.RamUsageEstimator;
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -27,6 +17,16 @@ import org.apache.lucene.util.RamUsageEs
  * limitations under the License.
  */
 
+import static org.apache.lucene.util.RamUsageEstimator.NUM_BYTES_ARRAY_HEADER;
+import static org.apache.lucene.util.RamUsageEstimator.NUM_BYTES_CHAR;
+import static org.apache.lucene.util.RamUsageEstimator.NUM_BYTES_INT;
+import static org.apache.lucene.util.RamUsageEstimator.NUM_BYTES_OBJECT_HEADER;
+import static org.apache.lucene.util.RamUsageEstimator.NUM_BYTES_OBJECT_REF;
+
+import org.apache.lucene.document.NumericDocValuesField;
+import org.apache.lucene.util.BytesRef;
+import org.apache.lucene.util.RamUsageEstimator;
+
 /** An in-place update to a DocValues field. */
 abstract class DocValuesUpdate {
   
@@ -39,7 +39,7 @@ abstract class DocValuesUpdate {
    */
   private static final int RAW_SIZE_IN_BYTES = 8*NUM_BYTES_OBJECT_HEADER + 8*NUM_BYTES_OBJECT_REF + 8*NUM_BYTES_INT;
   
-  final FieldInfo.DocValuesType type;
+  final DocValuesType type;
   final Term term;
   final String field;
   final Object value;
@@ -52,7 +52,7 @@ abstract class DocValuesUpdate {
    * @param field the {@link NumericDocValuesField} to update
    * @param value the updated value
    */
-  protected DocValuesUpdate(FieldInfo.DocValuesType type, Term term, String field, Object value) {
+  protected DocValuesUpdate(DocValuesType type, Term term, String field, Object value) {
     this.type = type;
     this.term = term;
     this.field = field;
@@ -82,7 +82,7 @@ abstract class DocValuesUpdate {
     private static final long RAW_VALUE_SIZE_IN_BYTES = NUM_BYTES_ARRAY_HEADER + 2*NUM_BYTES_INT + NUM_BYTES_OBJECT_REF;
     
     BinaryDocValuesUpdate(Term term, String field, BytesRef value) {
-      super(FieldInfo.DocValuesType.BINARY, term, field, value);
+      super(DocValuesType.BINARY, term, field, value);
     }
 
     @Override
@@ -96,7 +96,7 @@ abstract class DocValuesUpdate {
   static final class NumericDocValuesUpdate extends DocValuesUpdate {
 
     NumericDocValuesUpdate(Term term, String field, Long value) {
-      super(FieldInfo.DocValuesType.NUMERIC, term, field, value);
+      super(DocValuesType.NUMERIC, term, field, value);
     }
 
     @Override

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/DocsEnum.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/DocsEnum.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/DocsEnum.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/DocsEnum.java Fri Oct 31 15:10:08 2014
@@ -19,7 +19,6 @@ package org.apache.lucene.index;
 
 import java.io.IOException;
 
-import org.apache.lucene.index.FieldInfo.IndexOptions;
 import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.util.AttributeSource;
 import org.apache.lucene.util.Bits; // javadocs
@@ -50,7 +49,7 @@ public abstract class DocsEnum extends D
 
   /**
    * Returns term frequency in the current document, or 1 if the field was
-   * indexed with {@link IndexOptions#DOCS_ONLY}. Do not call this before
+   * indexed with {@link IndexOptions#DOCS}. Do not call this before
    * {@link #nextDoc} is first called, nor after {@link #nextDoc} returns
    * {@link DocIdSetIterator#NO_MORE_DOCS}.
    * 

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/FieldInfo.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/FieldInfo.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/FieldInfo.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/FieldInfo.java Fri Oct 31 15:10:08 2014
@@ -34,90 +34,19 @@ public final class FieldInfo {
   /** Internal field number */
   public final int number;
 
-  private DocValuesType docValueType;
+  private DocValuesType docValueType = DocValuesType.NO;
 
   // True if any document indexed term vectors
   private boolean storeTermVector;
 
   private boolean omitNorms; // omit norms associated with indexed fields  
 
-  private IndexOptions indexOptions;
+  private IndexOptions indexOptions = IndexOptions.NO;
   private boolean storePayloads; // whether this field stores payloads together with term positions
 
   private Map<String,String> attributes;
 
   private long dvGen;
-
-  /**
-   * Controls how much information is stored in the postings lists.
-   * @lucene.experimental
-   */
-  public static enum IndexOptions { 
-    // NOTE: order is important here; FieldInfo uses this
-    // order to merge two conflicting IndexOptions (always
-    // "downgrades" by picking the lowest).
-    /** 
-     * Only documents are indexed: term frequencies and positions are omitted.
-     * Phrase and other positional queries on the field will throw an exception, and scoring
-     * will behave as if any term in the document appears only once.
-     */
-    // TODO: maybe rename to just DOCS?
-    DOCS_ONLY,
-    /** 
-     * Only documents and term frequencies are indexed: positions are omitted. 
-     * This enables normal scoring, except Phrase and other positional queries
-     * will throw an exception.
-     */  
-    DOCS_AND_FREQS,
-    /** 
-     * Indexes documents, frequencies and positions.
-     * This is a typical default for full-text search: full scoring is enabled
-     * and positional queries are supported.
-     */
-    DOCS_AND_FREQS_AND_POSITIONS,
-    /** 
-     * Indexes documents, frequencies, positions and offsets.
-     * Character offsets are encoded alongside the positions. 
-     */
-    DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS,
-  }
-  
-  /**
-   * DocValues types.
-   * Note that DocValues is strongly typed, so a field cannot have different types
-   * across different documents.
-   */
-  public static enum DocValuesType {
-    /** 
-     * A per-document Number
-     */
-    NUMERIC,
-    /**
-     * A per-document byte[].  Values may be larger than
-     * 32766 bytes, but different codecs may enforce their own limits.
-     */
-    BINARY,
-    /** 
-     * A pre-sorted byte[]. Fields with this type only store distinct byte values 
-     * and store an additional offset pointer per document to dereference the shared 
-     * byte[]. The stored byte[] is presorted and allows access via document id, 
-     * ordinal and by-value.  Values must be <= 32766 bytes.
-     */
-    SORTED,
-    /** 
-     * A pre-sorted Number[]. Fields with this type store numeric values in sorted
-     * order according to {@link Long#compare(long, long)}.
-     */
-    SORTED_NUMERIC,
-    /** 
-     * A pre-sorted Set&lt;byte[]&gt;. Fields with this type only store distinct byte values 
-     * and store additional offset pointers per document to dereference the shared 
-     * byte[]s. The stored byte[] is presorted and allows access via document id, 
-     * ordinal and by-value.  Values must be <= 32766 bytes.
-     */
-    SORTED_SET
-  }
-
   /**
    * Sole constructor.
    *
@@ -126,19 +55,24 @@ public final class FieldInfo {
   public FieldInfo(String name, int number, boolean storeTermVector, boolean omitNorms, 
       boolean storePayloads, IndexOptions indexOptions, DocValuesType docValues,
       long dvGen, Map<String,String> attributes) {
+    if (docValues == null) {
+      throw new NullPointerException("DocValuesType cannot be null");
+    }
+    if (indexOptions == null) {
+      throw new NullPointerException("IndexOptions cannot be null");
+    }
     this.name = name;
     this.number = number;
     this.docValueType = docValues;
-    if (indexOptions != null) {
+    this.indexOptions = indexOptions;
+    if (indexOptions != IndexOptions.NO) {
       this.storeTermVector = storeTermVector;
       this.storePayloads = storePayloads;
       this.omitNorms = omitNorms;
-      this.indexOptions = indexOptions;
     } else { // for non-indexed fields, leave defaults
       this.storeTermVector = false;
       this.storePayloads = false;
       this.omitNorms = false;
-      this.indexOptions = null;
     }
     this.dvGen = dvGen;
     this.attributes = attributes;
@@ -150,7 +84,7 @@ public final class FieldInfo {
    * Always returns true (or throws IllegalStateException) 
    */
   public boolean checkConsistency() {
-    if (indexOptions != null) {
+    if (indexOptions != IndexOptions.NO) {
       // Cannot store payloads unless positions are indexed:
       if (indexOptions.compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS) < 0 && storePayloads) {
         throw new IllegalStateException("indexed field '" + name + "' cannot have payloads without positions");
@@ -180,26 +114,29 @@ public final class FieldInfo {
 
   // should only be called by FieldInfos#addOrUpdate
   void update(boolean storeTermVector, boolean omitNorms, boolean storePayloads, IndexOptions indexOptions) {
+    if (indexOptions == null) {
+      throw new NullPointerException("IndexOptions cannot be null");
+    }
     //System.out.println("FI.update field=" + name + " indexed=" + indexed + " omitNorms=" + omitNorms + " this.omitNorms=" + this.omitNorms);
     if (this.indexOptions != indexOptions) {
-      if (this.indexOptions == null) {
+      if (this.indexOptions == IndexOptions.NO) {
         this.indexOptions = indexOptions;
-      } else if (indexOptions != null) {
+      } else if (indexOptions != IndexOptions.NO) {
         // downgrade
         this.indexOptions = this.indexOptions.compareTo(indexOptions) < 0 ? this.indexOptions : indexOptions;
       }
     }
 
-    if (this.indexOptions != null) { // if updated field data is not for indexing, leave the updates out
+    if (this.indexOptions != IndexOptions.NO) { // if updated field data is not for indexing, leave the updates out
       this.storeTermVector |= storeTermVector;                // once vector, always vector
       this.storePayloads |= storePayloads;
 
       // Awkward: only drop norms if incoming update is indexed:
-      if (indexOptions != null && this.omitNorms != omitNorms) {
+      if (indexOptions != IndexOptions.NO && this.omitNorms != omitNorms) {
         this.omitNorms = true;                // if one require omitNorms at least once, it remains off for life
       }
     }
-    if (this.indexOptions == null || this.indexOptions.compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS) < 0) {
+    if (this.indexOptions == IndexOptions.NO || this.indexOptions.compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS) < 0) {
       // cannot store payloads if we don't store positions:
       this.storePayloads = false;
     }
@@ -207,14 +144,14 @@ public final class FieldInfo {
   }
 
   void setDocValuesType(DocValuesType type) {
-    if (docValueType != null && docValueType != type) {
+    if (docValueType != DocValuesType.NO && docValueType != type) {
       throw new IllegalArgumentException("cannot change DocValues type from " + docValueType + " to " + type + " for field \"" + name + "\"");
     }
     docValueType = type;
     assert checkConsistency();
   }
   
-  /** Returns IndexOptions for the field, or null if the field is not indexed */
+  /** Returns IndexOptions for the field, or IndexOptions.NO if the field is not indexed */
   public IndexOptions getIndexOptions() {
     return indexOptions;
   }
@@ -223,11 +160,12 @@ public final class FieldInfo {
    * Returns true if this field has any docValues.
    */
   public boolean hasDocValues() {
-    return docValueType != null;
+    return docValueType != DocValuesType.NO;
   }
 
   /**
-   * Returns {@link DocValuesType} of the docValues. this may be null if the field has no docvalues.
+   * Returns {@link DocValuesType} of the docValues; this is
+   * {@code DocValuesType.NO} if the field has no docvalues.
    */
   public DocValuesType getDocValuesType() {
     return docValueType;
@@ -253,7 +191,7 @@ public final class FieldInfo {
   }
   
   void setStorePayloads() {
-    if (indexOptions != null && indexOptions.compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS) >= 0) {
+    if (indexOptions != IndexOptions.NO && indexOptions.compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS) >= 0) {
       storePayloads = true;
     }
     assert checkConsistency();
@@ -274,10 +212,10 @@ public final class FieldInfo {
   }
   
   /**
-   * Returns true if this field is indexed (has non-null {@link #getIndexOptions}).
+   * Returns true if this field is indexed ({@link #getIndexOptions} is not IndexOptions.NO).
    */
   public boolean isIndexed() {
-    return indexOptions != null;
+    return indexOptions != IndexOptions.NO;
   }
   
   /**

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/FieldInfos.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/FieldInfos.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/FieldInfos.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/FieldInfos.java Fri Oct 31 15:10:08 2014
@@ -25,9 +25,6 @@ import java.util.Map;
 import java.util.SortedMap;
 import java.util.TreeMap;
 
-import org.apache.lucene.index.FieldInfo.DocValuesType;
-import org.apache.lucene.index.FieldInfo.IndexOptions;
-
 /** 
  * Collection of {@link FieldInfo}s (accessible by number or by name).
  *  @lucene.experimental
@@ -72,7 +69,7 @@ public class FieldInfos implements Itera
       
       hasVectors |= info.hasVectors();
       hasProx |= info.isIndexed() && info.getIndexOptions().compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS) >= 0;
-      hasFreq |= info.isIndexed() && info.getIndexOptions() != IndexOptions.DOCS_ONLY;
+      hasFreq |= info.isIndexed() && info.getIndexOptions() != IndexOptions.DOCS;
       hasOffsets |= info.isIndexed() && info.getIndexOptions().compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS) >= 0;
       hasNorms |= info.hasNorms();
       hasDocValues |= info.hasDocValues();
@@ -190,18 +187,17 @@ public class FieldInfos implements Itera
      * is used as the field number.
      */
     synchronized int addOrGet(String fieldName, int preferredFieldNumber, DocValuesType dvType) {
-      if (dvType != null) {
+      if (dvType != DocValuesType.NO) {
         DocValuesType currentDVType = docValuesType.get(fieldName);
         if (currentDVType == null) {
           docValuesType.put(fieldName, dvType);
-        } else if (currentDVType != null && currentDVType != dvType) {
+        } else if (currentDVType != DocValuesType.NO && currentDVType != dvType) {
           throw new IllegalArgumentException("cannot change DocValues type from " + currentDVType + " to " + dvType + " for field \"" + fieldName + "\"");
         }
       }
       Integer fieldNumber = nameToNumber.get(fieldName);
       if (fieldNumber == null) {
         final Integer preferredBoxed = Integer.valueOf(preferredFieldNumber);
-
         if (preferredFieldNumber != -1 && !numberToName.containsKey(preferredBoxed)) {
           // cool - we can use this number globally
           fieldNumber = preferredBoxed;
@@ -212,7 +208,7 @@ public class FieldInfos implements Itera
           }
           fieldNumber = lowestUnassignedFieldNumber;
         }
-        
+        assert fieldNumber >= 0;
         numberToName.put(fieldNumber, fieldName);
         nameToNumber.put(fieldName, fieldNumber);
       }
@@ -228,7 +224,7 @@ public class FieldInfos implements Itera
         throw new IllegalArgumentException("field name \"" + name + "\" is already mapped to field number \"" + nameToNumber.get(name) + "\", not \"" + number + "\"");
       }
       DocValuesType currentDVType = docValuesType.get(name);
-      if (dvType != null && currentDVType != null && dvType != currentDVType) {
+      if (dvType != DocValuesType.NO && currentDVType != null && currentDVType != DocValuesType.NO && dvType != currentDVType) {
         throw new IllegalArgumentException("cannot change DocValues type from " + currentDVType + " to " + dvType + " for field \"" + name + "\"");
       }
     }
@@ -298,6 +294,9 @@ public class FieldInfos implements Itera
     private FieldInfo addOrUpdateInternal(String name, int preferredFieldNumber,
         boolean storeTermVector,
         boolean omitNorms, boolean storePayloads, IndexOptions indexOptions, DocValuesType docValues) {
+      if (docValues == null) {
+        throw new NullPointerException("DocValuesType cannot be null");
+      }
       FieldInfo fi = fieldInfo(name);
       if (fi == null) {
         // This field wasn't yet added to this in-RAM
@@ -313,7 +312,7 @@ public class FieldInfos implements Itera
       } else {
         fi.update(storeTermVector, omitNorms, storePayloads, indexOptions);
 
-        if (docValues != null) {
+        if (docValues != DocValuesType.NO) {
           // Only pay the synchronization cost if fi does not already have a DVType
           boolean updateGlobal = !fi.hasDocValues();
           if (updateGlobal) {

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/FreqProxFields.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/FreqProxFields.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/FreqProxFields.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/FreqProxFields.java Fri Oct 31 15:10:08 2014
@@ -23,7 +23,6 @@ import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.lucene.index.FieldInfo.IndexOptions;
 import org.apache.lucene.index.FreqProxTermsWriterPerField.FreqProxPostingsArray;
 import org.apache.lucene.util.AttributeSource; // javadocs
 import org.apache.lucene.util.Bits;

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/FreqProxTermsWriterPerField.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/FreqProxTermsWriterPerField.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/FreqProxTermsWriterPerField.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/FreqProxTermsWriterPerField.java Fri Oct 31 15:10:08 2014
@@ -21,7 +21,6 @@ import java.io.IOException;
 
 import org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
 import org.apache.lucene.analysis.tokenattributes.PayloadAttribute;
-import org.apache.lucene.index.FieldInfo.IndexOptions;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.RamUsageEstimator;
 
@@ -50,7 +49,7 @@ final class FreqProxTermsWriterPerField 
   public FreqProxTermsWriterPerField(FieldInvertState invertState, TermsHash termsHash, FieldInfo fieldInfo, TermsHashPerField nextPerField) {
     super(fieldInfo.getIndexOptions().compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS) >= 0 ? 2 : 1, invertState, termsHash, nextPerField, fieldInfo);
     IndexOptions indexOptions = fieldInfo.getIndexOptions();
-    assert indexOptions != null;
+    assert indexOptions != IndexOptions.NO;
     hasFreq = indexOptions.compareTo(IndexOptions.DOCS_AND_FREQS) >= 0;
     hasProx = indexOptions.compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS) >= 0;
     hasOffsets = indexOptions.compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS) >= 0;
@@ -196,7 +195,7 @@ final class FreqProxTermsWriterPerField 
   @Override
   ParallelPostingsArray createPostingsArray(int size) {
     IndexOptions indexOptions = fieldInfo.getIndexOptions();
-    assert indexOptions != null;
+    assert indexOptions != IndexOptions.NO;
     boolean hasFreq = indexOptions.compareTo(IndexOptions.DOCS_AND_FREQS) >= 0;
     boolean hasProx = indexOptions.compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS) >= 0;
     boolean hasOffsets = indexOptions.compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS) >= 0;

Added: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/IndexOptions.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/IndexOptions.java?rev=1635790&view=auto
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/IndexOptions.java (added)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/IndexOptions.java Fri Oct 31 15:10:08 2014
@@ -0,0 +1,55 @@
+package org.apache.lucene.index;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Controls how much information is stored in the postings lists.
+ * @lucene.experimental
+ */
+
+public enum IndexOptions { 
+  // NOTE: order is important here; FieldInfo uses this
+  // order to merge two conflicting IndexOptions (always
+  // "downgrades" by picking the lowest).
+  /** Not indexed */
+  NO,
+  /** 
+   * Only documents are indexed: term frequencies and positions are omitted.
+   * Phrase and other positional queries on the field will throw an exception, and scoring
+   * will behave as if any term in the document appears only once.
+   */
+  DOCS,
+  /** 
+   * Only documents and term frequencies are indexed: positions are omitted. 
+   * This enables normal scoring, except Phrase and other positional queries
+   * will throw an exception.
+   */  
+  DOCS_AND_FREQS,
+  /** 
+   * Indexes documents, frequencies and positions.
+   * This is a typical default for full-text search: full scoring is enabled
+   * and positional queries are supported.
+   */
+  DOCS_AND_FREQS_AND_POSITIONS,
+  /** 
+   * Indexes documents, frequencies, positions and offsets.
+   * Character offsets are encoded alongside the positions. 
+   */
+  DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS,
+}
+  

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java Fri Oct 31 15:10:08 2014
@@ -45,7 +45,6 @@ import org.apache.lucene.codecs.FieldInf
 import org.apache.lucene.document.Field;
 import org.apache.lucene.index.DocValuesUpdate.BinaryDocValuesUpdate;
 import org.apache.lucene.index.DocValuesUpdate.NumericDocValuesUpdate;
-import org.apache.lucene.index.FieldInfo.DocValuesType;
 import org.apache.lucene.index.FieldInfos.FieldNumbers;
 import org.apache.lucene.index.IndexWriterConfig.OpenMode;
 import org.apache.lucene.index.MergeState.CheckAbort;
@@ -1499,6 +1498,9 @@ public class IndexWriter implements Clos
       final Field f = updates[i];
       final DocValuesType dvType = f.fieldType().docValueType();
       if (dvType == null) {
+        throw new NullPointerException("DocValuesType cannot be null (field: \"" + f.name() + "\")");
+      }
+      if (dvType == DocValuesType.NO) {
         throw new IllegalArgumentException("can only update NUMERIC or BINARY fields! field=" + f.name());
       }
       if (!globalFieldNumberMap.contains(f.name(), dvType)) {

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/IndexableField.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/IndexableField.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/IndexableField.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/IndexableField.java Fri Oct 31 15:10:08 2014
@@ -64,8 +64,8 @@ public interface IndexableField extends 
    * the range of that encoding.
    * <p>
    * It is illegal to return a boost other than 1.0f for a field that is not
-   * indexed ({@link IndexableFieldType#indexOptions()} is null) or omits normalization values
-   * ({@link IndexableFieldType#omitNorms()} returns true).
+   * indexed ({@link IndexableFieldType#indexOptions()} is IndexOptions.NO) or
+   * omits normalization values ({@link IndexableFieldType#omitNorms()} returns true).
    *
    * @see Similarity#computeNorm(FieldInvertState)
    * @see DefaultSimilarity#encodeNormValue(float)

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/IndexableFieldType.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/IndexableFieldType.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/IndexableFieldType.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/IndexableFieldType.java Fri Oct 31 15:10:08 2014
@@ -18,8 +18,6 @@ package org.apache.lucene.index;
  */
 
 import org.apache.lucene.analysis.Analyzer; // javadocs
-import org.apache.lucene.index.FieldInfo.DocValuesType;
-import org.apache.lucene.index.FieldInfo.IndexOptions;
 
 /** 
  * Describes the properties of a field.
@@ -34,7 +32,8 @@ public interface IndexableFieldType {
    * True if this field's value should be analyzed by the
    * {@link Analyzer}.
    * <p>
-   * This has no effect if {@link #indexOptions()} returns null.
+   * This has no effect if {@link #indexOptions()} returns
+   * IndexOptions.NO.
    */
   // TODO: shouldn't we remove this?  Whether/how a field is
   // tokenized is an impl detail under Field?
@@ -48,7 +47,8 @@ public interface IndexableFieldType {
    * can be accessed in a document-oriented way from 
    * {@link IndexReader#getTermVector(int,String)}.
    * <p>
-   * This option is illegal if {@link #indexOptions()} returns null.
+   * This option is illegal if {@link #indexOptions()} returns
+   * IndexOptions.NO.
    */
   public boolean storeTermVectors();
 
@@ -88,13 +88,12 @@ public interface IndexableFieldType {
   public boolean omitNorms();
 
   /** {@link IndexOptions}, describing what should be
-   *  recorded into the inverted index, or null if this field
-   *  is not indexed */
+   *  recorded into the inverted index */
   public IndexOptions indexOptions();
 
   /** 
-   * DocValues {@link DocValuesType}: if non-null then the field's value
-   * will be indexed into docValues.
+   * DocValues {@link DocValuesType}: how the field's value will be indexed
+   * into docValues.
    */
   public DocValuesType docValueType();  
 }

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/NumericDocValuesFieldUpdates.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/NumericDocValuesFieldUpdates.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/NumericDocValuesFieldUpdates.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/NumericDocValuesFieldUpdates.java Fri Oct 31 15:10:08 2014
@@ -86,7 +86,7 @@ class NumericDocValuesFieldUpdates exten
   private int size;
   
   public NumericDocValuesFieldUpdates(String field, int maxDoc) {
-    super(field, FieldInfo.DocValuesType.NUMERIC);
+    super(field, DocValuesType.NUMERIC);
     bitsPerValue = PackedInts.bitsRequired(maxDoc - 1);
     docs = new PagedMutable(1, PAGE_SIZE, bitsPerValue, PackedInts.COMPACT);
     values = new PagedGrowableWriter(1, PAGE_SIZE, 1, PackedInts.FAST);

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SegmentReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SegmentReader.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SegmentReader.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SegmentReader.java Fri Oct 31 15:10:08 2014
@@ -32,7 +32,6 @@ import org.apache.lucene.codecs.FieldsPr
 import org.apache.lucene.codecs.NormsProducer;
 import org.apache.lucene.codecs.StoredFieldsReader;
 import org.apache.lucene.codecs.TermVectorsReader;
-import org.apache.lucene.index.FieldInfo.DocValuesType;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.IOContext;
 import org.apache.lucene.util.Accountable;
@@ -340,7 +339,7 @@ public final class SegmentReader extends
       // Field does not exist
       return null;
     }
-    if (fi.getDocValuesType() == null) {
+    if (fi.getDocValuesType() == DocValuesType.NO) {
       // Field was not indexed with doc values
       return null;
     }
@@ -385,7 +384,7 @@ public final class SegmentReader extends
         // Field does not exist
         return null;
       }
-      if (fi.getDocValuesType() == null) {
+      if (fi.getDocValuesType() == DocValuesType.NO) {
         // Field was not indexed with doc values
         return null;
       }

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SlowCompositeReaderWrapper.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SlowCompositeReaderWrapper.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SlowCompositeReaderWrapper.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SlowCompositeReaderWrapper.java Fri Oct 31 15:10:08 2014
@@ -23,7 +23,6 @@ import java.util.Map;
 
 import org.apache.lucene.util.Bits;
 
-import org.apache.lucene.index.FieldInfo.DocValuesType;
 import org.apache.lucene.index.MultiDocValues.MultiSortedDocValues;
 import org.apache.lucene.index.MultiDocValues.MultiSortedSetDocValues;
 import org.apache.lucene.index.MultiDocValues.OrdinalMap;

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/TermVectorsConsumerPerField.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/TermVectorsConsumerPerField.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/TermVectorsConsumerPerField.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/TermVectorsConsumerPerField.java Fri Oct 31 15:10:08 2014
@@ -111,7 +111,7 @@ final class TermVectorsConsumerPerField 
 
   @Override
   boolean start(IndexableField field, boolean first) {
-    assert field.fieldType().indexOptions() != null;
+    assert field.fieldType().indexOptions() != IndexOptions.NO;
 
     if (first) {
 

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/package.html
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/package.html?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/package.html (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/package.html Fri Oct 31 15:10:08 2014
@@ -161,7 +161,7 @@ while ((docid = docsAndPositionsEnum.nex
            of occurrences of this term across all documents. Note that this statistic 
            is unavailable (returns <code>-1</code>) if term frequencies were omitted 
            from the index 
-           ({@link org.apache.lucene.index.FieldInfo.IndexOptions#DOCS_ONLY DOCS_ONLY}) 
+           ({@link org.apache.lucene.index.IndexOptions#DOCS DOCS}) 
            for the field. Like docFreq(), it will also count occurrences that appear in 
            deleted documents.
     </ul>
@@ -194,7 +194,7 @@ while ((docid = docsAndPositionsEnum.nex
            field, and like totalTermFreq() it will also count occurrences that appear in
            deleted documents, and will be unavailable (returns <code>-1</code>) if term 
            frequencies were omitted from the index 
-           ({@link org.apache.lucene.index.FieldInfo.IndexOptions#DOCS_ONLY DOCS_ONLY}) 
+           ({@link org.apache.lucene.index.IndexOptions#DOCS DOCS}) 
            for the field.
     </ul>
 </p>

Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/analysis/TestMockAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/analysis/TestMockAnalyzer.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/analysis/TestMockAnalyzer.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/analysis/TestMockAnalyzer.java Fri Oct 31 15:10:08 2014
@@ -25,19 +25,19 @@ import java.util.Random;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.document.FieldType;
-import org.apache.lucene.index.LeafReader;
 import org.apache.lucene.index.DocsAndPositionsEnum;
-import org.apache.lucene.index.FieldInfo.IndexOptions;
 import org.apache.lucene.index.Fields;
+import org.apache.lucene.index.IndexOptions;
+import org.apache.lucene.index.LeafReader;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.index.Terms;
 import org.apache.lucene.index.TermsEnum;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.TestUtil;
-import org.apache.lucene.util.automaton.AutomatonTestUtil;
 import org.apache.lucene.util.automaton.Automata;
-import org.apache.lucene.util.automaton.Operations;
+import org.apache.lucene.util.automaton.AutomatonTestUtil;
 import org.apache.lucene.util.automaton.CharacterRunAutomaton;
+import org.apache.lucene.util.automaton.Operations;
 import org.apache.lucene.util.automaton.RegExp;
 
 public class TestMockAnalyzer extends BaseTokenStreamTestCase {
@@ -305,7 +305,7 @@ public class TestMockAnalyzer extends Ba
     final RandomIndexWriter writer = new RandomIndexWriter(random(), newDirectory());
     final Document doc = new Document();
     final FieldType ft = new FieldType();
-    ft.setIndexOptions(IndexOptions.DOCS_ONLY);
+    ft.setIndexOptions(IndexOptions.DOCS);
     ft.setTokenized(true);
     ft.setStoreTermVectors(true);
     ft.setStoreTermVectorPositions(true);

Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/codecs/lucene50/TestBlockPostingsFormat2.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/codecs/lucene50/TestBlockPostingsFormat2.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/codecs/lucene50/TestBlockPostingsFormat2.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/codecs/lucene50/TestBlockPostingsFormat2.java Fri Oct 31 15:10:08 2014
@@ -22,8 +22,7 @@ import org.apache.lucene.document.Docume
 import org.apache.lucene.document.Field;
 import org.apache.lucene.document.FieldType;
 import org.apache.lucene.document.TextField;
-import org.apache.lucene.index.FieldInfo.IndexOptions;
-import org.apache.lucene.index.FieldInfo;
+import org.apache.lucene.index.IndexOptions;
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.IndexWriterConfig.OpenMode;
 import org.apache.lucene.index.IndexWriterConfig;
@@ -66,7 +65,10 @@ public class TestBlockPostingsFormat2 ex
   
   private Document newDocument() {
     Document doc = new Document();
-    for (IndexOptions option : FieldInfo.IndexOptions.values()) {
+    for (IndexOptions option : IndexOptions.values()) {
+      if (option == IndexOptions.NO) {
+        continue;
+      }
       FieldType ft = new FieldType(TextField.TYPE_NOT_STORED);
       // turn on tvs for a cross-check, since we rely upon checkindex in this test (for now)
       ft.setStoreTermVectors(true);

Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/codecs/lucene50/TestBlockPostingsFormat3.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/codecs/lucene50/TestBlockPostingsFormat3.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/codecs/lucene50/TestBlockPostingsFormat3.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/codecs/lucene50/TestBlockPostingsFormat3.java Fri Oct 31 15:10:08 2014
@@ -32,18 +32,18 @@ import org.apache.lucene.document.Docume
 import org.apache.lucene.document.Field;
 import org.apache.lucene.document.FieldType;
 import org.apache.lucene.document.TextField;
-import org.apache.lucene.index.LeafReader;
-import org.apache.lucene.index.LeafReaderContext;
-import org.apache.lucene.index.FieldInfo.IndexOptions;
-import org.apache.lucene.index.IndexWriterConfig.OpenMode;
-import org.apache.lucene.index.TermsEnum.SeekStatus;
 import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.DocsAndPositionsEnum;
 import org.apache.lucene.index.DocsEnum;
+import org.apache.lucene.index.IndexOptions;
 import org.apache.lucene.index.IndexWriter;
+import org.apache.lucene.index.IndexWriterConfig.OpenMode;
 import org.apache.lucene.index.IndexWriterConfig;
+import org.apache.lucene.index.LeafReader;
+import org.apache.lucene.index.LeafReaderContext;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.index.Terms;
+import org.apache.lucene.index.TermsEnum.SeekStatus;
 import org.apache.lucene.index.TermsEnum;
 import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.store.Directory;
@@ -90,7 +90,7 @@ public class TestBlockPostingsFormat3 ex
     FieldType docsOnlyType = new FieldType(TextField.TYPE_NOT_STORED);
     // turn this on for a cross-check
     docsOnlyType.setStoreTermVectors(true);
-    docsOnlyType.setIndexOptions(IndexOptions.DOCS_ONLY);
+    docsOnlyType.setIndexOptions(IndexOptions.DOCS);
     
     FieldType docsAndFreqsType = new FieldType(TextField.TYPE_NOT_STORED);
     // turn this on for a cross-check

Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/document/TestDocument.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/document/TestDocument.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/document/TestDocument.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/document/TestDocument.java Fri Oct 31 15:10:08 2014
@@ -25,7 +25,7 @@ import java.util.List;
 import org.apache.lucene.analysis.MockTokenizer;
 import org.apache.lucene.analysis.Tokenizer;
 import org.apache.lucene.index.DirectoryReader;
-import org.apache.lucene.index.FieldInfo.IndexOptions;
+import org.apache.lucene.index.IndexOptions;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.index.StorableField;
@@ -65,7 +65,7 @@ public class TestDocument extends Lucene
     
     assertTrue(binaryFld.binaryValue() != null);
     assertTrue(binaryFld.fieldType().stored());
-    assertNull(binaryFld.fieldType().indexOptions());
+    assertEquals(IndexOptions.NO, binaryFld.fieldType().indexOptions());
     
     String binaryTest = doc.getBinaryValue("binary").utf8ToString();
     assertTrue(binaryTest.equals(binaryVal));

Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/document/TestFieldType.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/document/TestFieldType.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/document/TestFieldType.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/document/TestFieldType.java Fri Oct 31 15:10:08 2014
@@ -18,8 +18,8 @@ package org.apache.lucene.document;
  */
 
 import org.apache.lucene.document.FieldType.NumericType;
-import org.apache.lucene.index.FieldInfo.DocValuesType;
-import org.apache.lucene.index.FieldInfo.IndexOptions;
+import org.apache.lucene.index.DocValuesType;
+import org.apache.lucene.index.IndexOptions;
 import org.apache.lucene.util.LuceneTestCase;
 
 /** simple testcases for concrete impl of IndexableFieldType */

Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/Test2BPostings.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/Test2BPostings.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/Test2BPostings.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/Test2BPostings.java Fri Oct 31 15:10:08 2014
@@ -24,13 +24,11 @@ import org.apache.lucene.document.Docume
 import org.apache.lucene.document.Field;
 import org.apache.lucene.document.FieldType;
 import org.apache.lucene.document.TextField;
-import org.apache.lucene.index.FieldInfo.IndexOptions;
 import org.apache.lucene.store.BaseDirectoryWrapper;
 import org.apache.lucene.store.MockDirectoryWrapper;
-import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.TimeUnits;
-
 import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite;
 
 /**
@@ -66,7 +64,7 @@ public class Test2BPostings extends Luce
     Document doc = new Document();
     FieldType ft = new FieldType(TextField.TYPE_NOT_STORED);
     ft.setOmitNorms(true);
-    ft.setIndexOptions(IndexOptions.DOCS_ONLY);
+    ft.setIndexOptions(IndexOptions.DOCS);
     Field field = new Field("field", new MyTokenStream(), ft);
     doc.add(field);
     

Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/Test2BPostingsBytes.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/Test2BPostingsBytes.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/Test2BPostingsBytes.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/Test2BPostingsBytes.java Fri Oct 31 15:10:08 2014
@@ -26,17 +26,13 @@ import org.apache.lucene.document.Docume
 import org.apache.lucene.document.Field;
 import org.apache.lucene.document.FieldType;
 import org.apache.lucene.document.TextField;
-import org.apache.lucene.index.FieldInfo.IndexOptions;
 import org.apache.lucene.store.BaseDirectoryWrapper;
 import org.apache.lucene.store.MockDirectoryWrapper;
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.TestUtil;
-import org.apache.lucene.util.TimeUnits;
 import org.apache.lucene.util.LuceneTestCase.Monster;
 import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
 
-import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite;
-
 /**
  * Test indexes 2B docs with 65k freqs each, 
  * so you get > Integer.MAX_VALUE postings data for the term

Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/Test2BTerms.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/Test2BTerms.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/Test2BTerms.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/Test2BTerms.java Fri Oct 31 15:10:08 2014
@@ -31,7 +31,6 @@ import org.apache.lucene.document.Docume
 import org.apache.lucene.document.Field;
 import org.apache.lucene.document.FieldType;
 import org.apache.lucene.document.TextField;
-import org.apache.lucene.index.FieldInfo.IndexOptions;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.TermQuery;
 import org.apache.lucene.store.BaseDirectoryWrapper;
@@ -42,7 +41,6 @@ import org.apache.lucene.util.AttributeI
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.LuceneTestCase.Monster;
 import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
-import org.apache.lucene.util.LuceneTestCase.SuppressSysoutChecks;
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.TestUtil;
 import org.apache.lucene.util.TimeUnits;
@@ -197,7 +195,7 @@ public class Test2BTerms extends LuceneT
       final MyTokenStream ts = new MyTokenStream(random(), TERMS_PER_DOC);
 
       FieldType customType = new FieldType(TextField.TYPE_NOT_STORED);
-      customType.setIndexOptions(IndexOptions.DOCS_ONLY);
+      customType.setIndexOptions(IndexOptions.DOCS);
       customType.setOmitNorms(true);
       Field field = new Field("field", ts, customType);
       doc.add(field);

Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestAddIndexes.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestAddIndexes.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestAddIndexes.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestAddIndexes.java Fri Oct 31 15:10:08 2014
@@ -34,7 +34,6 @@ 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.IndexOptions;
 import org.apache.lucene.index.IndexWriterConfig.OpenMode;
 import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.search.PhraseQuery;

Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestBagOfPositions.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestBagOfPositions.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestBagOfPositions.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestBagOfPositions.java Fri Oct 31 15:10:08 2014
@@ -28,7 +28,6 @@ import org.apache.lucene.analysis.MockAn
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.document.FieldType;
-import org.apache.lucene.index.FieldInfo.IndexOptions;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;

Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestCodecs.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestCodecs.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestCodecs.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestCodecs.java Fri Oct 31 15:10:08 2014
@@ -30,8 +30,6 @@ import org.apache.lucene.codecs.FieldsPr
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field.Store;
 import org.apache.lucene.document.StringField;
-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;
 import org.apache.lucene.search.Query;
@@ -114,10 +112,10 @@ public class TestCodecs extends LuceneTe
         public boolean omitNorms() { return false; }
 
         @Override
-        public IndexOptions indexOptions() { return omitTF ? IndexOptions.DOCS_ONLY : IndexOptions.DOCS_AND_FREQS_AND_POSITIONS; }
+        public IndexOptions indexOptions() { return omitTF ? IndexOptions.DOCS : IndexOptions.DOCS_AND_FREQS_AND_POSITIONS; }
 
         @Override
-        public DocValuesType docValueType() { return null; }
+        public DocValuesType docValueType() { return DocValuesType.NO; }
       });
       if (storePayloads) {
         fieldInfo.setStorePayloads();

Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestDocumentWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestDocumentWriter.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestDocumentWriter.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestDocumentWriter.java Fri Oct 31 15:10:08 2014
@@ -27,7 +27,6 @@ import org.apache.lucene.document.Docume
 import org.apache.lucene.document.Field;
 import org.apache.lucene.document.FieldType;
 import org.apache.lucene.document.TextField;
-import org.apache.lucene.index.FieldInfo.IndexOptions;
 import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.AttributeSource;
@@ -274,7 +273,7 @@ public class TestDocumentWriter extends 
     doc.add(newField("f1", "v2", customType2));
     // f2 has no TF
     FieldType customType3 = new FieldType(TextField.TYPE_NOT_STORED);
-    customType3.setIndexOptions(IndexOptions.DOCS_ONLY);
+    customType3.setIndexOptions(IndexOptions.DOCS);
     Field f = newField("f2", "v1", customType3);
     doc.add(f);
     doc.add(newField("f2", "v2", customType2));
@@ -293,7 +292,7 @@ public class TestDocumentWriter extends 
     assertEquals("omitTermFreqAndPositions field bit should not be set for f1", IndexOptions.DOCS_AND_FREQS_AND_POSITIONS, fi.fieldInfo("f1").getIndexOptions());
     // f2
     assertTrue("f2 should have norms", fi.fieldInfo("f2").hasNorms());
-    assertEquals("omitTermFreqAndPositions field bit should be set for f2", IndexOptions.DOCS_ONLY, fi.fieldInfo("f2").getIndexOptions());
+    assertEquals("omitTermFreqAndPositions field bit should be set for f2", IndexOptions.DOCS, fi.fieldInfo("f2").getIndexOptions());
     reader.close();
   }
 }

Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestExceedMaxTermLength.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestExceedMaxTermLength.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestExceedMaxTermLength.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestExceedMaxTermLength.java Fri Oct 31 15:10:08 2014
@@ -23,7 +23,6 @@ import org.apache.lucene.analysis.MockAn
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.document.FieldType;
-import org.apache.lucene.index.FieldInfo.IndexOptions;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.TestUtil;

Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestFieldsReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestFieldsReader.java?rev=1635790&r1=1635789&r2=1635790&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestFieldsReader.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestFieldsReader.java Fri Oct 31 15:10:08 2014
@@ -17,7 +17,6 @@ package org.apache.lucene.index;
  * limitations under the License.
  */
 
-import java.io.File;
 import java.io.IOException;
 import java.nio.file.Path;
 import java.util.*;
@@ -27,7 +26,6 @@ import org.apache.lucene.analysis.MockAn
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.DocumentStoredFieldVisitor;
 import org.apache.lucene.document.Field;
-import org.apache.lucene.index.FieldInfo.IndexOptions;
 import org.apache.lucene.index.IndexWriterConfig.OpenMode;
 import org.apache.lucene.store.BaseDirectory;
 import org.apache.lucene.store.BufferedIndexInput;
@@ -96,7 +94,7 @@ public class TestFieldsReader extends Lu
     assertTrue(field != null);
     assertFalse(field.fieldType().storeTermVectors());
     assertFalse(field.fieldType().omitNorms());
-    assertTrue(field.fieldType().indexOptions() == IndexOptions.DOCS_ONLY);
+    assertTrue(field.fieldType().indexOptions() == IndexOptions.DOCS);
 
     DocumentStoredFieldVisitor visitor = new DocumentStoredFieldVisitor(DocHelper.TEXT_FIELD_3_KEY);
     reader.document(0, visitor);



Mime
View raw message