org.apache.nutch.searcher
Class Hit

java.lang.Object
  extended by org.apache.nutch.searcher.Hit
All Implemented Interfaces:
Comparable<Hit>, Writable

public class Hit
extends Object
implements Writable, Comparable<Hit>

A document which matched a query in an index.


Constructor Summary
Hit()
           
Hit(int indexNo, String uniqueKey)
           
Hit(int indexNo, String uniqueKey, WritableComparable sortValue, String dedupValue)
           
Hit(String uniqueKey, WritableComparable sortValue, String dedupValue)
           
 
Method Summary
 int compareTo(Hit other)
           
 String getDedupValue()
          Return the value of the field that hits should be deduplicated on.
 int getIndexNo()
          Return the index number that this hit came from.
 WritableComparable getSortValue()
          Return the value of the field that hits are sorted on.
 String getUniqueKey()
          Return the unique identifier of this hit within an index.
 boolean moreFromDupExcluded()
          True if other, lower-scoring, hits with the same dedup value have been excluded from the list which contains this hit..
 void readFields(DataInput in)
           
 void setIndexNo(int indexNo)
           
 void setMoreFromDupExcluded(boolean more)
          True if other, lower-scoring, hits with the same dedup value have been excluded from the list which contains this hit..
 String toString()
          Display as a string.
 void write(DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Hit

public Hit()

Hit

public Hit(int indexNo,
           String uniqueKey)

Hit

public Hit(int indexNo,
           String uniqueKey,
           WritableComparable sortValue,
           String dedupValue)

Hit

public Hit(String uniqueKey,
           WritableComparable sortValue,
           String dedupValue)
Method Detail

getIndexNo

public int getIndexNo()
Return the index number that this hit came from.


setIndexNo

public void setIndexNo(int indexNo)

getUniqueKey

public String getUniqueKey()
Return the unique identifier of this hit within an index.


getSortValue

public WritableComparable getSortValue()
Return the value of the field that hits are sorted on.


getDedupValue

public String getDedupValue()
Return the value of the field that hits should be deduplicated on.


moreFromDupExcluded

public boolean moreFromDupExcluded()
True if other, lower-scoring, hits with the same dedup value have been excluded from the list which contains this hit..


setMoreFromDupExcluded

public void setMoreFromDupExcluded(boolean more)
True if other, lower-scoring, hits with the same dedup value have been excluded from the list which contains this hit..


toString

public String toString()
Display as a string.

Overrides:
toString in class Object

compareTo

public int compareTo(Hit other)
Specified by:
compareTo in interface Comparable<Hit>

write

public void write(DataOutput out)
           throws IOException
Specified by:
write in interface Writable
Throws:
IOException

readFields

public void readFields(DataInput in)
                throws IOException
Specified by:
readFields in interface Writable
Throws:
IOException


Copyright © 2006 The Apache Software Foundation