org.apache.lucene.search

Class Hit

public class Hit extends Object implements Serializable

Wrapper used by HitIterator to provide a lazily loaded hit from Hits.

Author: Jeremy Rayner

Method Summary
Stringget(String name)
Returns the string value of the field with the given name if any exist in this document, or null.
floatgetBoost()
Returns the boost factor for this hit on any field of the underlying document.
DocumentgetDocument()
Returns document for this hit.
intgetId()
Returns id for this hit.
floatgetScore()
Returns score for this hit.
StringtoString()
Prints the parameters to be used to discover the promised result.

Method Detail

get

public String get(String name)
Returns the string value of the field with the given name if any exist in this document, or null. If multiple fields exist with this name, this method returns the first value added. If only binary fields with this name exist, returns null.

See Also: get

getBoost

public float getBoost()
Returns the boost factor for this hit on any field of the underlying document.

See Also: getBoost

getDocument

public Document getDocument()
Returns document for this hit.

See Also: Hits

getId

public int getId()
Returns id for this hit.

See Also: Hits

getScore

public float getScore()
Returns score for this hit.

See Also: Hits

toString

public String toString()
Prints the parameters to be used to discover the promised result.
Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.