lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sim...@apache.org
Subject svn commit: r1131089 - in /lucene/dev/branches/docvalues/lucene/src: java/org/apache/lucene/document/ java/org/apache/lucene/index/ java/org/apache/lucene/index/values/ test-framework/org/apache/lucene/index/ test/org/apache/lucene/index/values/ test/o...
Date Fri, 03 Jun 2011 16:14:19 GMT
Author: simonw
Date: Fri Jun  3 16:14:18 2011
New Revision: 1131089

URL: http://svn.apache.org/viewvc?rev=1131089&view=rev
Log:
LUCENE-3108: Renamed parts of the DocValues API according to IndexDocValues and added javadoc comment

Added:
    lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/document/IndexDocValuesField.java
      - copied, changed from r1129588, lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/document/DocValuesField.java
    lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/IntsImpl.java
      - copied, changed from r1131061, lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/PackedIntsImpl.java
    lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/MultiIndexDocValues.java
      - copied, changed from r1131061, lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/MultiDocValues.java
    lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/ValuesEnum.java
      - copied, changed from r1129588, lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/DocValuesEnum.java
Removed:
    lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/document/DocValuesField.java
    lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/DocValuesEnum.java
    lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/MultiDocValues.java
    lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/PackedIntsImpl.java
Modified:
    lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/CheckIndex.java
    lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/DirectoryReader.java
    lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/FieldsEnum.java
    lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/MultiFields.java
    lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/MultiFieldsEnum.java
    lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/MultiPerDocValues.java
    lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/MultiReader.java
    lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/Bytes.java
    lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/FixedDerefBytesImpl.java
    lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/FixedSortedBytesImpl.java
    lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/FixedStraightBytesImpl.java
    lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/Floats.java
    lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/IndexDocValues.java
    lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/Ints.java
    lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/PerDocFieldValues.java
    lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/ValueType.java
    lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/VarDerefBytesImpl.java
    lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/VarSortedBytesImpl.java
    lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/VarStraightBytesImpl.java
    lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/Writer.java
    lucene/dev/branches/docvalues/lucene/src/test-framework/org/apache/lucene/index/RandomIndexWriter.java
    lucene/dev/branches/docvalues/lucene/src/test/org/apache/lucene/index/values/TestDocValues.java
    lucene/dev/branches/docvalues/lucene/src/test/org/apache/lucene/index/values/TestDocValuesIndexing.java
    lucene/dev/branches/docvalues/lucene/src/test/org/apache/lucene/search/TestSort.java

Copied: lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/document/IndexDocValuesField.java (from r1129588, lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/document/DocValuesField.java)
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/document/IndexDocValuesField.java?p2=lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/document/IndexDocValuesField.java&p1=lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/document/DocValuesField.java&r1=1129588&r2=1131089&rev=1131089&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/document/DocValuesField.java (original)
+++ lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/document/IndexDocValuesField.java Fri Jun  3 16:14:18 2011
@@ -34,14 +34,14 @@ import org.apache.lucene.util.BytesRef;
  * example usage, adding an int value:
  * 
  * <pre>
- * document.add(new DocValuesField(name).setInt(value));
+ * document.add(new IndexDocValuesField(name).setInt(value));
  * </pre>
  * 
  * For optimal performance, re-use the <code>DocValuesField</code> and
  * {@link Document} instance for more than one document:
  * 
  * <pre>
- *  DocValuesField field = new DocValuesField(name);
+ *  IndexDocValuesField field = new IndexDocValuesField(name);
  *  Document document = new Document();
  *  document.add(field);
  * 
@@ -55,11 +55,11 @@ import org.apache.lucene.util.BytesRef;
  * 
  * <p>
  * If doc values are stored in addition to an indexed ({@link Index}) or stored
- * ({@link Store}) value it's recommended to use the {@link DocValuesField}'s
+ * ({@link Store}) value it's recommended to use the {@link IndexDocValuesField}'s
  * {@link #set(AbstractField)} API:
  * 
  * <pre>
- *  DocValuesField field = new DocValuesField(name);
+ *  IndexDocValuesField field = new IndexDocValuesField(name);
  *  Field indexedField = new Field(name, stringValue, Stored.NO, Indexed.ANALYZED);
  *  Document document = new Document();
  *  document.add(indexedField);
@@ -73,7 +73,7 @@ import org.apache.lucene.util.BytesRef;
  * </pre>
  * 
  * */
-public class DocValuesField extends AbstractField implements PerDocFieldValues {
+public class IndexDocValuesField extends AbstractField implements PerDocFieldValues {
 
   protected BytesRef bytes;
   protected double doubleValue;
@@ -82,17 +82,17 @@ public class DocValuesField extends Abst
   protected Comparator<BytesRef> bytesComparator;
 
   /**
-   * Creates a new {@link DocValuesField} with the given name.
+   * Creates a new {@link IndexDocValuesField} with the given name.
    */
-  public DocValuesField(String name) {
+  public IndexDocValuesField(String name) {
     super(name, Store.NO, Index.NO, TermVector.NO);
     setDocValues(this);
   }
 
   /**
-   * Creates a {@link DocValuesField} prototype
+   * Creates a {@link IndexDocValuesField} prototype
    */
-  DocValuesField() {
+  IndexDocValuesField() {
     this("");
   }
 
@@ -238,7 +238,7 @@ public class DocValuesField extends Abst
   }
 
   /**
-   * Sets this {@link DocValuesField} to the given {@link AbstractField} and
+   * Sets this {@link IndexDocValuesField} to the given {@link AbstractField} and
    * returns the given field. Any modifications to this instance will be visible
    * to the given field.
    */
@@ -253,9 +253,9 @@ public class DocValuesField extends Abst
    * 
    */
   public static <T extends AbstractField> T set(T field, ValueType type) {
-    if (field instanceof DocValuesField)
+    if (field instanceof IndexDocValuesField)
       return field;
-    final DocValuesField valField = new DocValuesField();
+    final IndexDocValuesField valField = new IndexDocValuesField();
     switch (type) {
     case BYTES_FIXED_DEREF:
     case BYTES_FIXED_SORTED:

Modified: lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/CheckIndex.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/CheckIndex.java?rev=1131089&r1=1131088&r2=1131089&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/CheckIndex.java (original)
+++ lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/CheckIndex.java Fri Jun  3 16:14:18 2011
@@ -29,7 +29,7 @@ import org.apache.lucene.index.codecs.Co
 import org.apache.lucene.index.codecs.DefaultSegmentInfosWriter;
 import org.apache.lucene.index.codecs.PerDocValues;
 import org.apache.lucene.index.values.IndexDocValues;
-import org.apache.lucene.index.values.DocValuesEnum;
+import org.apache.lucene.index.values.ValuesEnum;
 import org.apache.lucene.util.Bits;
 import org.apache.lucene.util.BytesRef;
 
@@ -956,8 +956,8 @@ public class CheckIndex {
           if (docValues == null) {
             continue;
           }
-          final DocValuesEnum values = docValues.getEnum();
-          while (values.nextDoc() != DocValuesEnum.NO_MORE_DOCS) {
+          final ValuesEnum values = docValues.getEnum();
+          while (values.nextDoc() != ValuesEnum.NO_MORE_DOCS) {
             switch (fieldInfo.docValues) {
             case BYTES_FIXED_DEREF:
             case BYTES_FIXED_SORTED:

Modified: lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/DirectoryReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/DirectoryReader.java?rev=1131089&r1=1131088&r2=1131089&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/DirectoryReader.java (original)
+++ lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/DirectoryReader.java Fri Jun  3 16:14:18 2011
@@ -1026,6 +1026,6 @@ class DirectoryReader extends IndexReade
 
   @Override
   public PerDocValues perDocValues() throws IOException {
-    throw new UnsupportedOperationException("please use MultiPerDoc#getPerDocs, or wrap your IndexReader with SlowMultiReaderWrapper, if you really need a top level Fields");
+    throw new UnsupportedOperationException("please use MultiPerDocValues#getPerDocs, or wrap your IndexReader with SlowMultiReaderWrapper, if you really need a top level Fields");
   }
 }

Modified: lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/FieldsEnum.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/FieldsEnum.java?rev=1131089&r1=1131088&r2=1131089&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/FieldsEnum.java (original)
+++ lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/FieldsEnum.java Fri Jun  3 16:14:18 2011
@@ -20,7 +20,7 @@ package org.apache.lucene.index;
 import java.io.IOException;
 
 import org.apache.lucene.index.values.IndexDocValues;
-import org.apache.lucene.index.values.DocValuesEnum;
+import org.apache.lucene.index.values.ValuesEnum;
 import org.apache.lucene.util.AttributeSource;
 
 /** Enumerates indexed fields.  You must first call {@link

Modified: lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/MultiFields.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/MultiFields.java?rev=1131089&r1=1131088&r2=1131089&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/MultiFields.java (original)
+++ lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/MultiFields.java Fri Jun  3 16:14:18 2011
@@ -23,9 +23,9 @@ import java.util.List;
 import java.util.ArrayList;
 
 import org.apache.lucene.index.values.IndexDocValues;
-import org.apache.lucene.index.values.MultiDocValues;
+import org.apache.lucene.index.values.MultiIndexDocValues;
 import org.apache.lucene.index.values.ValueType;
-import org.apache.lucene.index.values.MultiDocValues.DocValuesIndex;
+import org.apache.lucene.index.values.MultiIndexDocValues.DocValuesIndex;
 import java.util.concurrent.ConcurrentHashMap;
 import org.apache.lucene.util.ReaderUtil;
 import org.apache.lucene.util.ReaderUtil.Gather;  // for javadocs

Modified: lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/MultiFieldsEnum.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/MultiFieldsEnum.java?rev=1131089&r1=1131088&r2=1131089&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/MultiFieldsEnum.java (original)
+++ lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/MultiFieldsEnum.java Fri Jun  3 16:14:18 2011
@@ -17,7 +17,7 @@ package org.apache.lucene.index;
  * limitations under the License.
  */
 
-import org.apache.lucene.index.values.MultiDocValues;
+import org.apache.lucene.index.values.MultiIndexDocValues;
 import org.apache.lucene.util.PriorityQueue;
 import org.apache.lucene.util.ReaderUtil;
 
@@ -45,7 +45,7 @@ public final  class MultiFieldsEnum exte
 
   // Re-used TermsEnum
   private final MultiTermsEnum terms;
-  private final MultiDocValues docValues;
+  private final MultiIndexDocValues docValues;
 
 
   private String currentField;
@@ -55,7 +55,7 @@ public final  class MultiFieldsEnum exte
   public MultiFieldsEnum(FieldsEnum[] subs, ReaderUtil.Slice[] subSlices) throws IOException {
     terms = new MultiTermsEnum(subSlices);
     queue = new FieldMergeQueue(subs.length);
-    docValues = new MultiDocValues();
+    docValues = new MultiIndexDocValues();
     top = new FieldsEnumWithSlice[subs.length];
     List<FieldsEnumWithSlice> enumWithSlices = new ArrayList<FieldsEnumWithSlice>();
 

Modified: lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/MultiPerDocValues.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/MultiPerDocValues.java?rev=1131089&r1=1131088&r2=1131089&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/MultiPerDocValues.java (original)
+++ lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/MultiPerDocValues.java Fri Jun  3 16:14:18 2011
@@ -25,9 +25,9 @@ import java.util.concurrent.ConcurrentHa
 
 import org.apache.lucene.index.codecs.PerDocValues;
 import org.apache.lucene.index.values.IndexDocValues;
-import org.apache.lucene.index.values.MultiDocValues;
+import org.apache.lucene.index.values.MultiIndexDocValues;
 import org.apache.lucene.index.values.ValueType;
-import org.apache.lucene.index.values.MultiDocValues.DocValuesIndex;
+import org.apache.lucene.index.values.MultiIndexDocValues.DocValuesIndex;
 import org.apache.lucene.util.ReaderUtil;
 import org.apache.lucene.util.ReaderUtil.Gather;
 
@@ -115,7 +115,7 @@ public class MultiPerDocValues extends P
     if (result == null) {
       // Lazy init: first time this field is requested, we
       // create & add to docValues:
-      final List<MultiDocValues.DocValuesIndex> docValuesIndex = new ArrayList<MultiDocValues.DocValuesIndex>();
+      final List<MultiIndexDocValues.DocValuesIndex> docValuesIndex = new ArrayList<MultiIndexDocValues.DocValuesIndex>();
       int docsUpto = 0;
       ValueType type = null;
       // Gather all sub-readers that share this field
@@ -126,24 +126,24 @@ public class MultiPerDocValues extends P
         if (values != null) {
           if (docsUpto != start) {
             type = values.type();
-            docValuesIndex.add(new MultiDocValues.DocValuesIndex(
-                new MultiDocValues.DummyDocValues(start, type), docsUpto, start
+            docValuesIndex.add(new MultiIndexDocValues.DocValuesIndex(
+                new MultiIndexDocValues.DummyDocValues(start, type), docsUpto, start
                     - docsUpto));
           }
-          docValuesIndex.add(new MultiDocValues.DocValuesIndex(values, start,
+          docValuesIndex.add(new MultiIndexDocValues.DocValuesIndex(values, start,
               length));
           docsUpto = start + length;
 
         } else if (i + 1 == subs.length && !docValuesIndex.isEmpty()) {
-          docValuesIndex.add(new MultiDocValues.DocValuesIndex(
-              new MultiDocValues.DummyDocValues(start, type), docsUpto, start
+          docValuesIndex.add(new MultiIndexDocValues.DocValuesIndex(
+              new MultiIndexDocValues.DummyDocValues(start, type), docsUpto, start
                   - docsUpto));
         }
       }
       if (docValuesIndex.isEmpty()) {
         return null;
       }
-      result = new MultiDocValues(
+      result = new MultiIndexDocValues(
           docValuesIndex.toArray(DocValuesIndex.EMPTY_ARRAY));
       docValues.put(field, result);
     }

Modified: lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/MultiReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/MultiReader.java?rev=1131089&r1=1131088&r2=1131089&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/MultiReader.java (original)
+++ lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/MultiReader.java Fri Jun  3 16:14:18 2011
@@ -407,6 +407,6 @@ public class MultiReader extends IndexRe
 
   @Override
   public PerDocValues perDocValues() throws IOException {
-    throw new UnsupportedOperationException("please use MultiPerDoc#getPerDocs, or wrap your IndexReader with SlowMultiReaderWrapper, if you really need a top level Fields");
+    throw new UnsupportedOperationException("please use MultiPerDocValues#getPerDocs, or wrap your IndexReader with SlowMultiReaderWrapper, if you really need a top level Fields");
   }
 }

Modified: lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/Bytes.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/Bytes.java?rev=1131089&r1=1131088&r2=1131089&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/Bytes.java (original)
+++ lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/Bytes.java Fri Jun  3 16:14:18 2011
@@ -223,7 +223,7 @@ public final class Bytes {
     protected abstract int maxDoc();
 
     @Override
-    public DocValuesEnum getEnum(AttributeSource attrSource) throws IOException {
+    public ValuesEnum getEnum(AttributeSource attrSource) throws IOException {
       return new SourceEnum(attrSource, type(), this, maxDoc()) {
         @Override
         public int advance(int target) throws IOException {
@@ -315,7 +315,7 @@ public final class Bytes {
     }
 
     @Override
-    public DocValuesEnum getEnum(AttributeSource attrSource) throws IOException {
+    public ValuesEnum getEnum(AttributeSource attrSource) throws IOException {
       return new SourceEnum(attrSource, type(), this, maxDoc()) {
 
         @Override
@@ -400,7 +400,7 @@ public final class Bytes {
     }
 
     @Override
-    protected void setNextEnum(DocValuesEnum valuesEnum) {
+    protected void setNextEnum(ValuesEnum valuesEnum) {
       bytesRef = valuesEnum.bytes();
     }
 

Modified: lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/FixedDerefBytesImpl.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/FixedDerefBytesImpl.java?rev=1131089&r1=1131088&r2=1131089&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/FixedDerefBytesImpl.java (original)
+++ lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/FixedDerefBytesImpl.java Fri Jun  3 16:14:18 2011
@@ -184,11 +184,11 @@ class FixedDerefBytesImpl {
     }
 
     @Override
-    public DocValuesEnum getEnum(AttributeSource source) throws IOException {
+    public ValuesEnum getEnum(AttributeSource source) throws IOException {
       return new DerefBytesEnum(source, cloneData(), cloneIndex(), size);
     }
 
-    static class DerefBytesEnum extends DocValuesEnum {
+    static class DerefBytesEnum extends ValuesEnum {
       protected final IndexInput datIn;
       private final PackedInts.ReaderIterator idx;
       protected final long fp;
@@ -215,7 +215,7 @@ class FixedDerefBytesImpl {
         valueCount = idx.size();
       }
 
-      protected void copyFrom(DocValuesEnum valuesEnum) {
+      protected void copyFrom(ValuesEnum valuesEnum) {
         bytesRef = valuesEnum.bytesRef;
         if (bytesRef.bytes.length < size) {
           bytesRef.grow(size);

Modified: lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/FixedSortedBytesImpl.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/FixedSortedBytesImpl.java?rev=1131089&r1=1131088&r2=1131089&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/FixedSortedBytesImpl.java (original)
+++ lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/FixedSortedBytesImpl.java Fri Jun  3 16:14:18 2011
@@ -229,7 +229,7 @@ class FixedSortedBytesImpl {
     }
 
     @Override
-    public DocValuesEnum getEnum(AttributeSource source) throws IOException {
+    public ValuesEnum getEnum(AttributeSource source) throws IOException {
       // do unsorted
       return new DerefBytesEnum(source, cloneData(), cloneIndex(), size);
     }

Modified: lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/FixedStraightBytesImpl.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/FixedStraightBytesImpl.java?rev=1131089&r1=1131088&r2=1131089&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/FixedStraightBytesImpl.java (original)
+++ lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/FixedStraightBytesImpl.java Fri Jun  3 16:14:18 2011
@@ -180,11 +180,11 @@ class FixedStraightBytesImpl {
     }
 
     @Override
-    public DocValuesEnum getEnum(AttributeSource source) throws IOException {
+    public ValuesEnum getEnum(AttributeSource source) throws IOException {
       return new FixedStraightBytesEnum(source, cloneData(), size, maxDoc);
     }
 
-    private static final class FixedStraightBytesEnum extends DocValuesEnum {
+    private static final class FixedStraightBytesEnum extends ValuesEnum {
       private final IndexInput datIn;
       private final int size;
       private final int maxDoc;
@@ -203,7 +203,7 @@ class FixedStraightBytesImpl {
         fp = datIn.getFilePointer();
       }
 
-      protected void copyFrom(DocValuesEnum valuesEnum) {
+      protected void copyFrom(ValuesEnum valuesEnum) {
         bytesRef = valuesEnum.bytesRef;
         if (bytesRef.bytes.length < size) {
           bytesRef.grow(size);

Modified: lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/Floats.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/Floats.java?rev=1131089&r1=1131088&r2=1131089&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/Floats.java (original)
+++ lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/Floats.java Fri Jun  3 16:14:18 2011
@@ -111,7 +111,7 @@ public class Floats {
     }
 
     @Override
-    protected void setNextEnum(DocValuesEnum valuesEnum) {
+    protected void setNextEnum(ValuesEnum valuesEnum) {
       floatsRef = valuesEnum.getFloat();
     }
 
@@ -305,7 +305,7 @@ public class Floats {
       }
 
       @Override
-      public DocValuesEnum getEnum(AttributeSource attrSource)
+      public ValuesEnum getEnum(AttributeSource attrSource)
           throws IOException {
         return new SourceEnum(attrSource, ValueType.FLOAT_32, this, maxDoc) {
           @Override
@@ -337,7 +337,7 @@ public class Floats {
       }
 
       @Override
-      public DocValuesEnum getEnum(AttributeSource attrSource)
+      public ValuesEnum getEnum(AttributeSource attrSource)
           throws IOException {
         return new SourceEnum(attrSource, type(), this, maxDoc) {
           @Override
@@ -363,7 +363,7 @@ public class Floats {
     }
 
     @Override
-    public DocValuesEnum getEnum(AttributeSource source) throws IOException {
+    public ValuesEnum getEnum(AttributeSource source) throws IOException {
       IndexInput indexInput = (IndexInput) datIn.clone();
       indexInput.seek(CodecUtil.headerLength(CODEC_NAME));
       // skip precision:
@@ -443,7 +443,7 @@ public class Floats {
     }
   }
 
-  static abstract class FloatsEnumImpl extends DocValuesEnum {
+  static abstract class FloatsEnumImpl extends ValuesEnum {
     protected final IndexInput dataIn;
     protected int pos = -1;
     protected final int precision;

Modified: lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/IndexDocValues.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/IndexDocValues.java?rev=1131089&r1=1131088&r2=1131089&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/IndexDocValues.java (original)
+++ lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/IndexDocValues.java Fri Jun  3 16:14:18 2011
@@ -20,15 +20,35 @@ import java.io.Closeable;
 import java.io.IOException;
 import java.util.Comparator;
 
+import org.apache.lucene.document.IndexDocValuesField;
 import org.apache.lucene.index.Fields;
 import org.apache.lucene.index.FieldsEnum;
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.codecs.Codec;
+import org.apache.lucene.index.codecs.CodecProvider;
 import org.apache.lucene.util.AttributeSource;
 import org.apache.lucene.util.BytesRef;
 
 /**
- * nocommit - javadoc 
+ * {@link IndexDocValues} provides a dense per-document typed storage for fast
+ * value access based on the lucene internal document id. {@link IndexDocValues}
+ * exposes two distinct APIs:
+ * <ul>
+ * <li>via {@link Source} an entirely RAM resident API for random access</li>
+ * <li>via {@link ValuesEnum} a disk resident API for sequential access</li>
+ * </ul> {@link IndexDocValues} are exposed via
+ * {@link IndexReader#perDocValues()} on a per-segment basis. For best
+ * performance {@link IndexDocValues} should be consumed per-segment just like
+ * IndexReader.
+ * <p>
+ * {@link IndexDocValues} are fully integrated into the {@link Codec} API.
+ * Custom implementations can be exposed on a per field basis via
+ * {@link CodecProvider}.
  * 
+ * @see ValueType for limitations and default implementation documentation
+ * @see IndexDocValuesField for adding values to the index
+ * @see Codec#docsConsumer(org.apache.lucene.index.PerDocWriteState) for
+ *      customization
  * @lucene.experimental
  */
 public abstract class IndexDocValues implements Closeable {
@@ -45,23 +65,23 @@ public abstract class IndexDocValues imp
 
   /**
    * Returns an iterator that steps through all documents values for this
-   * {@link IndexDocValues} field instance. {@link DocValuesEnum} will skip document
+   * {@link IndexDocValues} field instance. {@link ValuesEnum} will skip document
    * without a value if applicable.
    */
-  public DocValuesEnum getEnum() throws IOException {
+  public ValuesEnum getEnum() throws IOException {
     return getEnum(null);
   }
 
   /**
    * Returns an iterator that steps through all documents values for this
-   * {@link IndexDocValues} field instance. {@link DocValuesEnum} will skip document
+   * {@link IndexDocValues} field instance. {@link ValuesEnum} will skip document
    * without a value if applicable.
    * <p>
    * If an {@link AttributeSource} is supplied to this method the
-   * {@link DocValuesEnum} will use the given source to access implementation
+   * {@link ValuesEnum} will use the given source to access implementation
    * related attributes.
    */
-  public abstract DocValuesEnum getEnum(AttributeSource attrSource)
+  public abstract ValuesEnum getEnum(AttributeSource attrSource)
       throws IOException;
 
   /**
@@ -215,9 +235,9 @@ public abstract class IndexDocValues imp
     }
 
     /**
-     * Returns a {@link DocValuesEnum} for this source.
+     * Returns a {@link ValuesEnum} for this source.
      */
-    public DocValuesEnum getEnum() throws IOException {
+    public ValuesEnum getEnum() throws IOException {
       return getEnum(null);
     }
 
@@ -229,18 +249,18 @@ public abstract class IndexDocValues imp
     public abstract ValueType type();
 
     /**
-     * Returns a {@link DocValuesEnum} for this source which uses the given
+     * Returns a {@link ValuesEnum} for this source which uses the given
      * {@link AttributeSource}.
      */
-    public abstract DocValuesEnum getEnum(AttributeSource attrSource)
+    public abstract ValuesEnum getEnum(AttributeSource attrSource)
         throws IOException;
   }
 
   /**
-   * {@link DocValuesEnum} utility for {@link Source} implemenations.
+   * {@link ValuesEnum} utility for {@link Source} implemenations.
    * 
    */
-  public abstract static class SourceEnum extends DocValuesEnum {
+  public abstract static class SourceEnum extends ValuesEnum {
     protected final Source source;
     protected final int numDocs;
     protected int pos = -1;
@@ -284,7 +304,7 @@ public abstract class IndexDocValues imp
   /**
    * A sorted variant of {@link Source} for <tt>byte[]</tt> values per document.
    * <p>
-   * Note: {@link DocValuesEnum} obtained from a {@link SortedSource} will
+   * Note: {@link ValuesEnum} obtained from a {@link SortedSource} will
    * enumerate values in document order and not in sorted order.
    */
   public static abstract class SortedSource extends Source {

Modified: lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/Ints.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/Ints.java?rev=1131089&r1=1131088&r2=1131089&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/Ints.java (original)
+++ lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/Ints.java Fri Jun  3 16:14:18 2011
@@ -20,8 +20,8 @@ package org.apache.lucene.index.values;
 import java.io.IOException;
 import java.util.concurrent.atomic.AtomicLong;
 
-import org.apache.lucene.index.values.PackedIntsImpl.IntsReader;
-import org.apache.lucene.index.values.PackedIntsImpl.IntsWriter;
+import org.apache.lucene.index.values.IntsImpl.IntsReader;
+import org.apache.lucene.index.values.IntsImpl.IntsWriter;
 import org.apache.lucene.store.Directory;
 
 /**

Copied: lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/IntsImpl.java (from r1131061, lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/PackedIntsImpl.java)
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/IntsImpl.java?p2=lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/IntsImpl.java&p1=lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/PackedIntsImpl.java&r1=1131061&r2=1131089&rev=1131089&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/PackedIntsImpl.java (original)
+++ lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/IntsImpl.java Fri Jun  3 16:14:18 2011
@@ -37,7 +37,7 @@ import org.apache.lucene.util.packed.Pac
  * 
  * @lucene.experimental
  * */
-class PackedIntsImpl {
+class IntsImpl {
 
   private static final String CODEC_NAME = "Ints";
   private static final byte PACKED = 0x00;
@@ -163,7 +163,7 @@ class PackedIntsImpl {
     }
 
     @Override
-    protected void setNextEnum(DocValuesEnum valuesEnum) {
+    protected void setNextEnum(ValuesEnum valuesEnum) {
       intsRef = valuesEnum.getInt();
     }
 
@@ -244,7 +244,7 @@ class PackedIntsImpl {
       }
 
       @Override
-      public DocValuesEnum getEnum(AttributeSource attrSource)
+      public ValuesEnum getEnum(AttributeSource attrSource)
           throws IOException {
         return new SourceEnum(attrSource, type(), this, values.length) {
           
@@ -283,7 +283,7 @@ class PackedIntsImpl {
       }
 
       @Override
-      public DocValuesEnum getEnum(AttributeSource attrSource)
+      public ValuesEnum getEnum(AttributeSource attrSource)
           throws IOException {
         return new SourceEnum(attrSource, type(), this, values.size()) {
           @Override
@@ -309,11 +309,11 @@ class PackedIntsImpl {
     }
 
     @Override
-    public DocValuesEnum getEnum(AttributeSource source) throws IOException {
+    public ValuesEnum getEnum(AttributeSource source) throws IOException {
       final IndexInput input = (IndexInput) datIn.clone();
       boolean success = false;
       try {
-        DocValuesEnum inst = packed ? new PackedIntsEnumImpl(source, input)
+        ValuesEnum inst = packed ? new PackedIntsEnumImpl(source, input)
             : new FixedIntsEnumImpl(source, input);
         success = true;
         return inst;
@@ -331,7 +331,7 @@ class PackedIntsImpl {
 
   }
 
-  private static final class PackedIntsEnumImpl extends DocValuesEnum {
+  private static final class PackedIntsEnumImpl extends ValuesEnum {
     private final PackedInts.ReaderIterator ints;
     private long minValue;
     private final IndexInput dataIn;
@@ -381,7 +381,7 @@ class PackedIntsImpl {
     }
   }
   
-  private static final class FixedIntsEnumImpl extends DocValuesEnum {
+  private static final class FixedIntsEnumImpl extends ValuesEnum {
     private final IndexInput dataIn;
     private final int maxDoc;
     private int pos = -1;

Copied: lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/MultiIndexDocValues.java (from r1131061, lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/MultiDocValues.java)
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/MultiIndexDocValues.java?p2=lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/MultiIndexDocValues.java&p1=lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/MultiDocValues.java&r1=1131061&r2=1131089&rev=1131089&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/MultiDocValues.java (original)
+++ lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/MultiIndexDocValues.java Fri Jun  3 16:14:18 2011
@@ -24,9 +24,12 @@ import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.ReaderUtil;
 
 /**
+ * A wrapper for compound IndexReader providing access to per segment
+ * {@link IndexDocValues}
+ * 
  * @lucene.experimental
  */
-public class MultiDocValues extends IndexDocValues {
+public class MultiIndexDocValues extends IndexDocValues {
 
   public static class DocValuesIndex {
     public final static DocValuesIndex[] EMPTY_ARRAY = new DocValuesIndex[0];
@@ -44,17 +47,17 @@ public class MultiDocValues extends Inde
   private DocValuesIndex[] docValuesIdx;
   private int[] starts;
 
-  public MultiDocValues() {
+  public MultiIndexDocValues() {
     starts = new int[0];
     docValuesIdx = new DocValuesIndex[0];
   }
 
-  public MultiDocValues(DocValuesIndex[] docValuesIdx) {
+  public MultiIndexDocValues(DocValuesIndex[] docValuesIdx) {
     reset(docValuesIdx);
   }
 
   @Override
-  public DocValuesEnum getEnum(AttributeSource source) throws IOException {
+  public ValuesEnum getEnum(AttributeSource source) throws IOException {
     return new MultiValuesEnum(docValuesIdx, starts);
   }
 
@@ -87,7 +90,7 @@ public class MultiDocValues extends Inde
     }
 
     @Override
-    public DocValuesEnum getEnum(AttributeSource attrSource) throws IOException {
+    public ValuesEnum getEnum(AttributeSource attrSource) throws IOException {
       return emptySoruce.getEnum(attrSource);
     }
 
@@ -107,13 +110,13 @@ public class MultiDocValues extends Inde
 
   }
 
-  private static class MultiValuesEnum extends DocValuesEnum {
+  private static class MultiValuesEnum extends ValuesEnum {
     private DocValuesIndex[] docValuesIdx;
     private final int maxDoc;
     private int currentStart;
     private int currentMax;
     private int currentDoc = -1;
-    private DocValuesEnum currentEnum;
+    private ValuesEnum currentEnum;
     private final int[] starts;
 
     public MultiValuesEnum(DocValuesIndex[] docValuesIdx, int[] starts)
@@ -222,7 +225,7 @@ public class MultiDocValues extends Inde
     }
 
     @Override
-    public DocValuesEnum getEnum(AttributeSource attrSource) throws IOException {
+    public ValuesEnum getEnum(AttributeSource attrSource) throws IOException {
       throw new UnsupportedOperationException(); // TODO
     }
 
@@ -258,8 +261,8 @@ public class MultiDocValues extends Inde
     }
 
     @Override
-    public DocValuesEnum getEnum(AttributeSource attrSource) throws IOException {
-      return DocValuesEnum.emptyEnum(type);
+    public ValuesEnum getEnum(AttributeSource attrSource) throws IOException {
+      return ValuesEnum.emptyEnum(type);
     }
 
     @Override

Modified: lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/PerDocFieldValues.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/PerDocFieldValues.java?rev=1131089&r1=1131088&r2=1131089&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/PerDocFieldValues.java (original)
+++ lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/PerDocFieldValues.java Fri Jun  3 16:14:18 2011
@@ -18,14 +18,14 @@ package org.apache.lucene.index.values;
  */
 import java.util.Comparator;
 
-import org.apache.lucene.document.DocValuesField;
+import org.apache.lucene.document.IndexDocValuesField;
 import org.apache.lucene.document.Fieldable;
 import org.apache.lucene.index.codecs.DocValuesConsumer;
 import org.apache.lucene.util.BytesRef;
 
 /**
  * Per document and field values consumed by {@link DocValuesConsumer}. 
- * @see DocValuesField
+ * @see IndexDocValuesField
  * @see Fieldable#setDocValues(PerDocFieldValues)
  * 
  * @lucene.experimental

Modified: lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/ValueType.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/ValueType.java?rev=1131089&r1=1131088&r2=1131089&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/ValueType.java (original)
+++ lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/ValueType.java Fri Jun  3 16:14:18 2011
@@ -20,12 +20,14 @@ package org.apache.lucene.index.values;
 import org.apache.lucene.index.codecs.Codec;
 import org.apache.lucene.index.codecs.PerDocConsumer;
 import org.apache.lucene.index.values.IndexDocValues.SortedSource;
+import org.apache.lucene.util.BytesRef;
+import org.apache.lucene.util.packed.PackedInts;
 
 /**
- * {@link ValueType} specifies the type of the {@link IndexDocValues} for a certain field.
- * A {@link ValueType} only defines the data type for a field while the actual
- * Implementation used to encode and decode the values depends on the field's
- * {@link Codec}. It is up to the {@link Codec} implementing
+ * {@link ValueType} specifies the type of the {@link IndexDocValues} for a
+ * certain field. A {@link ValueType} only defines the data type for a field
+ * while the actual Implementation used to encode and decode the values depends
+ * on the field's {@link Codec}. It is up to the {@link Codec} implementing
  * {@link PerDocConsumer#addValuesField(org.apache.lucene.index.FieldInfo)} and
  * using a different low-level implementations to write the stored values for a
  * field.
@@ -37,50 +39,141 @@ public enum ValueType {
    * TODO: Add INT_32 INT_64 INT_16 & INT_8?!
    */
   /**
-   * Integer values.
+   * Defines an 64 bit integer value. By default this type uses a simple
+   * compression technique based on {@link PackedInts}. Internally only the used
+   * value range is encoded if it fits into 2<sup>63</sup>-1. If that range is
+   * exceeded the default implementation falls back to fixed size 64bit
+   * integers.
+   * <p>
+   * NOTE: this type uses <tt>0</tt> as the default value without any
+   * distinction between provided <tt>0</tt> values during indexing. All
+   * documents without an explicit value will use <tt>0</tt> instead. In turn,
+   * {@link ValuesEnum} instances will not skip documents without an explicit
+   * value assigned. Custom default values must be assigned explicitly.
+   * </p>
    */
   INTS,
-   
+
   /**
-   * 32 bit floating point values.
+   * Defines a 32 bit floating point values. By default there is no compression
+   * applied. To fit custom float values into less than 32bit either a custom
+   * implementation is needed or values must be encoded into a
+   * {@link #BYTES_FIXED_STRAIGHT} type.
+   * <p>
+   * NOTE: this type uses <tt>0.0f</tt> as the default value without any
+   * distinction between provided <tt>0.0f</tt> values during indexing. All
+   * documents without an explicit value will use <tt>0.0f</tt> instead. In
+   * turn, {@link ValuesEnum} instances will not skip documents without an
+   * explicit value assigned. Custom default values must be assigned explicitly.
+   * </p>
    */
   FLOAT_32,
   /**
-   * 64 bit floating point values.
+   * Defines a 64 bit floating point values. By default there is no compression
+   * applied. To fit custom float values into less than 64bit either a custom
+   * implementation is needed or values must be encoded into a
+   * {@link #BYTES_FIXED_STRAIGHT} type.
+   * <p>
+   * NOTE: this type uses <tt>0.0d</tt> as the default value without any
+   * distinction between provided <tt>0.0d</tt> values during indexing. All
+   * documents without an explicit value will use <tt>0.0d</tt> instead. In
+   * turn, {@link ValuesEnum} instances will not skip documents without an
+   * explicit value assigned. Custom default values must be assigned explicitly.
+   * </p>
    */
   FLOAT_64,
 
   // TODO(simonw): -- shouldn't lucene decide/detect straight vs
   // deref, as well fixed vs var?
   /**
-   * Fixed length straight stored byte variant
+   * Defines a fixed length straight stored byte variant. All values added to
+   * such a field must be of the same length. All bytes are stored sequentially
+   * for fast offset access.
+   * <p>
+   * NOTE: this type uses <tt>0-bytes</tt> based on the length of the first seen
+   * values as the default value without any distinction between explicitly
+   * provided values during indexing. All documents without an explicit value
+   * will use the default instead. In turn, {@link ValuesEnum} instances will
+   * not skip documents without an explicit value assigned. Custom default
+   * values must be assigned explicitly.
+   * </p>
    */
   BYTES_FIXED_STRAIGHT,
 
   /**
-   * Fixed length dereferenced (indexed) byte variant
+   * Defines a fixed length dereferenced (indexed) byte variant. Fields with
+   * this type only store distinct byte values and store an additional offset
+   * pointer per document to dereference the payload.
+   * <p>
+   * NOTE: Fields of this type will not store values for documents without and
+   * explicitly provided value. If a documents value is accessed while no
+   * explicit value is stored the returned {@link BytesRef} will be a 0-length
+   * reference. In turn, {@link ValuesEnum} instances will skip over documents
+   * without an explicit value assigned. Custom default values must be assigned
+   * explicitly.
+   * </p>
    */
   BYTES_FIXED_DEREF,
 
   /**
-   * Fixed length pre-sorted byte variant
+   * Defines a fixed length pre-sorted byte variant. Fields with this type only
+   * store distinct byte values and store an additional offset pointer per
+   * document to dereference the payload. The stored byte payload is presorted
+   * and allows access via document id, ordinal and by-value.
+   * <p>
+   * NOTE: Fields of this type will not store values for documents without and
+   * explicitly provided value. If a documents value is accessed while no
+   * explicit value is stored the returned {@link BytesRef} will be a 0-length
+   * reference. In turn, {@link ValuesEnum} instances will skip over documents
+   * without an explicit value assigned. Custom default values must be assigned
+   * explicitly.
+   * </p>
    * 
    * @see SortedSource
    */
   BYTES_FIXED_SORTED,
 
   /**
-   * Variable length straight stored byte variant
+   * Defines a variable length straight stored byte variant. All bytes are
+   * stored sequentially for compactness. Usage of this type via the
+   * disk-resident API might yield performance degradation since no additional
+   * index is used to advance by more than one documents value at a time.
+   * <p>
+   * NOTE: Fields of this type will not store values for documents without and
+   * explicitly provided value. If a documents value is accessed while no
+   * explicit value is stored the returned {@link BytesRef} will be a 0-length
+   * reference. Yet, in contrast to dereferences variants {@link ValuesEnum}
+   * instances will <b>not</b> skip over documents without an explicit value
+   * assigned. Custom default values must be assigned explicitly.
+   * </p>
    */
   BYTES_VAR_STRAIGHT,
 
   /**
-   * Variable length dereferenced (indexed) byte variant
+   * Defines a variable length dereferenced (indexed) byte variant. Just as
+   * {@link #BYTES_FIXED_DEREF} yet supporting variable length values.
+   * <p>
+   * NOTE: Fields of this type will not store values for documents without and
+   * explicitly provided value. If a documents value is accessed while no
+   * explicit value is stored the returned {@link BytesRef} will be a 0-length
+   * reference. In turn, {@link ValuesEnum} instances will skip over documents
+   * without an explicit value assigned. Custom default values must be assigned
+   * explicitly.
+   * </p>
    */
   BYTES_VAR_DEREF,
 
   /**
-   * Variable length pre-sorted byte variant
+   * Defines a variable length pre-sorted byte variant. Just as
+   * {@link #BYTES_FIXED_SORTED} yet supporting variable length values.
+   * <p>
+   * NOTE: Fields of this type will not store values for documents without and
+   * explicitly provided value. If a documents value is accessed while no
+   * explicit value is stored the returned {@link BytesRef} will be a 0-length
+   * reference. In turn, {@link ValuesEnum} instances will skip over documents
+   * without an explicit value assigned. Custom default values must be assigned
+   * explicitly.
+   * </p>
    * 
    * @see SortedSource
    */

Copied: lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/ValuesEnum.java (from r1129588, lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/DocValuesEnum.java)
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/ValuesEnum.java?p2=lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/ValuesEnum.java&p1=lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/DocValuesEnum.java&r1=1129588&r2=1131089&rev=1131089&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/DocValuesEnum.java (original)
+++ lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/ValuesEnum.java Fri Jun  3 16:14:18 2011
@@ -25,7 +25,7 @@ import org.apache.lucene.util.FloatsRef;
 import org.apache.lucene.util.LongsRef;
 
 /**
- * {@link DocValuesEnum} is a {@link DocIdSetIterator} iterating <tt>byte[]</tt>
+ * {@link ValuesEnum} is a {@link DocIdSetIterator} iterating <tt>byte[]</tt>
  * , <tt>long</tt> and <tt>double</tt> stored per document. Depending on the
  * enum's {@link ValueType} ({@link #type()}) the enum might skip over documents that
  * have no value stored. Types like {@link ValueType#BYTES_VAR_STRAIGHT} might not
@@ -41,7 +41,7 @@ import org.apache.lucene.util.LongsRef;
  * 
  * @lucene.experimental
  */
-public abstract class DocValuesEnum extends DocIdSetIterator {
+public abstract class ValuesEnum extends DocIdSetIterator {
   private AttributeSource source;
   private final ValueType enumType;
   protected BytesRef bytesRef;
@@ -49,17 +49,17 @@ public abstract class DocValuesEnum exte
   protected LongsRef intsRef;
 
   /**
-   * Creates a new {@link DocValuesEnum} for the given type. The
+   * Creates a new {@link ValuesEnum} for the given type. The
    * {@link AttributeSource} for this enum is set to <code>null</code>
    */
-  protected DocValuesEnum(ValueType enumType) {
+  protected ValuesEnum(ValueType enumType) {
     this(null, enumType);
   }
 
   /**
-   * Creates a new {@link DocValuesEnum} for the given type.
+   * Creates a new {@link ValuesEnum} for the given type.
    */
-  protected DocValuesEnum(AttributeSource source, ValueType enumType) {
+  protected ValuesEnum(AttributeSource source, ValueType enumType) {
     this.source = source;
     this.enumType = enumType;
     switch (enumType) {
@@ -115,7 +115,7 @@ public abstract class DocValuesEnum exte
   /**
    * Copies the internal state from the given enum
    */
-  protected void copyFrom(DocValuesEnum valuesEnum) {
+  protected void copyFrom(ValuesEnum valuesEnum) {
     intsRef = valuesEnum.intsRef;
     floatsRef = valuesEnum.floatsRef;
     bytesRef = valuesEnum.bytesRef;
@@ -144,10 +144,10 @@ public abstract class DocValuesEnum exte
   public abstract void close() throws IOException;
 
   /**
-   * Returns an empty {@link DocValuesEnum} for the given {@link ValueType}.
+   * Returns an empty {@link ValuesEnum} for the given {@link ValueType}.
    */
-  public static DocValuesEnum emptyEnum(ValueType type) {
-    return new DocValuesEnum(type) {
+  public static ValuesEnum emptyEnum(ValueType type) {
+    return new ValuesEnum(type) {
       @Override
       public int nextDoc() throws IOException {
         return NO_MORE_DOCS;

Modified: lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/VarDerefBytesImpl.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/VarDerefBytesImpl.java?rev=1131089&r1=1131088&r2=1131089&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/VarDerefBytesImpl.java (original)
+++ lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/VarDerefBytesImpl.java Fri Jun  3 16:14:18 2011
@@ -249,7 +249,7 @@ class VarDerefBytesImpl {
     }
 
     @Override
-    public DocValuesEnum getEnum(AttributeSource source) throws IOException {
+    public ValuesEnum getEnum(AttributeSource source) throws IOException {
       return new VarDerefBytesEnum(source, cloneData(), cloneIndex());
     }
 

Modified: lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/VarSortedBytesImpl.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/VarSortedBytesImpl.java?rev=1131089&r1=1131088&r2=1131089&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/VarSortedBytesImpl.java (original)
+++ lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/VarSortedBytesImpl.java Fri Jun  3 16:14:18 2011
@@ -230,11 +230,11 @@ class VarSortedBytesImpl {
     }
 
     @Override
-    public DocValuesEnum getEnum(AttributeSource source) throws IOException {
+    public ValuesEnum getEnum(AttributeSource source) throws IOException {
       return new VarSortedBytesEnum(source, cloneData(), cloneIndex());
     }
 
-    private static class VarSortedBytesEnum extends DocValuesEnum {
+    private static class VarSortedBytesEnum extends ValuesEnum {
       private PackedInts.Reader docToOrdIndex;
       private PackedInts.Reader ordToOffsetIndex;
       private IndexInput idxIn;

Modified: lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/VarStraightBytesImpl.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/VarStraightBytesImpl.java?rev=1131089&r1=1131088&r2=1131089&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/VarStraightBytesImpl.java (original)
+++ lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/VarStraightBytesImpl.java Fri Jun  3 16:14:18 2011
@@ -164,11 +164,11 @@ class VarStraightBytesImpl {
     }
 
     @Override
-    public DocValuesEnum getEnum(AttributeSource source) throws IOException {
+    public ValuesEnum getEnum(AttributeSource source) throws IOException {
       return new VarStraightBytesEnum(source, cloneData(), cloneIndex());
     }
 
-    private class VarStraightBytesEnum extends DocValuesEnum {
+    private class VarStraightBytesEnum extends ValuesEnum {
       private final PackedInts.Reader addresses;
       private final IndexInput datIn;
       private final IndexInput idxIn;

Modified: lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/Writer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/Writer.java?rev=1131089&r1=1131088&r2=1131089&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/Writer.java (original)
+++ lucene/dev/branches/docvalues/lucene/src/java/org/apache/lucene/index/values/Writer.java Fri Jun  3 16:14:18 2011
@@ -99,15 +99,15 @@ public abstract class Writer extends Doc
 
   /**
    * Records a value from the given document id. The methods implementation
-   * obtains the value for the document id from the last {@link DocValuesEnum}
-   * set to {@link #setNextEnum(DocValuesEnum)}.
+   * obtains the value for the document id from the last {@link ValuesEnum}
+   * set to {@link #setNextEnum(ValuesEnum)}.
    * <p>
    * This method is used during merging to provide implementation agnostic
    * default merge implementation.
    * </p>
    * <p>
    * The given document id must be the same document id returned from
-   * {@link DocValuesEnum#docID()} when this method is called. All documents IDs
+   * {@link ValuesEnum#docID()} when this method is called. All documents IDs
    * between the given ID and the previously given ID or <tt>0</tt> if the
    * method is call the first time are filled with default values depending on
    * the {@link Writer} implementation. The given document ID must always be
@@ -116,13 +116,13 @@ public abstract class Writer extends Doc
   protected abstract void add(int docID) throws IOException;
 
   /**
-   * Sets the next {@link DocValuesEnum} to consume values from on calls to
+   * Sets the next {@link ValuesEnum} to consume values from on calls to
    * {@link #add(int)}
    * 
    * @param valuesEnum
-   *          the next {@link DocValuesEnum}, this must not be null
+   *          the next {@link ValuesEnum}, this must not be null
    */
-  protected abstract void setNextEnum(DocValuesEnum valuesEnum);
+  protected abstract void setNextEnum(ValuesEnum valuesEnum);
 
   /**
    * Finish writing and close any files and resources used by this Writer.
@@ -140,7 +140,7 @@ public abstract class Writer extends Doc
     // simply override this and decide if they want to merge
     // segments using this generic implementation or if a bulk merge is possible
     // / feasible.
-    final DocValuesEnum valEnum = state.reader.getEnum();
+    final ValuesEnum valEnum = state.reader.getEnum();
     assert valEnum != null;
     try {
       setNextEnum(valEnum); // set the current enum we are working on - the
@@ -150,11 +150,11 @@ public abstract class Writer extends Doc
       final Bits bits = state.bits;
       final int docCount = state.docCount;
       int currentDocId;
-      if ((currentDocId = valEnum.advance(0)) != DocValuesEnum.NO_MORE_DOCS) {
+      if ((currentDocId = valEnum.advance(0)) != ValuesEnum.NO_MORE_DOCS) {
         for (int i = 0; i < docCount; i++) {
           if (bits == null || !bits.get(i)) {
             if (currentDocId < i) {
-              if ((currentDocId = valEnum.advance(i)) == DocValuesEnum.NO_MORE_DOCS) {
+              if ((currentDocId = valEnum.advance(i)) == ValuesEnum.NO_MORE_DOCS) {
                 break; // advance can jump over default values
               }
             }

Modified: lucene/dev/branches/docvalues/lucene/src/test-framework/org/apache/lucene/index/RandomIndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/lucene/src/test-framework/org/apache/lucene/index/RandomIndexWriter.java?rev=1131089&r1=1131088&r2=1131089&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/lucene/src/test-framework/org/apache/lucene/index/RandomIndexWriter.java (original)
+++ lucene/dev/branches/docvalues/lucene/src/test-framework/org/apache/lucene/index/RandomIndexWriter.java Fri Jun  3 16:14:18 2011
@@ -24,7 +24,7 @@ import java.util.Random;
 
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.MockAnalyzer;
-import org.apache.lucene.document.DocValuesField;
+import org.apache.lucene.document.IndexDocValuesField;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.index.IndexWriter; // javadoc
 import org.apache.lucene.index.codecs.CodecProvider;
@@ -173,7 +173,7 @@ public class RandomIndexWriter implement
     String name = "random_" + type.name() + "" + docValuesFieldPrefix;
     if ("PreFlex".equals(codecProvider.getFieldCodec(name)) || doc.getFieldable(name) != null)
         return;
-    DocValuesField docValuesField = new DocValuesField(name);
+    IndexDocValuesField docValuesField = new IndexDocValuesField(name);
     switch (type) {
     case BYTES_FIXED_DEREF:
     case BYTES_FIXED_SORTED:

Modified: lucene/dev/branches/docvalues/lucene/src/test/org/apache/lucene/index/values/TestDocValues.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/lucene/src/test/org/apache/lucene/index/values/TestDocValues.java?rev=1131089&r1=1131088&r2=1131089&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/lucene/src/test/org/apache/lucene/index/values/TestDocValues.java (original)
+++ lucene/dev/branches/docvalues/lucene/src/test/org/apache/lucene/index/values/TestDocValues.java Fri Jun  3 16:14:18 2011
@@ -83,7 +83,7 @@ public class TestDocValues extends Lucen
 
     IndexDocValues r = Bytes.getValues(dir, "test", mode, fixedSize, maxDoc);
     for (int iter = 0; iter < 2; iter++) {
-      DocValuesEnum bytesEnum = getEnum(r);
+      ValuesEnum bytesEnum = getEnum(r);
       assertNotNull("enum is null", bytesEnum);
       BytesRef ref = bytesEnum.bytes();
 
@@ -94,8 +94,8 @@ public class TestDocValues extends Lucen
         assertEquals("doc: " + idx + " lenLeft: " + values[idx].length()
             + " lenRight: " + utf8String.length(), values[idx], utf8String);
       }
-      assertEquals(DocValuesEnum.NO_MORE_DOCS, bytesEnum.advance(maxDoc));
-      assertEquals(DocValuesEnum.NO_MORE_DOCS, bytesEnum.advance(maxDoc + 1));
+      assertEquals(ValuesEnum.NO_MORE_DOCS, bytesEnum.advance(maxDoc));
+      assertEquals(ValuesEnum.NO_MORE_DOCS, bytesEnum.advance(maxDoc + 1));
 
       bytesEnum.close();
     }
@@ -209,7 +209,7 @@ public class TestDocValues extends Lucen
         }
 
         for (int iter = 0; iter < 2; iter++) {
-          DocValuesEnum iEnum = getEnum(r);
+          ValuesEnum iEnum = getEnum(r);
           LongsRef ints = iEnum.getInt();
           for (int i = 0; i < NUM_VALUES + additionalDocs; i++) {
             assertEquals(i, iEnum.nextDoc());
@@ -219,12 +219,12 @@ public class TestDocValues extends Lucen
               assertEquals(0, ints.get());
             }
           }
-          assertEquals(DocValuesEnum.NO_MORE_DOCS, iEnum.nextDoc());
+          assertEquals(ValuesEnum.NO_MORE_DOCS, iEnum.nextDoc());
           iEnum.close();
         }
 
         for (int iter = 0; iter < 2; iter++) {
-          DocValuesEnum iEnum = getEnum(r);
+          ValuesEnum iEnum = getEnum(r);
           LongsRef ints = iEnum.getInt();
           for (int i = 0; i < NUM_VALUES + additionalDocs; i += 1 + random.nextInt(25)) {
             assertEquals(i, iEnum.advance(i));
@@ -234,7 +234,7 @@ public class TestDocValues extends Lucen
               assertEquals(0, ints.get());
             }
           }
-          assertEquals(DocValuesEnum.NO_MORE_DOCS, iEnum.advance(NUM_VALUES + additionalDocs));
+          assertEquals(ValuesEnum.NO_MORE_DOCS, iEnum.advance(NUM_VALUES + additionalDocs));
           iEnum.close();
         }
         r.close();
@@ -272,7 +272,7 @@ public class TestDocValues extends Lucen
     }
 
     for (int iter = 0; iter < 2; iter++) {
-      DocValuesEnum fEnum = getEnum(r);
+      ValuesEnum fEnum = getEnum(r);
       FloatsRef floats = fEnum.getFloat();
       for (int i = 0; i < NUM_VALUES + additionalValues; i++) {
         assertEquals(i, fEnum.nextDoc());
@@ -282,11 +282,11 @@ public class TestDocValues extends Lucen
           assertEquals(0.0d, floats.get(), delta);
         }
       }
-      assertEquals(DocValuesEnum.NO_MORE_DOCS, fEnum.nextDoc());
+      assertEquals(ValuesEnum.NO_MORE_DOCS, fEnum.nextDoc());
       fEnum.close();
     }
     for (int iter = 0; iter < 2; iter++) {
-      DocValuesEnum fEnum = getEnum(r);
+      ValuesEnum fEnum = getEnum(r);
       FloatsRef floats = fEnum.getFloat();
       for (int i = 0; i < NUM_VALUES + additionalValues; i += 1 + random.nextInt(25)) {
         assertEquals(i, fEnum.advance(i));
@@ -296,7 +296,7 @@ public class TestDocValues extends Lucen
           assertEquals(0.0d, floats.get(), delta);
         }
       }
-      assertEquals(DocValuesEnum.NO_MORE_DOCS, fEnum.advance(NUM_VALUES + additionalValues));
+      assertEquals(ValuesEnum.NO_MORE_DOCS, fEnum.advance(NUM_VALUES + additionalValues));
       fEnum.close();
     }
 
@@ -308,7 +308,7 @@ public class TestDocValues extends Lucen
     runTestFloats(8, 0.0);
   }
   
-  private DocValuesEnum getEnum(IndexDocValues values) throws IOException {
+  private ValuesEnum getEnum(IndexDocValues values) throws IOException {
     return random.nextBoolean() ? values.getEnum() : getSource(values).getEnum();
   }
 

Modified: lucene/dev/branches/docvalues/lucene/src/test/org/apache/lucene/index/values/TestDocValuesIndexing.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/lucene/src/test/org/apache/lucene/index/values/TestDocValuesIndexing.java?rev=1131089&r1=1131088&r2=1131089&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/lucene/src/test/org/apache/lucene/index/values/TestDocValuesIndexing.java (original)
+++ lucene/dev/branches/docvalues/lucene/src/test/org/apache/lucene/index/values/TestDocValuesIndexing.java Fri Jun  3 16:14:18 2011
@@ -26,7 +26,7 @@ import java.util.List;
 
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.document.AbstractField;
-import org.apache.lucene.document.DocValuesField;
+import org.apache.lucene.document.IndexDocValuesField;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.document.Field.Index;
@@ -64,10 +64,6 @@ import org.junit.Before;
  */
 public class TestDocValuesIndexing extends LuceneTestCase {
   /*
-   * TODO: Roadmap to land on trunk
-   * 
-   * - Add documentation for: 
-   *  - DocValues 
    * - add test for unoptimized case with deletes
    * - add multithreaded tests / integrate into stress indexing?
    */
@@ -87,7 +83,7 @@ public class TestDocValuesIndexing exten
     IndexWriter writer = new IndexWriter(dir, writerConfig(false));
     for (int i = 0; i < 5; i++) {
       Document doc = new Document();
-      DocValuesField valuesField = new DocValuesField("docId");
+      IndexDocValuesField valuesField = new IndexDocValuesField("docId");
       valuesField.setInt(i);
       doc.add(valuesField);
       doc.add(new Field("docId", "" + i, Store.NO, Index.ANALYZED));
@@ -198,10 +194,10 @@ public class TestDocValuesIndexing exten
     // check values
     
     IndexReader merged = IndexReader.open(w, true);
-    DocValuesEnum vE_1 = getValuesEnum(getDocValues(r_1, first.name()));
-    DocValuesEnum vE_2 = getValuesEnum(getDocValues(r_2, second.name()));
-    DocValuesEnum vE_1_merged = getValuesEnum(getDocValues(merged, first.name()));
-    DocValuesEnum vE_2_merged = getValuesEnum(getDocValues(merged, second
+    ValuesEnum vE_1 = getValuesEnum(getDocValues(r_1, first.name()));
+    ValuesEnum vE_2 = getValuesEnum(getDocValues(r_2, second.name()));
+    ValuesEnum vE_1_merged = getValuesEnum(getDocValues(merged, first.name()));
+    ValuesEnum vE_2_merged = getValuesEnum(getDocValues(merged, second
         .name()));
     switch (second) { // these variants don't advance over missing values
     case BYTES_FIXED_STRAIGHT:
@@ -219,10 +215,10 @@ public class TestDocValuesIndexing exten
       assertEquals(msg, i, vE_2.nextDoc());
       assertEquals(msg, i + valuesPerIndex, vE_2_merged.nextDoc());
     }
-    assertEquals(msg, DocValuesEnum.NO_MORE_DOCS, vE_1.nextDoc());
-    assertEquals(msg, DocValuesEnum.NO_MORE_DOCS, vE_2.nextDoc());
-    assertEquals(msg, DocValuesEnum.NO_MORE_DOCS, vE_1_merged.advance(valuesPerIndex*2));
-    assertEquals(msg, DocValuesEnum.NO_MORE_DOCS, vE_2_merged.nextDoc());
+    assertEquals(msg, ValuesEnum.NO_MORE_DOCS, vE_1.nextDoc());
+    assertEquals(msg, ValuesEnum.NO_MORE_DOCS, vE_2.nextDoc());
+    assertEquals(msg, ValuesEnum.NO_MORE_DOCS, vE_1_merged.advance(valuesPerIndex*2));
+    assertEquals(msg, ValuesEnum.NO_MORE_DOCS, vE_2_merged.nextDoc());
 
     // close resources
     r_1.close();
@@ -274,7 +270,7 @@ public class TestDocValuesIndexing exten
           assertEquals("index " + i, 0, value);
         }
 
-        DocValuesEnum intsEnum = getValuesEnum(intsReader);
+        ValuesEnum intsEnum = getValuesEnum(intsReader);
         assertTrue(intsEnum.advance(base) >= base);
 
         intsEnum = getValuesEnum(intsReader);
@@ -303,7 +299,7 @@ public class TestDocValuesIndexing exten
           assertEquals(val + " failed for doc: " + i + " base: " + base,
               0.0d, value, 0.0d);
         }
-        DocValuesEnum floatEnum = getValuesEnum(floatReader);
+        ValuesEnum floatEnum = getValuesEnum(floatReader);
         assertTrue(floatEnum.advance(base) >= base);
 
         floatEnum = getValuesEnum(floatReader);
@@ -388,7 +384,7 @@ public class TestDocValuesIndexing exten
           assertNotNull("expected none null - " + msg, br);
           assertEquals(0, br.length);
           // make sure we advance at least until base
-          DocValuesEnum bytesEnum = getValuesEnum(bytesReader);
+          ValuesEnum bytesEnum = getValuesEnum(bytesReader);
           try {
           
           final int advancedTo = bytesEnum.advance(0);
@@ -403,7 +399,7 @@ public class TestDocValuesIndexing exten
         }
       }
 
-      DocValuesEnum bytesEnum = getValuesEnum(bytesReader);
+      ValuesEnum bytesEnum = getValuesEnum(bytesReader);
       final BytesRef enumRef = bytesEnum.bytes();
       // test the actual doc values added in this iteration
       assertEquals(base + numRemainingValues, r.numDocs());
@@ -480,9 +476,9 @@ public class TestDocValuesIndexing exten
     return source;
   }
 
-  private DocValuesEnum getValuesEnum(IndexDocValues values) throws IOException {
-    DocValuesEnum valuesEnum;
-    if (!(values instanceof MultiDocValues) && random.nextInt(10) == 0) {
+  private ValuesEnum getValuesEnum(IndexDocValues values) throws IOException {
+    ValuesEnum valuesEnum;
+    if (!(values instanceof MultiIndexDocValues) && random.nextInt(10) == 0) {
       // TODO not supported by MultiDocValues yet!
       valuesEnum = getSource(values).getEnum();
     } else {
@@ -511,11 +507,11 @@ public class TestDocValuesIndexing exten
     OpenBitSet deleted = new OpenBitSet(numValues);
     Document doc = new Document();
     Index idx = IDX_VALUES[random.nextInt(IDX_VALUES.length)];
-    AbstractField field = random.nextBoolean() ? new DocValuesField(value.name())
+    AbstractField field = random.nextBoolean() ? new IndexDocValuesField(value.name())
         : newField(value.name(), _TestUtil.randomRealisticUnicodeString(random,
             10), idx == Index.NO ? Store.YES : Store.NO, idx);
     doc.add(field);
-    DocValuesField valField = new DocValuesField("prototype");
+    IndexDocValuesField valField = new IndexDocValuesField("prototype");
     final BytesRef bytesRef = new BytesRef();
 
     final String idBase = value.name() + "_";

Modified: lucene/dev/branches/docvalues/lucene/src/test/org/apache/lucene/search/TestSort.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/lucene/src/test/org/apache/lucene/search/TestSort.java?rev=1131089&r1=1131088&r2=1131089&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/lucene/src/test/org/apache/lucene/search/TestSort.java (original)
+++ lucene/dev/branches/docvalues/lucene/src/test/org/apache/lucene/search/TestSort.java Fri Jun  3 16:14:18 2011
@@ -25,7 +25,7 @@ import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.lucene.analysis.MockAnalyzer;
-import org.apache.lucene.document.DocValuesField;
+import org.apache.lucene.document.IndexDocValuesField;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.index.CorruptIndexException;
@@ -124,13 +124,13 @@ public class TestSort extends LuceneTest
         doc.add (new Field ("contents", data[i][1], Field.Store.NO, Field.Index.ANALYZED));
         if (data[i][2] != null) {
           Field f = supportsDocValues ? 
-              DocValuesField.set(new Field ("int",      data[i][2], Field.Store.NO, Field.Index.NOT_ANALYZED), ValueType.INTS)
+              IndexDocValuesField.set(new Field ("int",      data[i][2], Field.Store.NO, Field.Index.NOT_ANALYZED), ValueType.INTS)
                                : new Field ("int",      data[i][2], Field.Store.NO, Field.Index.NOT_ANALYZED);
           doc.add(f);
         }
         if (data[i][3] != null) {
           Field f = supportsDocValues ?
-              DocValuesField.set(new Field ("float",    data[i][3], Field.Store.NO, Field.Index.NOT_ANALYZED), ValueType.FLOAT_32)
+              IndexDocValuesField.set(new Field ("float",    data[i][3], Field.Store.NO, Field.Index.NOT_ANALYZED), ValueType.FLOAT_32)
                               :  new Field ("float",    data[i][3], Field.Store.NO, Field.Index.NOT_ANALYZED);
           doc.add(f);
         }
@@ -140,7 +140,7 @@ public class TestSort extends LuceneTest
         if (data[i][7] != null) doc.add (new Field ("long",     data[i][7], Field.Store.NO, Field.Index.NOT_ANALYZED));
         if (data[i][8] != null) {
           Field f = supportsDocValues ?
-              DocValuesField.set(new Field ("double",     data[i][8], Field.Store.NO, Field.Index.NOT_ANALYZED), ValueType.FLOAT_64)
+              IndexDocValuesField.set(new Field ("double",     data[i][8], Field.Store.NO, Field.Index.NOT_ANALYZED), ValueType.FLOAT_64)
                               :  new Field ("double",     data[i][8], Field.Store.NO, Field.Index.NOT_ANALYZED);
           doc.add(f);
         }



Mime
View raw message