public class LuceneTemplate extends LuceneAccessorSupport implements LuceneOperations
LuceneTemplate is a Lucene data access operations class encapsulating functionality
for performing Lucene queries and other Lucene data access operations.LuceneAccessor,
LuceneOperations,
LuceneAccessorSupport,
Region,
LuceneIndex,
LuceneQuery,
LuceneQueryFactory,
LuceneQueryProvider,
LuceneResultStruct,
PageableLuceneQueryResultsLuceneAccessor.LuceneQueryExecutor<T>DEFAULT_PAGE_SIZE, DEFAULT_RESULT_LIMIT| Constructor and Description |
|---|
LuceneTemplate()
Constructs an uninitialized instance of
LuceneTemplate. |
LuceneTemplate(org.apache.geode.cache.lucene.LuceneIndex luceneIndex)
Constructs an instance of
LuceneTemplate initialized with the given LuceneIndex. |
LuceneTemplate(String indexName,
org.apache.geode.cache.Region<?,?> region)
|
LuceneTemplate(String indexName,
String regionPath)
Constructs an instance of
LuceneTemplate initialized with the given Lucene index name
and fully-qualified Region path. |
| Modifier and Type | Method and Description |
|---|---|
<K,V> List<org.apache.geode.cache.lucene.LuceneResultStruct<K,V>> |
query(org.apache.geode.cache.lucene.LuceneQueryProvider queryProvider,
int resultLimit)
Executes the given Lucene
query with a limit on the number of results returned. |
<K,V> org.apache.geode.cache.lucene.PageableLuceneQueryResults<K,V> |
query(org.apache.geode.cache.lucene.LuceneQueryProvider queryProvider,
int resultLimit,
int pageSize)
Executes the given Lucene
query with a limit on the number of results returned
along with a page size for paging. |
<K,V> List<org.apache.geode.cache.lucene.LuceneResultStruct<K,V>> |
query(String query,
String defaultField,
int resultLimit)
Executes the given Lucene
query with a limit on the number of results returned. |
<K,V> org.apache.geode.cache.lucene.PageableLuceneQueryResults<K,V> |
query(String query,
String defaultField,
int resultLimit,
int pageSize)
Executes the given Lucene
query with a limit on the number of results returned
along with a page size for paging. |
<K> Collection<K> |
queryForKeys(org.apache.geode.cache.lucene.LuceneQueryProvider queryProvider,
int resultLimit)
Executes the given Lucene
query returning a Collection of keys
matching the query clause/predicate with a limit on the number of keys returned. |
<K> Collection<K> |
queryForKeys(String query,
String defaultField,
int resultLimit)
Executes the given Lucene
query returning a Collection of keys
matching the query clause/predicate with a limit on the number of keys returned. |
<V> Collection<V> |
queryForValues(org.apache.geode.cache.lucene.LuceneQueryProvider queryProvider,
int resultLimit)
Executes the given Lucene
query returning a Collection of values
matching the query clause/predicate. |
<V> Collection<V> |
queryForValues(String query,
String defaultField,
int resultLimit)
Executes the given Lucene
query returning a Collection of values
matching the query clause/predicate. |
afterPropertiesSet, createLuceneQueryFactory, createLuceneQueryFactory, createLuceneQueryFactory, doFind, getCache, getIndexName, getLuceneIndex, getLuceneService, getRegion, getRegionPath, resolveCache, resolveIndexName, resolveLuceneService, resolveLuceneService, resolveRegionPath, setCache, setIndexName, setLuceneIndex, setLuceneService, setRegion, setRegionPathclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitquery, query, queryForKeys, queryForKeys, queryForValues, queryForValuespublic LuceneTemplate()
LuceneTemplate.public LuceneTemplate(org.apache.geode.cache.lucene.LuceneIndex luceneIndex)
LuceneTemplate initialized with the given LuceneIndex.luceneIndex - LuceneIndex used in Lucene queries.LuceneIndexpublic LuceneTemplate(String indexName, org.apache.geode.cache.Region<?,?> region)
indexName - String containing the name of the LuceneIndex.region - Region on which the Lucene query is executed.Regionpublic LuceneTemplate(String indexName, String regionPath)
LuceneTemplate initialized with the given Lucene index name
and fully-qualified Region path.public <K,V> List<org.apache.geode.cache.lucene.LuceneResultStruct<K,V>> query(String query, String defaultField, int resultLimit)
LuceneOperationsquery with a limit on the number of results returned.query in interface LuceneOperationsquery in class LuceneAccessorSupportK - Class type of the key.V - Class type of the value.query - String containing the Lucene query to execute.defaultField - String specifying the default field used in Lucene queries when a field
is not explicitly defined in the Lucene query clause.resultLimit - limit on the number of query results to return.List of LuceneResultStruct containing the query results.LuceneResultStruct,
Listpublic <K,V> org.apache.geode.cache.lucene.PageableLuceneQueryResults<K,V> query(String query, String defaultField, int resultLimit, int pageSize)
LuceneOperationsquery with a limit on the number of results returned
along with a page size for paging.query in interface LuceneOperationsquery in class LuceneAccessorSupportK - Class type of the key.V - Class type of the value.query - String containing the Lucene query to execute.defaultField - String specifying the default field used in Lucene queries when a field
is not explicitly defined in the Lucene query clause.resultLimit - limit on the number of query results to return.pageSize - number of results per page.PageableLuceneQueryResults data structure containing the results of the Lucene query.PageableLuceneQueryResultspublic <K,V> List<org.apache.geode.cache.lucene.LuceneResultStruct<K,V>> query(org.apache.geode.cache.lucene.LuceneQueryProvider queryProvider, int resultLimit)
LuceneOperationsquery with a limit on the number of results returned.query in interface LuceneOperationsquery in class LuceneAccessorSupportK - Class type of the key.V - Class type of the value.queryProvider - LuceneQueryProvider is a provider implementation supplying the Lucene query
to execute as well as de/serialize to distribute across the cluster.resultLimit - limit on the number of query results to return.List of LuceneResultStruct containing the query results.LuceneQueryProvider,
LuceneResultStruct,
Listpublic <K,V> org.apache.geode.cache.lucene.PageableLuceneQueryResults<K,V> query(org.apache.geode.cache.lucene.LuceneQueryProvider queryProvider,
int resultLimit,
int pageSize)
LuceneOperationsquery with a limit on the number of results returned
along with a page size for paging.query in interface LuceneOperationsquery in class LuceneAccessorSupportK - Class type of the key.V - Class type of the value.queryProvider - LuceneQueryProvider is a provider implementation supplying the Lucene query
to execute as well as de/serialize to distribute across the cluster.resultLimit - limit on the number of query results to return.pageSize - number of results per page.PageableLuceneQueryResults data structure containing the results of the Lucene query.LuceneQueryProvider,
PageableLuceneQueryResultspublic <K> Collection<K> queryForKeys(String query, String defaultField, int resultLimit)
LuceneOperationsquery returning a Collection of keys
matching the query clause/predicate with a limit on the number of keys returned.queryForKeys in interface LuceneOperationsqueryForKeys in class LuceneAccessorSupportK - Class type of the key.query - String containing the Lucene query to execute.defaultField - String specifying the default field used in Lucene queries when a field
is not explicitly defined in the Lucene query clause.resultLimit - limit on the number of keys returned.Collection of keys matching the Lucene query clause (predicate).LuceneOperations.queryForKeys(String, String, int),
Collectionpublic <K> Collection<K> queryForKeys(org.apache.geode.cache.lucene.LuceneQueryProvider queryProvider, int resultLimit)
LuceneOperationsquery returning a Collection of keys
matching the query clause/predicate with a limit on the number of keys returned.queryForKeys in interface LuceneOperationsqueryForKeys in class LuceneAccessorSupportK - Class type of the key.queryProvider - LuceneQueryProvider is a provider implementation supplying the Lucene query
to execute as well as de/serialize to distribute across the cluster.resultLimit - limit on the number of keys returned.Collection of keys matching the Lucene query clause (predicate).LuceneQueryProvider,
LuceneOperations.queryForKeys(String, String, int),
Collectionpublic <V> Collection<V> queryForValues(String query, String defaultField, int resultLimit)
LuceneOperationsquery returning a Collection of values
matching the query clause/predicate.queryForValues in interface LuceneOperationsqueryForValues in class LuceneAccessorSupportV - Class type of the value.query - String containing the Lucene query to execute.defaultField - String specifying the default field used in Lucene queries when a field
is not explicitly defined in the Lucene query clause.resultLimit - limit on the number of values returned.Collection of values matching Lucene query clause (predicate).LuceneOperations.queryForValues(String, String, int),
Collectionpublic <V> Collection<V> queryForValues(org.apache.geode.cache.lucene.LuceneQueryProvider queryProvider, int resultLimit)
LuceneOperationsquery returning a Collection of values
matching the query clause/predicate.queryForValues in interface LuceneOperationsqueryForValues in class LuceneAccessorSupportV - Class type of the value.queryProvider - LuceneQueryProvider is a provider implementation supplying the Lucene query
to execute as well as de/serialize to distribute across the cluster.resultLimit - limit on the number of values returned.Collection of values matching Lucene query clause (predicate).LuceneQueryProvider,
LuceneOperations.queryForValues(String, String, int),
CollectionCopyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.