Package org.apache.nutch.indexer

## Class NutchDocument

- java.lang.Object
- - org.apache.nutch.indexer.NutchDocument

- All Implemented Interfaces:
    `Cloneable`, `Iterable<Map.Entry<String,​NutchField>>`, `Writable`

      public class NutchDocument
      extends Object
      implements Writable, Iterable<Map.Entry<String,​NutchField>>, Cloneable

  A `NutchDocument` is the unit of indexing.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static byte` | `VERSION` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `NutchDocument()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `add​(String name, Object value)` |
    `NutchDocument` | `clone()` |
    `Metadata` | `getDocumentMeta()` |
    `NutchField` | `getField​(String name)` |
    `Collection<String>` | `getFieldNames()` |
    `Object` | `getFieldValue​(String name)` |
    `float` | `getWeight()` |
    `Iterator<Map.Entry<String,​NutchField>>` | `iterator()` | Iterate over all fields.
    `void` | `readFields​(DataInput in)` |
    `NutchField` | `removeField​(String name)` |
    `void` | `setWeight​(float weight)` |
    `String` | `toString()` |
    `void` | `write​(DataOutput out)` |

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.lang.Iterable

      `forEach, spliterator`

- - ### Field Detail

    - #### VERSION

          public static final byte VERSION

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### NutchDocument

          public NutchDocument()

  - ### Method Detail

    - #### add

          public void add​(String name,
                          Object value)

    - #### getFieldValue

          public Object getFieldValue​(String name)

    - #### getField

          public NutchField getField​(String name)

    - #### removeField

          public NutchField removeField​(String name)

    - #### getFieldNames

          public Collection<String> getFieldNames()

    - #### iterator

          public Iterator<Map.Entry<String,​NutchField>> iterator()

      Iterate over all fields.
      Specified by:
        `iterator` in interface `Iterable<Map.Entry<String,​NutchField>>`

    - #### getWeight

          public float getWeight()

    - #### setWeight

          public void setWeight​(float weight)

    - #### getDocumentMeta

          public Metadata getDocumentMeta()

    - #### readFields

          public void readFields​(DataInput in)
                          throws IOException

      Specified by:
        `readFields` in interface `Writable`
      Throws:
        `IOException`

    - #### write

          public void write​(DataOutput out)
                     throws IOException

      Specified by:
        `write` in interface `Writable`
      Throws:
        `IOException`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### clone

          public NutchDocument clone()
                              throws CloneNotSupportedException

      Overrides:
        `clone` in class `Object`
      Throws:
        `CloneNotSupportedException`