You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2016/03/08 16:55:22 UTC

lucene-solr git commit: LUCENE-7075: clean up LegacyNumeric* in .document javadocs

Repository: lucene-solr
Updated Branches:
  refs/heads/master dcb7a882b -> 75f18ad40


LUCENE-7075: clean up LegacyNumeric* in .document javadocs


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/75f18ad4
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/75f18ad4
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/75f18ad4

Branch: refs/heads/master
Commit: 75f18ad40461d9d9a0936a12cc18fe3d8294eb89
Parents: dcb7a88
Author: Robert Muir <rm...@apache.org>
Authored: Tue Mar 8 10:54:29 2016 -0500
Committer: Robert Muir <rm...@apache.org>
Committed: Tue Mar 8 10:55:13 2016 -0500

----------------------------------------------------------------------
 .../org/apache/lucene/document/Document.java     |  6 ++----
 .../java/org/apache/lucene/document/Field.java   | 19 ++++++++++++++-----
 .../org/apache/lucene/document/TestDocument.java |  4 ++--
 3 files changed, 18 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/75f18ad4/lucene/core/src/java/org/apache/lucene/document/Document.java
----------------------------------------------------------------------
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 cdba083..2f44444 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<IndexableField> {
    * 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 <code>String[]</code> of field values
@@ -224,8 +223,7 @@ public final class Document implements Iterable<IndexableField> {
    * 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) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/75f18ad4/lucene/core/src/java/org/apache/lucene/document/Field.java
----------------------------------------------------------------------
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 dff2e58..550d1fd 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: 
+ * <ul>
+ *    <li>{@link TextField}: {@link Reader} or {@link String} indexed for full-text search
+ *    <li>{@link StringField}: {@link String} indexed verbatim as a single token
+ *    <li>{@link IntPoint}: {@code int} indexed for exact/range queries.
+ *    <li>{@link LongPoint}: {@code long} indexed for exact/range queries.
+ *    <li>{@link FloatPoint}: {@code float} indexed for exact/range queries.
+ *    <li>{@link DoublePoint}: {@code double} indexed for exact/range queries.
+ *    <li>{@link SortedDocValuesField}: {@code byte[]} indexed column-wise for sorting/faceting
+ *    <li>{@link SortedSetDocValuesField}: {@code SortedSet<byte[]>} indexed column-wise for sorting/faceting
+ *    <li>{@link NumericDocValuesField}: {@code long} indexed column-wise for sorting/faceting
+ *    <li>{@link SortedNumericDocValuesField}: {@code SortedSet<long>} indexed column-wise for sorting/faceting
+ *    <li>{@link StoredField}: Stored-only value for retrieving in summary results
+ * </ul>
  *
  * <p> A field is a section of a Document. Each field has three
  * parts: name, type and value. Values may be text

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/75f18ad4/lucene/core/src/test/org/apache/lucene/document/TestDocument.java
----------------------------------------------------------------------
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 bd873ec..50c1ed0 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();