org.compass.core
Interface CompassHitsOperations

All Superinterfaces:
Iterable<CompassHit>, Serializable
All Known Subinterfaces:
CompassDetachedHits, CompassHits, InternalCompassHits
All Known Implementing Classes:
AbstractCompassHits, DefaultCompassDetachedHits, DefaultCompassHits

public interface CompassHitsOperations
extends Serializable, Iterable<CompassHit>

Mutual operations for hits, for both detached and transactional hits.

Author:
kimchy

Method Summary
 Object data(int n)
          Returns the object that maps the n'th hit
 int getLength()
          Returns the number of hits,
 CompassQuery getQuery()
          Retrurn the query that resulted in this search hits.
 CompassQuery getSuggestedQuery()
          Returns a suggested query (based on spell check).
 CompassHighlightedText highlightedText(int n)
          Returns a cached highlighted text the maps to the n'th hit.
 CompassHit hit(int n)
          Returns a compass hit wrapper that maps to the n'th hit
 int length()
          Returns the number of hits,
 Resource resource(int n)
          Returns the resource that maps to the n'th hit
 float score(int n)
          Returns the score of the n'th hit.
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

getLength

int getLength()
Returns the number of hits,

Returns:
The number of hits.

length

int length()
Returns the number of hits,

Returns:
The number of hits.

data

Object data(int n)
            throws CompassException
Returns the object that maps the n'th hit

Parameters:
n - The n'th hit.
Returns:
The object.
Throws:
CompassException

resource

Resource resource(int n)
                  throws CompassException
Returns the resource that maps to the n'th hit

Parameters:
n - The n'th hit.
Returns:
The resource.
Throws:
CompassException

hit

CompassHit hit(int n)
               throws CompassException
Returns a compass hit wrapper that maps to the n'th hit

Parameters:
n - The n'th hit.
Returns:
The hit.
Throws:
CompassException

highlightedText

CompassHighlightedText highlightedText(int n)
                                       throws CompassException
Returns a cached highlighted text the maps to the n'th hit.

Highlighted text is automatically cached when using CompassHighlighter using CompassHits.highlighter(int).

Parameters:
n - The n'th hit
Returns:
A highlighted text cache associated witht the n'th hit
Throws:
CompassException

score

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

Parameters:
n - The n'th hit.
Returns:
The score.
Throws:
CompassException

getQuery

CompassQuery getQuery()
Retrurn the query that resulted in this search hits.


getSuggestedQuery

CompassQuery getSuggestedQuery()
Returns a suggested query (based on spell check).

See Also:
CompassQuery.getSuggestedQuery()


Copyright (c) 2004-2008 The Compass Project.