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
ANutchDocument
is the unit of indexing.
-
-
Field Summary
Fields Modifier and Type Field Description static byte
VERSION
-
Constructor Summary
Constructors Constructor Description NutchDocument()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(String name, Object value)
NutchDocument
clone()
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)
String
toString()
void
write(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:
iterator
in 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:
readFields
in interfaceWritable
- Throws:
IOException
-
write
public void write(DataOutput out) throws IOException
- Specified by:
write
in interfaceWritable
- Throws:
IOException
-
clone
public NutchDocument clone() throws CloneNotSupportedException
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-
-