org.compass.core.support.search
Class CompassSearchResults

java.lang.Object
  extended by org.compass.core.support.search.CompassSearchResults

public class CompassSearchResults
extends Object

The results object returned by CompassSearchHelper when the search operation on Compass is executed.

Holds the time it took to perform the search operation (in milliseconds), an array of CompassHit (which might be all the hits, or only paginated hits) and an array of Pages if using the pagination feature.

Author:
kimchy

Nested Class Summary
static class CompassSearchResults.Page
          A class which holds the page data if using the pagination feature.
 
Constructor Summary
CompassSearchResults(CompassHit[] hits, long searchTime, int totalHits)
           
 
Method Summary
 CompassHit[] getHits()
          Returns the hits that resulted from the search operation.
 CompassSearchResults.Page[] getPages()
          Returns the pages that construct all the results.
 long getSearchTime()
          Returns the time that it took to perform the search operation (in milliseconds).
 int getTotalHits()
          Returns the total number of hits resulted from this search query.
 void setPages(CompassSearchResults.Page[] pages)
          Sets the pages that contruct all the results.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompassSearchResults

public CompassSearchResults(CompassHit[] hits,
                            long searchTime,
                            int totalHits)
Method Detail

getHits

public CompassHit[] getHits()
Returns the hits that resulted from the search operation. Might hold all the hits (not using pagination) or only the hits that belong to the selected page (if using pagination).

Returns:
The hits

getSearchTime

public long getSearchTime()
Returns the time that it took to perform the search operation (in milliseconds).

Returns:
How long it took to perform the serarch in milli-seconds.

getTotalHits

public int getTotalHits()
Returns the total number of hits resulted from this search query.

Returns:
The total number of hits

getPages

public CompassSearchResults.Page[] getPages()
Returns the pages that construct all the results.

Returns:
The pages that holds all the results

setPages

public void setPages(CompassSearchResults.Page[] pages)
Sets the pages that contruct all the results.

Parameters:
pages -


Copyright (c) 2004-2008 The Compass Project.