org.apache.nutch.indexer

## Class NutchDocument

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

- All Implemented Interfaces:
    Iterable<Map.Entry<String,List<String>>>, Writable

      public class NutchDocument
      extends Object
      implements Writable, Iterable<Map.Entry<String,List<String>>>

  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

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(String name, String value)`
    `Metadata` | `getDocumentMeta()`
    `Collection<String>` | `getFieldNames()`
    `String` | `getFieldValue(String name)`
    `List<String>` | `getFieldValues(String name)`
    `float` | `getScore()`
    `Iterator<Map.Entry<String,List<String>>>` | `iterator()` Iterate over all fields.
    `void` | `readFields(DataInput in)`
    `List<String>` | `removeField(String name)`
    `void` | `setScore(float score)`
    `String` | `toString()` A utility-like method which can easily be used to write any `NutchDocument` object to string for simple debugging.
    `void` | `write(DataOutput out)`

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

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

- - ### 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,
                 String value)

    - #### getFieldValue

          public String getFieldValue(String name)

    - #### getFieldValues

          public List<String> getFieldValues(String name)

    - #### removeField

          public List<String> removeField(String name)

    - #### getFieldNames

          public Collection<String> getFieldNames()

    - #### iterator

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

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

    - #### getScore

          public float getScore()

    - #### setScore

          public void setScore(float score)

    - #### 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()

      A utility-like method which can easily be used to write any `NutchDocument` object to string for simple debugging.
      Overrides:
        `toString` in class `Object`

Copyright © 2015 The Apache Software Foundation