Class LuceneQueryBuilder
- java.lang.Object
-
- org.apache.jackrabbit.core.query.lucene.LuceneQueryBuilder
-
- All Implemented Interfaces:
QueryNodeVisitor
public class LuceneQueryBuilder extends Object implements QueryNodeVisitor
Implements a query builder that takes an abstract query tree and creates a luceneQuery
tree that can be executed on an index. todo introduce a node type hierarchy for efficient translation of NodeTypeQueryNode
-
-
Method Summary
-
-
-
Method Detail
-
createQuery
public static Query createQuery(QueryRootNode root, SessionImpl session, ItemStateManager sharedItemMgr, NamespaceMappings nsMappings, Analyzer analyzer, PropertyTypeRegistry propReg, SynonymProvider synonymProvider, IndexFormatVersion indexFormatVersion, org.apache.jackrabbit.core.query.lucene.PerQueryCache cache) throws RepositoryException
Creates a luceneQuery
tree from an abstract query tree.- Parameters:
root
- the root node of the abstract query tree.session
- of the user executing the query.sharedItemMgr
- the shared item state manager of the workspace.nsMappings
- namespace resolver for internal prefixes.analyzer
- for parsing the query statement of the contains function.propReg
- the property type registry to lookup type information.synonymProvider
- the synonym provider ornull
if node is configured.indexFormatVersion
- the index format version to be used- Returns:
- the lucene query tree.
- Throws:
RepositoryException
- if an error occurs during the translation.
-
visit
public Object visit(QueryRootNode node, Object data) throws RepositoryException
- Specified by:
visit
in interfaceQueryNodeVisitor
- Throws:
RepositoryException
-
visit
public Object visit(OrQueryNode node, Object data) throws RepositoryException
- Specified by:
visit
in interfaceQueryNodeVisitor
- Throws:
RepositoryException
-
visit
public Object visit(AndQueryNode node, Object data) throws RepositoryException
- Specified by:
visit
in interfaceQueryNodeVisitor
- Throws:
RepositoryException
-
visit
public Object visit(NotQueryNode node, Object data) throws RepositoryException
- Specified by:
visit
in interfaceQueryNodeVisitor
- Throws:
RepositoryException
-
visit
public Object visit(ExactQueryNode node, Object data)
- Specified by:
visit
in interfaceQueryNodeVisitor
-
visit
public Object visit(NodeTypeQueryNode node, Object data)
- Specified by:
visit
in interfaceQueryNodeVisitor
-
visit
public Object visit(TextsearchQueryNode node, Object data)
- Specified by:
visit
in interfaceQueryNodeVisitor
-
visit
public Object visit(PathQueryNode node, Object data) throws RepositoryException
- Specified by:
visit
in interfaceQueryNodeVisitor
- Throws:
RepositoryException
-
visit
public Object visit(LocationStepQueryNode node, Object data) throws RepositoryException
- Specified by:
visit
in interfaceQueryNodeVisitor
- Throws:
RepositoryException
-
visit
public Object visit(DerefQueryNode node, Object data) throws RepositoryException
- Specified by:
visit
in interfaceQueryNodeVisitor
- Throws:
RepositoryException
-
visit
public Object visit(RelationQueryNode node, Object data) throws RepositoryException
- Specified by:
visit
in interfaceQueryNodeVisitor
- Throws:
RepositoryException
-
createPredicateDeref
public Query createPredicateDeref(Query subQuery, DerefQueryNode node, Object data) throws RepositoryException
- Throws:
RepositoryException
-
visit
public Object visit(OrderQueryNode node, Object data)
- Specified by:
visit
in interfaceQueryNodeVisitor
-
visit
public Object visit(PropertyFunctionQueryNode node, Object data)
- Specified by:
visit
in interfaceQueryNodeVisitor
-
-