public class ProjectingLuceneTemplate extends ProjectingLuceneAccessor
ProjectingLuceneTemplate
is a Lucene data access operations class encapsulating functionality
for performing Lucene queries and other Lucene data access operations and returning the query results
as application-specific domain object views.ProjectingLuceneAccessor
,
ProjectingLuceneOperations
,
Region
,
LuceneIndex
,
LuceneQuery
,
LuceneQueryFactory
,
LuceneQueryProvider
,
LuceneResultStruct
,
PageableLuceneQueryResults
LuceneAccessor.LuceneQueryExecutor<T>
DEFAULT_PAGE_SIZE, DEFAULT_RESULT_LIMIT
Constructor and Description |
---|
ProjectingLuceneTemplate()
Constructs a default, uninitialized instance of the
ProjectingLuceneTemplate . |
ProjectingLuceneTemplate(org.apache.geode.cache.lucene.LuceneIndex luceneIndex)
Constructs an instance of the
ProjectingLuceneTemplate initialized with the given LuceneIndex
used to perform Lucene queries (searches). |
ProjectingLuceneTemplate(String indexName,
org.apache.geode.cache.Region<?,?> region)
Constructs an instance of the
ProjectingLuceneTemplate initialized with the given Lucene index name
and Region reference upon which Lucene queries are executed. |
ProjectingLuceneTemplate(String indexName,
String regionPath)
Constructs an instance of the
ProjectingLuceneTemplate initialized with the given Lucene index name
and Region reference upon which Lucene queries are executed. |
Modifier and Type | Method and Description |
---|---|
<T> List<T> |
query(org.apache.geode.cache.lucene.LuceneQueryProvider queryProvider,
int resultLimit,
Class<T> projectionType)
Executes the provided
query with the limited results projected as instances of
the projectionType . |
<T> org.springframework.data.domain.Page<T> |
query(org.apache.geode.cache.lucene.LuceneQueryProvider queryProvider,
int resultLimit,
int pageSize,
Class<T> projectionType)
Executes the provided
query with the limited results projected as instances of
the projectionType . |
<T> List<T> |
query(String query,
String defaultField,
int resultLimit,
Class<T> projectionType)
Executes the given
query with the limited results projected as instances of
the projectionType . |
<T> org.springframework.data.domain.Page<T> |
query(String query,
String defaultField,
int resultLimit,
int pageSize,
Class<T> projectionType)
Executes the given
query with the limited results projected as instances of
the projectionType . |
afterPropertiesSet, getBeanClassLoader, getBeanFactory, getProjectionFactory, project, project, project, resolveProjectionFactory, setBeanClassLoader, setBeanFactory, setProjectionFactory, setThenGetProjectionFactory
query, query, query, query, queryForKeys, queryForKeys, queryForValues, queryForValues
createLuceneQueryFactory, createLuceneQueryFactory, createLuceneQueryFactory, doFind, getCache, getIndexName, getLuceneIndex, getLuceneService, getRegion, getRegionPath, resolveCache, resolveIndexName, resolveLuceneService, resolveLuceneService, resolveRegionPath, setCache, setIndexName, setLuceneIndex, setLuceneService, setRegion, setRegionPath
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
query, query
query, query, query, query, query, query, queryForKeys, queryForKeys, queryForKeys, queryForKeys, queryForValues, queryForValues, queryForValues, queryForValues
public ProjectingLuceneTemplate()
ProjectingLuceneTemplate
.public ProjectingLuceneTemplate(org.apache.geode.cache.lucene.LuceneIndex luceneIndex)
ProjectingLuceneTemplate
initialized with the given LuceneIndex
used to perform Lucene queries (searches).luceneIndex
- LuceneIndex
used in Lucene queries.LuceneIndex
public ProjectingLuceneTemplate(String indexName, org.apache.geode.cache.Region<?,?> region)
ProjectingLuceneTemplate
initialized with the given Lucene index name
and Region
reference upon which Lucene queries are executed.indexName
- String
containing the name of the LuceneIndex
used in Lucene queries.region
- Region
on which Lucene queries are executed.Region
public ProjectingLuceneTemplate(String indexName, String regionPath)
ProjectingLuceneTemplate
initialized with the given Lucene index name
and Region
reference upon which Lucene queries are executed.public <T> List<T> query(String query, String defaultField, int resultLimit, Class<T> projectionType)
ProjectingLuceneOperations
query
with the limited results projected as instances of
the projectionType
.T
- Class
type of the projection.query
- 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.projectionType
- Class
type of the individual elements in the query results.List
of Lucene query results projected as instances of projectionType
.ProjectingLuceneOperations.query(String, String, int, Class)
,
List
public <T> org.springframework.data.domain.Page<T> query(String query, String defaultField, int resultLimit, int pageSize, Class<T> projectionType)
ProjectingLuceneOperations
query
with the limited results projected as instances of
the projectionType
.T
- Class
type of the projection.query
- 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 on a Page
.projectionType
- Class
type of the individual elements in the query results.Page
of results returned from the Lucene query.Page
public <T> List<T> query(org.apache.geode.cache.lucene.LuceneQueryProvider queryProvider, int resultLimit, Class<T> projectionType)
ProjectingLuceneOperations
query
with the limited results projected as instances of
the projectionType
.T
- Class
type of the projection.queryProvider
- LuceneQueryProvider
providing the Lucene query
to execute.resultLimit
- limit on the number of query results to return.projectionType
- Class
type of the individual elements in the query results.List
of Lucene query results projected as instances of projectionType
.LuceneQueryProvider
,
List
public <T> org.springframework.data.domain.Page<T> query(org.apache.geode.cache.lucene.LuceneQueryProvider queryProvider, int resultLimit, int pageSize, Class<T> projectionType)
ProjectingLuceneOperations
query
with the limited results projected as instances of
the projectionType
.T
- Class
type of the projection.queryProvider
- LuceneQueryProvider
providing the Lucene query
to execute.resultLimit
- limit on the number of query results to return.pageSize
- number of results on a Page
.projectionType
- Class
type of the individual elements in the query results.Page
of results returned from the Lucene query.LuceneQueryProvider
,
Page
Copyright © 2011–2023 Pivotal Software, Inc.. All rights reserved.