org.compass.core.engine
Interface SearchEngineHits

All Known Subinterfaces:
LuceneSearchEngineHits
All Known Implementing Classes:
DefaultLuceneSearchEngineHits, EmptyLuceneSearchEngineHits

public interface SearchEngineHits

Holds hits returned by a find operation of a search engine.

Author:
kimchy
See Also:
SearchEngineQuery.hits()

Method Summary
 void close()
          Closes the hits object.
 SearchEngineHighlighter getHighlighter()
          Returns an highlighter for the hits.
 int getLength()
          Returns the number of hits.
 Resource getResource(int n)
          Returns that maps to the n'th hit.
 float score(int i)
          Returns the score of the n'th hit.
 

Method Detail

getResource

Resource getResource(int n)
                     throws SearchEngineException
Returns that maps to the n'th hit.

Throws:
SearchEngineException

getLength

int getLength()
Returns the number of hits.


score

float score(int i)
            throws SearchEngineException
Returns the score of the n'th hit. Can be a value between 0 and 1, normalised by the highest scoring hit.

Throws:
SearchEngineException

getHighlighter

SearchEngineHighlighter getHighlighter()
                                       throws SearchEngineException
Returns an highlighter for the hits.

Throws:
SearchEngineException

close

void close()
           throws SearchEngineException
Closes the hits object. Note that it is an optional operation since it will be closed transperantly when the transaction is closed.

It is provided for more controlled resource management

Throws:
SearchEngineException


Copyright (c) 2004-2008 The Compass Project.