org.apache.nutch.indexer

## Class NutchDocument

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

- All Implemented Interfaces:
    java.lang.Cloneable, java.lang.Iterable<java.util.Map.Entry<java.lang.String,NutchField>>, Writable

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

  A `NutchDocument` is the unit of indexing.

- - ### Field Summary

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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NutchDocument()`

  - ### Method Summary

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

    - #### getFieldValue

          public java.lang.Object getFieldValue(java.lang.String name)

    - #### getField

          public NutchField getField(java.lang.String name)

    - #### removeField

          public NutchField removeField(java.lang.String name)

    - #### getFieldNames

          public java.util.Collection<java.lang.String> getFieldNames()

    - #### iterator

          public java.util.Iterator<java.util.Map.Entry<java.lang.String,NutchField>> iterator()

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

    - #### getWeight

          public float getWeight()

    - #### setWeight

          public void setWeight(float weight)

    - #### getDocumentMeta

          public Metadata getDocumentMeta()

    - #### readFields

          public void readFields(java.io.DataInput in)
                          throws java.io.IOException

      Specified by:
        `readFields` in interface `Writable`
      Throws:
        `java.io.IOException`

    - #### write

          public void write(java.io.DataOutput out)
                     throws java.io.IOException

      Specified by:
        `write` in interface `Writable`
      Throws:
        `java.io.IOException`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### clone

          public NutchDocument clone()
                              throws java.lang.CloneNotSupportedException

      Overrides:
        `clone` in class `java.lang.Object`
      Throws:
        `java.lang.CloneNotSupportedException`

Copyright © 2019 The Apache Software Foundation