org.apache.nutch.indexer
Class NutchDocument

java.lang.Object
  extended by 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
static byte VERSION
           
 
Constructor Summary
NutchDocument()
           
 
Method Summary
 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)
           
 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,
                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


Copyright © 2012 The Apache Software Foundation