org.apache.nutch.indexer
Class NutchDocument

java.lang.Object
  extended by org.apache.nutch.indexer.NutchDocument
All Implemented Interfaces:
Iterable<Map.Entry<String,NutchField>>, Writable

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

A NutchDocument is the unit of indexing.


Field Summary
static byte VERSION
           
 
Constructor Summary
NutchDocument()
           
 
Method Summary
 void add(String name, Object value)
           
 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)
           
 void write(DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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,
                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


Copyright © 2006 The Apache Software Foundation