diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40Codec.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40Codec.java index 8b2279d9692..3b0e65e61c5 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40Codec.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40Codec.java @@ -30,7 +30,8 @@ import org.apache.lucene.codecs.perfield.PerFieldPostingsFormat; /** * Implements the Lucene 4.0 index format, with configurable per-field postings formats. - * + * + * @see org.apache.lucene.codecs.lucene40 package documentation for file format details. * @lucene.experimental */ // NOTE: if we make largish changes in a minor release, easier to just make Lucene42Codec or whatever diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40DocValuesConsumer.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40DocValuesConsumer.java index 6ffaec48d1e..30fdcd087e9 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40DocValuesConsumer.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40DocValuesConsumer.java @@ -31,7 +31,9 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.util.IOUtils; /** - * Default PerDocConsumer implementation that uses compound file. + * Lucene 4.0 PerDocConsumer implementation that uses compound file. + * + * @see Lucene40DocValuesFormat * @lucene.experimental */ public class Lucene40DocValuesConsumer extends DocValuesWriterBase { diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40DocValuesFormat.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40DocValuesFormat.java index ce563a800b2..4f5c5ef3f1b 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40DocValuesFormat.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40DocValuesFormat.java @@ -23,10 +23,108 @@ import java.util.Set; import org.apache.lucene.codecs.DocValuesFormat; import org.apache.lucene.codecs.PerDocConsumer; import org.apache.lucene.codecs.PerDocProducer; +import org.apache.lucene.index.DocValues; // javadocs +import org.apache.lucene.index.DocValues.Type; // javadocs import org.apache.lucene.index.PerDocWriteState; import org.apache.lucene.index.SegmentInfo; import org.apache.lucene.index.SegmentReadState; +import org.apache.lucene.store.CompoundFileDirectory; // javadocs +import org.apache.lucene.store.DataOutput; // javadocs +import org.apache.lucene.util.CodecUtil; // javadocs +import org.apache.lucene.util.packed.PackedInts; // javadocs +/** + * Lucene 4.0 DocValues format. + *
+ * Files: + *
+ * There are several many types of {@link DocValues} with different encodings. + * From the perspective of filenames, all types store their values in .dat + * entries within the compound file. In the case of dereferenced/sorted types, the .dat + * actually contains only the unique values, and an additional .idx file contains + * pointers to these unique values. + *
+ * + * Formats: + *Header+ValueSize+(ordinal*ValueSize)
because the byte length is fixed.
+ * In the VAR_SORTED case, there is double indirection (docid -> ordinal -> address), but
+ * an additional sentinel ordinal+address is always written (so there are NumValues+1 ordinals). To
+ * determine the length, ord+1's address is looked up as well.+ * Files: + *
+ * It reads .tvd, .tvf, and .tvx files. + * + * @see Lucene40TermVectorsFormat + */ public class Lucene40TermVectorsReader extends TermVectorsReader { // NOTE: if you make a new format, it must be larger than diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40TermVectorsWriter.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40TermVectorsWriter.java index a22e8562b8e..372db237f40 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40TermVectorsWriter.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40TermVectorsWriter.java @@ -47,6 +47,13 @@ import org.apache.lucene.util.StringHelper; // file; saves a seek to tvd only to read a 0 vint (and // saves a byte in tvd) +/** + * Lucene 4.0 Term Vectors writer. + *
+ * It writes .tvd, .tvf, and .tvx files. + * + * @see Lucene40TermVectorsFormat + */ public final class Lucene40TermVectorsWriter extends TermVectorsWriter { private final Directory directory; private final String segment; diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/package.html b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/package.html index 8a86bfeb3dd..6bde5694e6f 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/package.html +++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/package.html @@ -167,7 +167,8 @@ term occurs in each document. Note that this will not exist if all fields in all documents omit position data.
- * NOTE: Fields of this type will not store values for documents without and + * NOTE: Fields of this type will not store values for documents without an * 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. Custom default values must be assigned explicitly. @@ -575,7 +575,7 @@ public abstract class DocValues implements Closeable { * {@link #BYTES_FIXED_DEREF}, but allowing each * document's value to be a different length. *
- * NOTE: Fields of this type will not store values for documents without and + * NOTE: Fields of this type will not store values for documents without an * 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. Custom default values must be assigned explicitly. @@ -589,7 +589,7 @@ public abstract class DocValues implements Closeable { * {@link #BYTES_FIXED_SORTED}, but allowing each * document's value to be a different length. *
- * NOTE: Fields of this type will not store values for documents without and + * NOTE: Fields of this type will not store values for documents without an * 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.Custom default values must be assigned explicitly. @@ -607,7 +607,7 @@ public abstract class DocValues implements Closeable { * and allows access via document id, ordinal and by-value. * Use this type if your documents may share the same byte[]. *
- * NOTE: Fields of this type will not store values for documents without and
+ * NOTE: Fields of this type will not store values for documents without an
* 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. Custom default values must be assigned
diff --git a/lucene/core/src/java/org/apache/lucene/util/mutable/MutableValue.java b/lucene/core/src/java/org/apache/lucene/util/mutable/MutableValue.java
index fd95d053ccd..57c966cdbb9 100755
--- a/lucene/core/src/java/org/apache/lucene/util/mutable/MutableValue.java
+++ b/lucene/core/src/java/org/apache/lucene/util/mutable/MutableValue.java
@@ -16,7 +16,11 @@
*/
package org.apache.lucene.util.mutable;
-/** @lucene.internal */
+/**
+ * Base class for all mutable values.
+ *
+ * @lucene.internal
+ */
public abstract class MutableValue implements Comparableboolean
.
+ */
public class MutableValueBool extends MutableValue {
public boolean value;
diff --git a/lucene/core/src/java/org/apache/lucene/util/mutable/MutableValueDate.java b/lucene/core/src/java/org/apache/lucene/util/mutable/MutableValueDate.java
index f0f48cf43bb..e95ace32267 100755
--- a/lucene/core/src/java/org/apache/lucene/util/mutable/MutableValueDate.java
+++ b/lucene/core/src/java/org/apache/lucene/util/mutable/MutableValueDate.java
@@ -18,6 +18,10 @@ package org.apache.lucene.util.mutable;
import java.util.Date;
+/**
+ * {@link MutableValue} implementation of type
+ * {@link Date}.
+ */
public class MutableValueDate extends MutableValueLong {
@Override
public Object toObject() {
diff --git a/lucene/core/src/java/org/apache/lucene/util/mutable/MutableValueDouble.java b/lucene/core/src/java/org/apache/lucene/util/mutable/MutableValueDouble.java
index 901f48b8e96..3d40f399696 100755
--- a/lucene/core/src/java/org/apache/lucene/util/mutable/MutableValueDouble.java
+++ b/lucene/core/src/java/org/apache/lucene/util/mutable/MutableValueDouble.java
@@ -16,6 +16,10 @@
*/
package org.apache.lucene.util.mutable;
+/**
+ * {@link MutableValue} implementation of type
+ * double
.
+ */
public class MutableValueDouble extends MutableValue {
public double value;
diff --git a/lucene/core/src/java/org/apache/lucene/util/mutable/MutableValueFloat.java b/lucene/core/src/java/org/apache/lucene/util/mutable/MutableValueFloat.java
index c8a28824254..91c0614f6c1 100755
--- a/lucene/core/src/java/org/apache/lucene/util/mutable/MutableValueFloat.java
+++ b/lucene/core/src/java/org/apache/lucene/util/mutable/MutableValueFloat.java
@@ -16,6 +16,10 @@
*/
package org.apache.lucene.util.mutable;
+/**
+ * {@link MutableValue} implementation of type
+ * float
.
+ */
public class MutableValueFloat extends MutableValue {
public float value;
diff --git a/lucene/core/src/java/org/apache/lucene/util/mutable/MutableValueInt.java b/lucene/core/src/java/org/apache/lucene/util/mutable/MutableValueInt.java
index d652b1ed0eb..fc7be611fcd 100755
--- a/lucene/core/src/java/org/apache/lucene/util/mutable/MutableValueInt.java
+++ b/lucene/core/src/java/org/apache/lucene/util/mutable/MutableValueInt.java
@@ -16,6 +16,10 @@
*/
package org.apache.lucene.util.mutable;
+/**
+ * {@link MutableValue} implementation of type
+ * int
.
+ */
public class MutableValueInt extends MutableValue {
public int value;
diff --git a/lucene/core/src/java/org/apache/lucene/util/mutable/MutableValueLong.java b/lucene/core/src/java/org/apache/lucene/util/mutable/MutableValueLong.java
index 372e5229ef7..cb89050a49e 100644
--- a/lucene/core/src/java/org/apache/lucene/util/mutable/MutableValueLong.java
+++ b/lucene/core/src/java/org/apache/lucene/util/mutable/MutableValueLong.java
@@ -16,6 +16,10 @@
*/
package org.apache.lucene.util.mutable;
+/**
+ * {@link MutableValue} implementation of type
+ * long
.
+ */
public class MutableValueLong extends MutableValue {
public long value;
diff --git a/lucene/core/src/java/org/apache/lucene/util/mutable/MutableValueStr.java b/lucene/core/src/java/org/apache/lucene/util/mutable/MutableValueStr.java
index 3c1d1e98c08..55dfe02aee9 100755
--- a/lucene/core/src/java/org/apache/lucene/util/mutable/MutableValueStr.java
+++ b/lucene/core/src/java/org/apache/lucene/util/mutable/MutableValueStr.java
@@ -18,6 +18,10 @@ package org.apache.lucene.util.mutable;
import org.apache.lucene.util.BytesRef;
+/**
+ * {@link MutableValue} implementation of type
+ * {@link String}.
+ */
public class MutableValueStr extends MutableValue {
public BytesRef value = new BytesRef();
diff --git a/lucene/core/src/java/overview.html b/lucene/core/src/java/overview.html
index ad19074a546..14929b9c49f 100644
--- a/lucene/core/src/java/overview.html
+++ b/lucene/core/src/java/overview.html
@@ -152,11 +152,11 @@ index for all the files contained in a directory.
> java -cp lucene.jar:lucene-demo.jar:lucene-analyzers-common.jar org.apache.lucene.demo.IndexFiles rec.food.recipes/soups +> java -cp lucene-core.jar:lucene-demo.jar:lucene-analyzers-common.jar org.apache.lucene.demo.IndexFiles rec.food.recipes/soups
adding rec.food.recipes/soups/abalone-chowder
[ ... ] -> java -cp lucene.jar:lucene-demo.jar:lucene-analyzers-common.jar org.apache.lucene.demo.SearchFiles +
> java -cp lucene-core.jar:lucene-demo.jar:lucene-analyzers-common.jar org.apache.lucene.demo.SearchFiles
Query: chowder
Searching for: chowder
34 total matching documents