Package com.day.cq.search.result
Interface SearchResult
-
public interface SearchResult
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
getExecutionTime()
Returns the execution time in fractions of a second.long
getExecutionTimeMillis()
Returns the execution time in milliseconds.java.util.Map<java.lang.String,Facet>
getFacets()
Returns the facets for this search result.java.lang.String
getFilteringPredicates()
Returns a string with a list of the predicates that were filtering the result set (as opposed to using XPath, seegetQueryStatement()
).java.util.List<Hit>
getHits()
long
getHitsPerPage()
ResultPage
getNextPage()
java.util.Iterator<Node>
getNodes()
ResultPage
getPreviousPage()
java.lang.String
getQueryStatement()
Returns the actual query string run against the repository, eg.java.util.Iterator<Resource>
getResources()
java.util.List<ResultPage>
getResultPages()
long
getStartIndex()
long
getTotalMatches()
Returns the total number of matches or the total as far as it is known.boolean
hasMore()
Returns whether there are more matches than given bygetTotalMatches()
.
-
-
-
Method Detail
-
getTotalMatches
long getTotalMatches()
Returns the total number of matches or the total as far as it is known. This depends on the query, i.e. it might just retrieve the minimum necessary up togetStartIndex()
+getHitsPerPage()
. CheckhasMore()
to see if there are more matches.- Returns:
- the total number of matches.
-
hasMore
boolean hasMore()
Returns whether there are more matches than given bygetTotalMatches()
.- Returns:
- whether there are more matches than given by
getTotalMatches()
-
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).
-
getNodes
java.util.Iterator<Node> getNodes()
- Returns:
- the same list as
getHits()
but directly with the underlying nodes - Since:
- 5.3
-
getResources
java.util.Iterator<Resource> getResources()
- Returns:
- the same list as
getHits()
but returning Resource objects - Since:
- 5.6
-
getResultPages
java.util.List<ResultPage> getResultPages()
- Returns:
- a List of
ResultPage
es to display the navigation through the result pages. It may not return all the pages in the result due to performance concerns. The actual result is dependent on implementation i.e. it may return X previous pages and X next 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
java.lang.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
java.util.Map<java.lang.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
java.lang.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 seegetFilteringPredicates()
.- Returns:
- a string of the query that was created
-
getFilteringPredicates
java.lang.String getFilteringPredicates()
Returns a string with a list of the predicates that were filtering the result set (as opposed to using XPath, seegetQueryStatement()
). 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
-
-