fr.gouv.culture.sdx.search.lucene.query
Class ResultDocument

java.lang.Object
  extended byfr.gouv.culture.sdx.search.lucene.query.ResultDocument
All Implemented Interfaces:
org.apache.avalon.framework.logger.LogEnabled

public class ResultDocument
extends java.lang.Object
implements org.apache.avalon.framework.logger.LogEnabled

A result document of a search.


Constructor Summary
ResultDocument()
          Creates a ResultDocument object A logger must be set and then this object must be setUp.
 
Method Summary
 void enableLogging(org.apache.avalon.framework.logger.Logger logger)
          Sets the logger.
 org.apache.lucene.document.Document getDocument()
          Returns the Lucene document associated with this result.
 java.lang.String getFieldValue(java.lang.String field)
          Returns the value of a field within this document.
 float getScore()
          Returns the relavance ranking for this document.
 void setUp(org.apache.lucene.document.Document doc, float score)
          Builds a ResultDocument with a Lucene document and a relavance ranking.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultDocument

public ResultDocument()
Creates a ResultDocument object

A logger must be set and then this object must be setUp.

See Also:
enableLogging(org.apache.avalon.framework.logger.Logger), setUp(org.apache.lucene.document.Document, float)
Method Detail

setUp

public void setUp(org.apache.lucene.document.Document doc,
                  float score)
           throws SDXException
Builds a ResultDocument with a Lucene document and a relavance ranking.

Parameters:
doc - The Lucene document
score - The relavance ranking
Throws:
SDXException

getFieldValue

public java.lang.String getFieldValue(java.lang.String field)
Returns the value of a field within this document. This method never returns null, it will turn over a null String if the field does not exist.

Parameters:
field - The name of the field.

getScore

public float getScore()
Returns the relavance ranking for this document.


getDocument

public org.apache.lucene.document.Document getDocument()
Returns the Lucene document associated with this result.


enableLogging

public void enableLogging(org.apache.avalon.framework.logger.Logger logger)
Sets the logger.

Specified by:
enableLogging in interface org.apache.avalon.framework.logger.LogEnabled
Parameters:
logger - The logger.


Copyright © 2000-2004 Ministere de la culture et de la communication / AJLSM. All Rights Reserved.