org.apache.nutch.indexer

## Class NutchDocument

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

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

      public class NutchDocument
      extends java.lang.Object
      implements Writable, java.lang.Iterable<java.util.Map.Entry<java.lang.String,java.util.List<java.lang.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

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

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

      `clone, 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.String value)

    - #### getFieldValue

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

    - #### getFieldValues

          public java.util.List<java.lang.String> getFieldValues(java.lang.String name)

    - #### removeField

          public java.util.List<java.lang.String> 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,java.util.List<java.lang.String>>> iterator()

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

    - #### getScore

          public float getScore()

    - #### setScore

          public void setScore(float score)

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

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

Copyright © 2019 The Apache Software Foundation