public class HstQueryResultImpl extends Object implements HstQueryResult
Constructor and Description |
---|
HstQueryResultImpl(ObjectConverter objectConverter,
javax.jcr.query.QueryResult queryResult) |
Modifier and Type | Method and Description |
---|---|
HippoBeanIterator |
getHippoBeans()
This returns a HippoBeanIterator, which is a lazy loading proxy for accessing the beans in the HstQueryResult.
|
int |
getSize()
Returns the total number of hits.
|
int |
getTotalSize()
Returns the total number of hits.
|
public HstQueryResultImpl(ObjectConverter objectConverter, javax.jcr.query.QueryResult queryResult)
public HippoBeanIterator getHippoBeans()
HstQueryResult
HippoBeanIterator.nextHippoBean()
or Iterator.next()
getHippoBeans
in interface HstQueryResult
public int getTotalSize()
HstQueryResult
Returns the total number of hits. This is the total size of hits, even if a HstQuery.setLimit(int)
was used that was smaller.
This is different then HstQueryResult.getSize()
. Also this method does not imply that every hit needs to be authorized. Hence, this call
is much more efficient than HstQueryResult.getSize()
.
The HstQueryResult.getTotalSize()
will return the correct authorized size once we have tackled this in the Repository, see HREPTWO-619
getTotalSize
in interface HstQueryResult
HstQueryResult.getSize()
public int getSize()
HstQueryResult
Returns the total number of hits. A hit from a HstQuery is always a single hit. If the hit matches the search criteria multiple times, it still results as a single hit.
Note that when a limit is set on the query, for example through HstQuery.setLimit(int)
, then this method will never
give a higher value then this limit. If you need the total hit number you can use HstQueryResult.getTotalSize()
. You can better not
set the limit to Integer.MAX_VALUE
to get the actual total hits, as this means all hits need to be
authorized. In that case, HstQueryResult.getTotalSize()
if much faster as it does not authorize the hits.
The HstQueryResult.getTotalSize()
will return the correct authorized size once we have tackled this in the Repository, see HREPTWO-619
getSize
in interface HstQueryResult
HstQueryResult.getTotalSize()
Copyright © 2008–2016 Hippo B.V. (http://www.onehippo.com). All rights reserved.