public abstract class QueryResultImpl extends Object implements JackrabbitQueryResult
QueryResult
interface.Modifier and Type | Field and Description |
---|---|
protected Map<String,ColumnImpl> |
columns
The columns to select.
|
protected boolean |
docOrder
If
true nodes are returned in document order. |
protected SearchIndex |
index
The search index to execute the query.
|
protected AbstractQueryImpl |
queryImpl
The query instance which created this query result.
|
protected SessionContext |
sessionContext
Component context of the current session
|
protected org.apache.jackrabbit.core.query.lucene.SpellSuggestion |
spellSuggestion
The spell suggestion or
null if not available. |
Constructor and Description |
---|
QueryResultImpl(SearchIndex index,
SessionContext sessionContext,
AbstractQueryImpl queryImpl,
org.apache.jackrabbit.core.query.lucene.SpellSuggestion spellSuggestion,
ColumnImpl[] columns,
boolean documentOrder,
long offset,
long limit)
Creates a new query result.
|
Modifier and Type | Method and Description |
---|---|
protected abstract ExcerptProvider |
createExcerptProvider()
Creates an excerpt provider for this result set.
|
protected abstract MultiColumnQueryHits |
executeQuery(long resultFetchHint)
Executes the query for this result and returns hits.
|
String[] |
getColumnNames() |
NodeIterator |
getNodes() |
protected void |
getResults(long size)
Attempts to get
size results and puts them into resultNodes . |
RowIterator |
getRows() |
String[] |
getSelectorNames() |
int |
getTotalSize()
Returns the total number of hits.
|
protected boolean |
isAccessGranted(ScoreNode[] nodes)
Checks if access is granted to all
nodes . |
protected final SearchIndex index
protected final SessionContext sessionContext
protected final AbstractQueryImpl queryImpl
protected final org.apache.jackrabbit.core.query.lucene.SpellSuggestion spellSuggestion
null
if not available.protected final Map<String,ColumnImpl> columns
protected final boolean docOrder
true
nodes are returned in document order.public QueryResultImpl(SearchIndex index, SessionContext sessionContext, AbstractQueryImpl queryImpl, org.apache.jackrabbit.core.query.lucene.SpellSuggestion spellSuggestion, ColumnImpl[] columns, boolean documentOrder, long offset, long limit) throws RepositoryException
getResults(long)
after this constructor had been called.index
- the search index where the query is executed.sessionContext
- component context of the current sessionqueryImpl
- the query instance which created this query
result.spellSuggestion
- the spell suggestion or null
if none
is available.columns
- the select properties of the query.documentOrder
- if true
the result is returned in
document order.limit
- the maximum result sizeoffset
- the offset in the total result setRepositoryException
- if an error occurs while reading from the
repository.IllegalArgumentException
- if any of the columns does not have a
column name.public String[] getSelectorNames() throws RepositoryException
getSelectorNames
in interface QueryResult
RepositoryException
public String[] getColumnNames() throws RepositoryException
getColumnNames
in interface QueryResult
RepositoryException
public NodeIterator getNodes() throws RepositoryException
getNodes
in interface QueryResult
RepositoryException
public RowIterator getRows() throws RepositoryException
getRows
in interface QueryResult
RepositoryException
protected abstract MultiColumnQueryHits executeQuery(long resultFetchHint) throws IOException
resultFetchHint
- a hint on how many results should be fetched.IOException
- if an error occurs while executing the query.protected abstract ExcerptProvider createExcerptProvider() throws IOException
IOException
- if an error occurs.protected void getResults(long size) throws RepositoryException
size
results and puts them into resultNodes
. If the size of resultNodes
is less than
size
then there are no more than resultNodes.size()
results for this query.size
- the number of results to fetch for the query.RepositoryException
- if an error occurs while executing the
query.protected boolean isAccessGranted(ScoreNode[] nodes) throws RepositoryException
nodes
.nodes
- the nodes to check.true
if read access is granted to all
nodes
.RepositoryException
- if an error occurs while checking access
rights.public int getTotalSize()
-1
if the total size is unknown.
If the "sizeEstimate" options is enabled: Keep in mind that this number may get smaller if nodes are found in the result set which the current session has no permission to access. This might be a security problem.
getTotalSize
in interface JackrabbitQueryResult
Copyright © 2004–2022 The Apache Software Foundation. All rights reserved.