com.day.cq.search.result
Interface SearchResult

All Known Implementing Classes:
SearchResultImpl

public interface SearchResult

SearchResult represents a search result of a JCR query, returned by Query and SimpleSearch.


Method Summary
 String getExecutionTime()
          Returns the execution time in fractions of a second.
 long getExecutionTimeMillis()
          Returns the execution time in milliseconds.
 Map<String,Facet> getFacets()
          Returns the facets for this search result.
 String getFilteringPredicates()
          Returns a string with a list of the predicates that were filtering the result set (as opposed to using XPath, see getQueryStatement()).
 List<Hit> getHits()
           
 long getHitsPerPage()
           
 ResultPage getNextPage()
           
 ResultPage getPreviousPage()
           
 String getQueryStatement()
          Returns the actual query string run against the repository, eg.
 List<ResultPage> getResultPages()
           
 long getStartIndex()
           
 long getTotalMatches()
           
 

Method Detail

getTotalMatches

long getTotalMatches()
Returns:
the total number of matches.

getStartIndex

long getStartIndex()
Returns:
the start index. i.e. from where to start to display the hits.

getHitsPerPage

long getHitsPerPage()
Returns:
the number of hits to display on a page (0 for all).

getHits

List<Hit> getHits()
Returns:
a List of Hits to display on the result page.

getResultPages

List<ResultPage> getResultPages()
Returns:
a List of ResultPagees to display the navigation through the result pages.

getPreviousPage

ResultPage getPreviousPage()
Returns:
the page, which contains the information about the previous page. Returns null if there is no previous page (i.e. the current page is the first page).

getNextPage

ResultPage getNextPage()
Returns:
the page, which contains the information about the next page. Returns null if there is no next page (i.e. the current page is the last page).

getExecutionTime

String getExecutionTime()
Returns the execution time in fractions of a second.
Example: 0.08 (means, the query took 80 milliseconds to execute).

Returns:
the execution time of the query.

getExecutionTimeMillis

long getExecutionTimeMillis()
Returns the execution time in milliseconds.

Returns:
the execution time of the query.

getFacets

Map<String,Facet> getFacets()
                            throws RepositoryException
Returns the facets for this search result.

Returns:
the facets for this search result.
Throws:
RepositoryException - if an error occurs while executing the query or calculating the facets.

getQueryStatement

String getQueryStatement()
Returns the actual query string run against the repository, eg. an XPath statement. Please note that this does not describe the full query - for a simple list of the predicates that filter see getFilteringPredicates().

Returns:
a string of the query that was created

getFilteringPredicates

String getFilteringPredicates()
Returns a string with a list of the predicates that were filtering the result set (as opposed to using XPath, see getQueryStatement()). The returned string is for informational purposes only and might not fully describe the predicates and their parameters.

Returns:
a string mentioning all the predicates that filtered the result set


Copyright © 2009 Day Management AG. All Rights Reserved.