org.compass.core
Interface CompassHitsOperations

All Known Subinterfaces:
CompassDetachedHits, CompassHits, InternalCompassHits
All Known Implementing Classes:
AbstractCompassHits, DefaultCompassDetachedHits, DefaultCompassHits

public interface CompassHitsOperations

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,
 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.
 

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


Copyright (c) 2004-2006 The Compass Project.