public interface LuceneQuery<K,V>
A query on a Lucene index. Instances of this interface are created using
LuceneQueryFactory.create(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
. Once this query is constructed, use one of the find methods to
find region entries that match this query.
Instances obtained from LuceneQueryFactory
are immutable, so they are safe for reuse and
can be shared by multiple threads.
Because Lucene indexes are maintained asynchronously, results returned from the find methods may not reflect the most recent updates to the region.
Results are returned in order of their score with respect to this query.
Modifier and Type | Method and Description |
---|---|
Collection<K> |
findKeys()
Execute the query and return the region keys that match this query, up to the limit specified
by
getLimit() . |
PageableLuceneQueryResults<K,V> |
findPages()
Execute the query and get a
PageableLuceneQueryResults . |
List<LuceneResultStruct<K,V>> |
findResults()
Execute the query and return a list of
LuceneResultStruct s that match this query, up to
the limit specified by getLimit() A LuceneResultStruct contains the region
key, value, and a score for that entry. |
Collection<V> |
findValues()
Execute the query and return the region values that match this query, up to the limit specified
by
getLimit() |
int |
getLimit()
Get limit size setting of current query.
|
int |
getPageSize()
Gets the page size setting of current query.
|
Collection<K> findKeys() throws LuceneQueryException
getLimit()
.LuceneQueryException
- if the query could not be parsed or executed.CacheClosedException
- if the cache was closed while the Lucene query was being executed.FunctionException
- if the function execution mechanism encounters an error while
executing the Lucene query.PartitionOfflineException
- if the node containing the buckets required to execute the
Lucene query goes offline.CancelException
- if a cancel is in progress while the Lucene query was being executed.Collection<V> findValues() throws LuceneQueryException
getLimit()
LuceneQueryException
- if the query could not be parsed or executed.CacheClosedException
- if the cache was closed while the Lucene query was being executed.FunctionException
- if the function execution mechanism encounters an error while
executing the Lucene query.PartitionOfflineException
- if the node containing the buckets required to execute the
Lucene query goes offline.CancelException
- if a cancel is in progress while the Lucene query was being executed.List<LuceneResultStruct<K,V>> findResults() throws LuceneQueryException
LuceneResultStruct
s that match this query, up to
the limit specified by getLimit()
A LuceneResultStruct
contains the region
key, value, and a score for that entry.LuceneQueryException
- if the query could not be parsed or executed.CacheClosedException
- if the cache was closed while the Lucene query was being executed.FunctionException
- if the function execution mechanism encounters an error while
executing the Lucene query.PartitionOfflineException
- if the node containing the buckets required to execute the
Lucene query goes offline.CancelException
- if a cancel is in progress while the Lucene query was being executed.PageableLuceneQueryResults<K,V> findPages() throws LuceneQueryException
PageableLuceneQueryResults
. The
PageableLuceneQueryResults
provides the ability to fetch a page of results at a time,
as specified by getPageSize()
LuceneQueryException
- if the query could not be parsed or executed.CacheClosedException
- if the cache was closed while the Lucene query was being executed.FunctionException
- if the function execution mechanism encounters an error while
executing the Lucene query.PartitionOfflineException
- if the node containing the buckets required to execute the
Lucene query goes offline.CancelException
- if a cancel is in progress while the Lucene query was being executed.int getPageSize()
LuceneQueryImpl
objectint getLimit()
LuceneQueryImpl
object