diff --git a/lucene/core/src/java/org/apache/lucene/document/Document.java b/lucene/core/src/java/org/apache/lucene/document/Document.java index cdba083942f..2f44444babe 100644 --- a/lucene/core/src/java/org/apache/lucene/document/Document.java +++ b/lucene/core/src/java/org/apache/lucene/document/Document.java @@ -199,8 +199,7 @@ public final class Document implements Iterable { * Returns an array of values of the field specified as the method parameter. * This method returns an empty array when there are no * matching fields. It never returns null. - * For {@link LegacyIntField}, {@link LegacyLongField}, {@link - * LegacyFloatField} and {@link LegacyDoubleField} it returns the string value of the number. If you want + * For a numeric {@link StoredField} it returns the string value of the number. If you want * the actual numeric field instances back, use {@link #getFields}. * @param name the name of the field * @return a String[] of field values @@ -224,8 +223,7 @@ public final class Document implements Iterable { * this document, or null. If multiple fields exist with this name, this * method returns the first value added. If only binary fields with this name * exist, returns null. - * For {@link LegacyIntField}, {@link LegacyLongField}, {@link - * LegacyFloatField} and {@link LegacyDoubleField} it returns the string value of the number. If you want + * For a numeric {@link StoredField} it returns the string value of the number. If you want * the actual numeric field instance back, use {@link #getField}. */ public final String get(String name) { diff --git a/lucene/core/src/java/org/apache/lucene/document/Field.java b/lucene/core/src/java/org/apache/lucene/document/Field.java index dff2e58aa6e..550d1fd1797 100644 --- a/lucene/core/src/java/org/apache/lucene/document/Field.java +++ b/lucene/core/src/java/org/apache/lucene/document/Field.java @@ -33,11 +33,20 @@ import org.apache.lucene.util.BytesRef; /** * Expert: directly create a field for a document. Most - * users should use one of the sugar subclasses: {@link - * LegacyIntField}, {@link LegacyLongField}, {@link LegacyFloatField}, {@link - * LegacyDoubleField}, {@link BinaryDocValuesField}, {@link - * NumericDocValuesField}, {@link SortedDocValuesField}, {@link - * StringField}, {@link TextField}, {@link StoredField}. + * users should use one of the sugar subclasses: + * * *

A field is a section of a Document. Each field has three * parts: name, type and value. Values may be text diff --git a/lucene/core/src/test/org/apache/lucene/document/TestDocument.java b/lucene/core/src/test/org/apache/lucene/document/TestDocument.java index bd873ec8a9c..50c1ed0a919 100644 --- a/lucene/core/src/test/org/apache/lucene/document/TestDocument.java +++ b/lucene/core/src/test/org/apache/lucene/document/TestDocument.java @@ -340,10 +340,10 @@ public class TestDocument extends LuceneTestCase { public void testNumericFieldAsString() throws Exception { Document doc = new Document(); - doc.add(new LegacyIntField("int", 5, Field.Store.YES)); + doc.add(new StoredField("int", 5)); assertEquals("5", doc.get("int")); assertNull(doc.get("somethingElse")); - doc.add(new LegacyIntField("int", 4, Field.Store.YES)); + doc.add(new StoredField("int", 4)); assertArrayEquals(new String[] { "5", "4" }, doc.getValues("int")); Directory dir = newDirectory();