Package org.apache.nutch.indexer
Class NutchDocument
- java.lang.Object
-
- org.apache.nutch.indexer.NutchDocument
-
public class NutchDocument extends Object implements Writable, Iterable<Map.Entry<String,NutchField>>, Cloneable
ANutchDocumentis the unit of indexing.
-
-
Field Summary
Fields Modifier and Type Field Description static byteVERSION
-
Constructor Summary
Constructors Constructor Description NutchDocument()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(String name, Object value)NutchDocumentclone()MetadatagetDocumentMeta()NutchFieldgetField(String name)Collection<String>getFieldNames()ObjectgetFieldValue(String name)floatgetWeight()Iterator<Map.Entry<String,NutchField>>iterator()Iterate over all fields.voidreadFields(DataInput in)NutchFieldremoveField(String name)voidsetWeight(float weight)StringtoString()voidwrite(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
-
-
Method Detail
-
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:
iteratorin interfaceIterable<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:
readFieldsin interfaceWritable- Throws:
IOException
-
write
public void write(DataOutput out) throws IOException
- Specified by:
writein interfaceWritable- Throws:
IOException
-
clone
public NutchDocument clone() throws CloneNotSupportedException
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
-