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

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

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

The documents which form an ordered list of search results. This class allows one to manage the sorting effectively, because only the requests which require a sorting other than the relevance are actually sorted.


Constructor Summary
ResultDocuments()
          Creates a ResultDocuments 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.
 ResultDocument getDocument(int i)
          Returns a document according to its index in the list.
 ResultDocument[] getDocuments()
          Returns all of the result documents.
 int getLength()
          Returns the number of results.
 float getMaxScore()
          Returns the relevance ranking of the first document; therefore, the highest ranking is returned.
 void setSortedResults(ResultDocument[] sr)
          Sets the sorted results.
 void setUp(org.apache.lucene.search.Hits h)
          Builds a list of result documents from Lucene results.
 void setUp(ResultDocument[] sr)
          Builds a list of result documents from an array or sorted ResultDocuments.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultDocuments

public ResultDocuments()
Creates a ResultDocuments 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.search.Hits)
Method Detail

setUp

public void setUp(org.apache.lucene.search.Hits h)
Builds a list of result documents from Lucene results.

Parameters:
h - The Lucene results.

setUp

public void setUp(ResultDocument[] sr)
Builds a list of result documents from an array or sorted ResultDocuments.

Parameters:
sr - The sorted results.

setSortedResults

public void setSortedResults(ResultDocument[] sr)
Sets the sorted results.

Parameters:
sr - The sorted results.

getLength

public int getLength()
Returns the number of results.


getMaxScore

public float getMaxScore()
                  throws SDXException,
                         java.io.IOException
Returns the relevance ranking of the first document; therefore, the highest ranking is returned.

Throws:
SDXException
java.io.IOException

getDocument

public ResultDocument getDocument(int i)
                           throws SDXException
Returns a document according to its index in the list.

Parameters:
i - The index of the desired document.
Throws:
SDXException

getDocuments

public ResultDocument[] getDocuments()
                              throws SDXException
Returns all of the result documents.

Throws:
SDXException

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.