public class LuceneQueryEngine extends QueryEngine
QueryEngine
that uses Lucene for answering queries. Each repository uses a single LuceneQueryEngine
instance,
and all sessions share the same engine. Therefore, this engine is threadsafe (and actually immutable), creating objects for
each submitted query
.Modifier and Type | Class and Description |
---|---|
protected static class |
LuceneQueryEngine.LuceneAccessQuery
The component that is created to represent a single access query and, when executed, transforms that access query into a
single Lucene query and issues it against Lucene.
|
protected static class |
LuceneQueryEngine.LuceneQueryProcessor
The
QueryProcessor implementation used by this LuceneQueryEngine . |
static class |
LuceneQueryEngine.TupleCollector |
Modifier and Type | Field and Description |
---|---|
protected static Logger |
LOGGER |
optimizer, planner, processor
Constructor and Description |
---|
LuceneQueryEngine(ExecutionContext context,
String repositoryName,
Planner planner,
Optimizer optimizer,
org.hibernate.search.engine.spi.SearchFactoryImplementor searchFactory,
org.apache.lucene.util.Version version,
boolean enableFullTextSearch) |
Modifier and Type | Method and Description |
---|---|
org.hibernate.search.indexes.impl.IndexManagerHolder |
getAllIndexesManager()
Returns the global index manager.
|
QueryIndexing |
getQueryIndexing()
Get the interface for updating the indexes.
|
CancellableQuery |
query(ExecutionContext context,
RepositoryCache repositoryCache,
Set<String> workspaceNames,
Map<String,NodeCache> overriddenNodeCachesByWorkspaceName,
QueryCommand query,
Schemata schemata,
PlanHints hints,
Map<String,Object> variables)
Execute the supplied query against the named workspace, using the supplied hints, schemata and variables.
|
void |
shutdown()
Shuts down the query engine
|
determineQueryResultColumns, execute
protected static final Logger LOGGER
public LuceneQueryEngine(ExecutionContext context, String repositoryName, Planner planner, Optimizer optimizer, org.hibernate.search.engine.spi.SearchFactoryImplementor searchFactory, org.apache.lucene.util.Version version, boolean enableFullTextSearch)
context
- the execution context for the repositoryrepositoryName
- the name of the repositoryplanner
- the planner that should be usedoptimizer
- the optimizer that should be usedsearchFactory
- the search factory for accessing the indexesversion
- the Lucene version used by the indexesenableFullTextSearch
- true if full-text searching is enabled, or false otherwisepublic void shutdown()
public org.hibernate.search.indexes.impl.IndexManagerHolder getAllIndexesManager()
IndexManagerHolder
instance.public QueryIndexing getQueryIndexing()
public CancellableQuery query(ExecutionContext context, RepositoryCache repositoryCache, Set<String> workspaceNames, Map<String,NodeCache> overriddenNodeCachesByWorkspaceName, QueryCommand query, Schemata schemata, PlanHints hints, Map<String,Object> variables) throws InvalidQueryException
context
- the context in which the query is being executed; may not be nullrepositoryCache
- the repository cache that should be used to load results; may not be nullworkspaceNames
- the name of each workspace to be queried, or an empty set if all the workspaces should be queried;
may not be nulloverriddenNodeCachesByWorkspaceName
- the NodeCache instances that should be used to load results, which will be used
instead of the RepositoryCache's NodeCache for a given workspace name; may be null or emptyquery
- the queryschemata
- the schemata information that should be used for all processing of this queryhints
- the hintsvariables
- the variablesInvalidQueryException
- if theCopyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.