Class ProjectingLuceneTemplate
java.lang.Object
org.springframework.data.gemfire.search.lucene.support.LuceneOperationsSupport
org.springframework.data.gemfire.search.lucene.LuceneAccessor
org.springframework.data.gemfire.search.lucene.support.LuceneAccessorSupport
org.springframework.data.gemfire.search.lucene.LuceneTemplate
org.springframework.data.gemfire.search.lucene.ProjectingLuceneAccessor
org.springframework.data.gemfire.search.lucene.ProjectingLuceneTemplate
- All Implemented Interfaces:
Aware
,BeanClassLoaderAware
,BeanFactoryAware
,InitializingBean
,LuceneOperations
,ProjectingLuceneOperations
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.- Since:
- 1.1.0
- Author:
- John Blum
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.data.gemfire.search.lucene.LuceneAccessor
LuceneAccessor.LuceneQueryExecutor<T>
-
Field Summary
Fields inherited from interface org.springframework.data.gemfire.search.lucene.LuceneOperations
DEFAULT_PAGE_SIZE, DEFAULT_RESULT_LIMIT
-
Constructor Summary
ConstructorDescriptionConstructs a default, uninitialized instance of theProjectingLuceneTemplate
.ProjectingLuceneTemplate
(String indexName, String regionPath) Constructs an instance of theProjectingLuceneTemplate
initialized with the given Lucene index name andRegion
reference upon which Lucene queries are executed.ProjectingLuceneTemplate
(String indexName, Region<?, ?> region) Constructs an instance of theProjectingLuceneTemplate
initialized with the given Lucene index name andRegion
reference upon which Lucene queries are executed.ProjectingLuceneTemplate
(LuceneIndex luceneIndex) Constructs an instance of theProjectingLuceneTemplate
initialized with the givenLuceneIndex
used to perform Lucene queries (searches). -
Method Summary
Modifier and TypeMethodDescription<T> Page<T>
Executes the givenquery
with the limited results projected as instances of theprojectionType
.<T> List<T>
Executes the givenquery
with the limited results projected as instances of theprojectionType
.<T> Page<T>
query
(LuceneQueryProvider queryProvider, int resultLimit, int pageSize, Class<T> projectionType) Executes the providedquery
with the limited results projected as instances of theprojectionType
.<T> List<T>
query
(LuceneQueryProvider queryProvider, int resultLimit, Class<T> projectionType) Executes the providedquery
with the limited results projected as instances of theprojectionType
.Methods inherited from class org.springframework.data.gemfire.search.lucene.ProjectingLuceneAccessor
afterPropertiesSet, getBeanClassLoader, getBeanFactory, getProjectionFactory, project, project, project, resolveProjectionFactory, setBeanClassLoader, setBeanFactory, setProjectionFactory, setThenGetProjectionFactory
Methods inherited from class org.springframework.data.gemfire.search.lucene.LuceneTemplate
query, query, query, query, queryForKeys, queryForKeys, queryForValues, queryForValues
Methods inherited from class org.springframework.data.gemfire.search.lucene.LuceneAccessor
createLuceneQueryFactory, createLuceneQueryFactory, createLuceneQueryFactory, doFind, getCache, getIndexName, getLuceneIndex, getLuceneService, getRegion, getRegionPath, resolveCache, resolveIndexName, resolveLuceneService, resolveLuceneService, resolveRegionPath, setCache, setIndexName, setLuceneIndex, setLuceneService, setRegion, setRegionPath
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.data.gemfire.search.lucene.LuceneOperations
query, query, query, query, query, query, queryForKeys, queryForKeys, queryForKeys, queryForKeys, queryForValues, queryForValues, queryForValues, queryForValues
Methods inherited from interface org.springframework.data.gemfire.search.lucene.ProjectingLuceneOperations
query, query
-
Constructor Details
-
ProjectingLuceneTemplate
public ProjectingLuceneTemplate()Constructs a default, uninitialized instance of theProjectingLuceneTemplate
. -
ProjectingLuceneTemplate
Constructs an instance of theProjectingLuceneTemplate
initialized with the givenLuceneIndex
used to perform Lucene queries (searches).- Parameters:
luceneIndex
-LuceneIndex
used in Lucene queries.- See Also:
-
ProjectingLuceneTemplate
Constructs an instance of theProjectingLuceneTemplate
initialized with the given Lucene index name andRegion
reference upon which Lucene queries are executed.- Parameters:
indexName
-String
containing the name of theLuceneIndex
used in Lucene queries.region
-Region
on which Lucene queries are executed.- See Also:
-
ProjectingLuceneTemplate
Constructs an instance of theProjectingLuceneTemplate
initialized with the given Lucene index name andRegion
reference upon which Lucene queries are executed.- Parameters:
indexName
-String
containing the name of theLuceneIndex
used in Lucene queries.regionPath
-String
containing the name of theRegion
on which Lucene queries are executed.
-
-
Method Details
-
query
public <T> List<T> query(String query, String defaultField, int resultLimit, Class<T> projectionType) Description copied from interface:ProjectingLuceneOperations
Executes the givenquery
with the limited results projected as instances of theprojectionType
.- Type Parameters:
T
-Class
type of the projection.- Parameters:
query
- Lucenequery
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.- Returns:
- a
List
of Lucene query results projected as instances ofprojectionType
. - See Also:
-
query
public <T> Page<T> query(String query, String defaultField, int resultLimit, int pageSize, Class<T> projectionType) Description copied from interface:ProjectingLuceneOperations
Executes the givenquery
with the limited results projected as instances of theprojectionType
.- Type Parameters:
T
-Class
type of the projection.- Parameters:
query
- Lucenequery
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 aPage
.projectionType
-Class
type of the individual elements in the query results.- Returns:
- the first
Page
of results returned from the Lucene query. - See Also:
-
query
public <T> List<T> query(LuceneQueryProvider queryProvider, int resultLimit, Class<T> projectionType) Description copied from interface:ProjectingLuceneOperations
Executes the providedquery
with the limited results projected as instances of theprojectionType
.- Type Parameters:
T
-Class
type of the projection.- Parameters:
queryProvider
-LuceneQueryProvider
providing the Lucenequery
to execute.resultLimit
- limit on the number of query results to return.projectionType
-Class
type of the individual elements in the query results.- Returns:
- a
List
of Lucene query results projected as instances ofprojectionType
. - See Also:
-
query
public <T> Page<T> query(LuceneQueryProvider queryProvider, int resultLimit, int pageSize, Class<T> projectionType) Description copied from interface:ProjectingLuceneOperations
Executes the providedquery
with the limited results projected as instances of theprojectionType
.- Type Parameters:
T
-Class
type of the projection.- Parameters:
queryProvider
-LuceneQueryProvider
providing the Lucenequery
to execute.resultLimit
- limit on the number of query results to return.pageSize
- number of results on aPage
.projectionType
-Class
type of the individual elements in the query results.- Returns:
- the first
Page
of results returned from the Lucene query. - See Also:
-