|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.jcr.query.lucene.LuceneQueryFactory
@NotThreadSafe public abstract class LuceneQueryFactory
The factory that creates a Lucene Query
object from a Query Object Model Constraint
object.
Field Summary | |
---|---|
protected QueryContext |
context
|
protected ValueFactories |
factories
|
protected NameFactory |
nameFactory
|
protected PathFactory |
pathFactory
|
protected org.hibernate.search.SearchFactory |
searchFactory
|
protected ValueFactory<String> |
stringFactory
|
protected org.apache.lucene.util.Version |
version
|
Constructor Summary | |
---|---|
protected |
LuceneQueryFactory(QueryContext context,
org.hibernate.search.SearchFactory searchFactory,
org.apache.lucene.util.Version version)
|
Method Summary | |
---|---|
Object |
createOperand(SelectorName selectorName,
StaticOperand operand,
CaseOperations.CaseOperation caseOperation)
|
org.apache.lucene.search.Query |
createQuery(SelectorName selectorName,
Constraint constraint)
Create a Lucene Query that represents the supplied Query Object Model Constraint . |
org.apache.lucene.search.Query |
createQuery(SelectorName selectorName,
DynamicOperand left,
Operator operator,
StaticOperand right)
|
protected org.apache.lucene.search.Query |
createQuery(SelectorName selectorName,
DynamicOperand left,
Operator operator,
StaticOperand right,
CaseOperations.CaseOperation caseOperation)
Create a comparison query |
org.apache.lucene.search.Query |
createQuery(SelectorName selectorName,
DynamicOperand left,
StaticOperand lower,
StaticOperand upper,
boolean includesLower,
boolean includesUpper,
CaseOperations.CaseOperation caseOperation)
|
org.apache.lucene.search.Query |
createQuery(SelectorName selectorName,
PropertyExistence existence)
|
org.apache.lucene.search.Query |
createQuery(SelectorName selectorName,
String fieldName,
FullTextSearch.Term term)
|
protected String |
fieldNameFor(String name)
|
protected abstract org.apache.lucene.search.Query |
findAllNodesAtOrBelow(Path ancestorPath)
Return a query that will find all documents representing nodes at or below the supplied path. |
protected abstract org.apache.lucene.search.Query |
findAllNodesBelow(Path ancestorPath)
Return a query that will find all documents representing nodes below the supplied path. |
protected abstract org.apache.lucene.search.Query |
findChildNodes(Path parentPath)
Return a query that can be used to find all of the documents that represent nodes that are children of the node at the supplied path. |
protected abstract org.apache.lucene.search.Query |
findNodeAt(Path path)
Create a query that can be used to find the one document (or node) that exists at the exact path supplied. |
protected abstract org.apache.lucene.search.Query |
findNodesLike(SelectorName selectorName,
String fieldName,
String likeExpression,
CaseOperations.CaseOperation caseOperation)
Construct a Query implementation that scores documents with a string field value that is LIKE the supplied
constraint value, where the LIKE expression contains the SQL wildcard characters '%' and '_' or the regular expression
wildcard characters '*' and '?'. |
protected abstract org.apache.lucene.search.Query |
findNodesWith(SelectorName selectorName,
Length propertyLength,
Operator operator,
Object value)
Create a query that finds documents with fields whose lengths fit the supplied operator/value criteria. |
protected abstract org.apache.lucene.search.Query |
findNodesWith(SelectorName selectorName,
NodeDepth depthConstraint,
Operator operator,
Object value)
|
protected abstract org.apache.lucene.search.Query |
findNodesWith(SelectorName selectorName,
NodeLocalName nodeName,
Operator operator,
Object value,
CaseOperations.CaseOperation caseOperation)
|
protected abstract org.apache.lucene.search.Query |
findNodesWith(SelectorName selectorName,
NodeName nodeName,
Operator operator,
Object value,
CaseOperations.CaseOperation caseOperation)
|
protected abstract org.apache.lucene.search.Query |
findNodesWith(SelectorName selectorName,
NodePath nodePath,
Operator operator,
Object value,
CaseOperations.CaseOperation caseOperation)
|
protected abstract org.apache.lucene.search.Query |
findNodesWith(SelectorName selectorName,
PropertyValue propertyValue,
Operator operator,
Object value,
CaseOperations.CaseOperation caseOperation)
Create a query that finds documents with fields whose values fit the supplied operator/value criteria. |
protected abstract org.apache.lucene.search.Query |
findNodesWith(SelectorName selectorName,
ReferenceValue referenceValue,
Operator operator,
Object value)
Create a query that finds documents with fields that are references that fit the supplied operator/value criteria. |
protected abstract org.apache.lucene.search.Query |
findNodesWithNumericRange(SelectorName selectorName,
NodeDepth depth,
Object lowerValue,
Object upperValue,
boolean includesLower,
boolean includesUpper)
Create a query that finds documents with fields with depths that are in the supplied range. |
protected abstract org.apache.lucene.search.Query |
findNodesWithNumericRange(SelectorName selectorName,
PropertyValue propertyValue,
Object lowerValue,
Object upperValue,
boolean includesLower,
boolean includesUpper)
Create a query that finds documents with fields with values that are in the supplied range. |
protected abstract String |
fullTextFieldName(String propertyName)
Create the field name that will be used to store the full-text searchable property values. |
protected abstract org.apache.lucene.analysis.Analyzer |
getFullTextSearchAnalyzer()
|
protected Schemata.Column |
getMetadataFor(SelectorName selectorName,
String propertyName)
|
protected org.apache.lucene.search.Query |
not(org.apache.lucene.search.Query notted)
|
protected Schemata |
schemata()
|
protected String |
stringValueFrom(Object value)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final QueryContext context
protected final org.hibernate.search.SearchFactory searchFactory
protected final ValueFactories factories
protected final PathFactory pathFactory
protected final NameFactory nameFactory
protected final ValueFactory<String> stringFactory
protected final org.apache.lucene.util.Version version
Constructor Detail |
---|
protected LuceneQueryFactory(QueryContext context, org.hibernate.search.SearchFactory searchFactory, org.apache.lucene.util.Version version)
Method Detail |
---|
public org.apache.lucene.search.Query createQuery(SelectorName selectorName, Constraint constraint) throws IOException
Query
that represents the supplied Query Object Model Constraint
.
selectorName
- the name of the selector (or node type) being queried; may not be nullconstraint
- the QOM constraint; never null
IOException
- if there is an error creating the querypublic org.apache.lucene.search.Query createQuery(SelectorName selectorName, DynamicOperand left, Operator operator, StaticOperand right) throws IOException
IOException
protected org.apache.lucene.search.Query createQuery(SelectorName selectorName, DynamicOperand left, Operator operator, StaticOperand right, CaseOperations.CaseOperation caseOperation) throws IOException
selectorName
- left
- operator
- right
- caseOperation
- the case operation if known, or null if not known. Normally a non-null value would be required, but in
the case of chained functions such as UPPER(LOWER(...)) we only want to use the first one, so passing null allows us
to easily use the outer one
IOException
public Object createOperand(SelectorName selectorName, StaticOperand operand, CaseOperations.CaseOperation caseOperation)
public org.apache.lucene.search.Query createQuery(SelectorName selectorName, DynamicOperand left, StaticOperand lower, StaticOperand upper, boolean includesLower, boolean includesUpper, CaseOperations.CaseOperation caseOperation) throws IOException
IOException
protected String stringValueFrom(Object value)
public org.apache.lucene.search.Query createQuery(SelectorName selectorName, PropertyExistence existence)
public org.apache.lucene.search.Query createQuery(SelectorName selectorName, String fieldName, FullTextSearch.Term term) throws IOException
IOException
protected org.apache.lucene.search.Query not(org.apache.lucene.search.Query notted)
protected String fieldNameFor(String name)
protected abstract String fullTextFieldName(String propertyName)
propertyName
- the name of the property; may not null
protected abstract org.apache.lucene.analysis.Analyzer getFullTextSearchAnalyzer()
protected abstract org.apache.lucene.search.Query findAllNodesBelow(Path ancestorPath) throws IOException
ancestorPath
- the path of the ancestor node; never null
IOException
- if there is an error creating the queryprotected abstract org.apache.lucene.search.Query findAllNodesAtOrBelow(Path ancestorPath) throws IOException
ancestorPath
- the path of the ancestor node; never null
IOException
- if there is an error creating the queryprotected abstract org.apache.lucene.search.Query findChildNodes(Path parentPath) throws IOException
parentPath
- the path of the parent node.
IOException
- if there is an error creating the queryprotected abstract org.apache.lucene.search.Query findNodeAt(Path path) throws IOException
path
- the path of the node
IOException
- if there is an error creating the queryprotected abstract org.apache.lucene.search.Query findNodesLike(SelectorName selectorName, String fieldName, String likeExpression, CaseOperations.CaseOperation caseOperation)
Query
implementation that scores documents with a string field value that is LIKE the supplied
constraint value, where the LIKE expression contains the SQL wildcard characters '%' and '_' or the regular expression
wildcard characters '*' and '?'.
selectorName
- the name of the selector (or node type) being queried; may not be nullfieldName
- the name of the document field to searchlikeExpression
- the JCR like expressioncaseOperation
- the operation that should be performed on the indexed string before being used; may not be null
protected abstract org.apache.lucene.search.Query findNodesWith(SelectorName selectorName, Length propertyLength, Operator operator, Object value) throws IOException
selectorName
- the name of the selector (or node type) being queried; may not be nullpropertyLength
- the property specificationoperator
- the comparison operatorvalue
- the length value
IOException
- if there is an error creating the queryprotected abstract org.apache.lucene.search.Query findNodesWith(SelectorName selectorName, PropertyValue propertyValue, Operator operator, Object value, CaseOperations.CaseOperation caseOperation) throws IOException
selectorName
- the name of the selector (or node type) being queried; may not be nullpropertyValue
- the property specificationoperator
- the comparison operatorvalue
- the valuecaseOperation
- the operation that should be used against the string values in the indexes before applying the
criteria, or null if the operation is not known
IOException
- if there is an error creating the queryprotected abstract org.apache.lucene.search.Query findNodesWith(SelectorName selectorName, ReferenceValue referenceValue, Operator operator, Object value) throws IOException
selectorName
- the name of the selector (or node type) being queried; may not be nullreferenceValue
- the property specificationoperator
- the comparison operatorvalue
- the reference value
IOException
- if there is an error creating the queryprotected abstract org.apache.lucene.search.Query findNodesWithNumericRange(SelectorName selectorName, PropertyValue propertyValue, Object lowerValue, Object upperValue, boolean includesLower, boolean includesUpper) throws IOException
selectorName
- the name of the selector (or node type) being queried; may not be nullpropertyValue
- the property specificationlowerValue
- the lower valueupperValue
- the upper valueincludesLower
- true if the range should include the lower value, or false if the lower value should be excludedincludesUpper
- true if the range should include the upper value, or false if the upper value should be excluded
IOException
- if there is an error creating the queryprotected abstract org.apache.lucene.search.Query findNodesWithNumericRange(SelectorName selectorName, NodeDepth depth, Object lowerValue, Object upperValue, boolean includesLower, boolean includesUpper) throws IOException
selectorName
- the name of the selector (or node type) being queried; may not be nulldepth
- the property specificationlowerValue
- the lower valueupperValue
- the upper valueincludesLower
- true if the range should include the lower value, or false if the lower value should be excludedincludesUpper
- true if the range should include the upper value, or false if the upper value should be excluded
IOException
- if there is an error creating the queryprotected abstract org.apache.lucene.search.Query findNodesWith(SelectorName selectorName, NodePath nodePath, Operator operator, Object value, CaseOperations.CaseOperation caseOperation) throws IOException
IOException
protected abstract org.apache.lucene.search.Query findNodesWith(SelectorName selectorName, NodeName nodeName, Operator operator, Object value, CaseOperations.CaseOperation caseOperation) throws IOException
IOException
protected abstract org.apache.lucene.search.Query findNodesWith(SelectorName selectorName, NodeLocalName nodeName, Operator operator, Object value, CaseOperations.CaseOperation caseOperation) throws IOException
IOException
protected abstract org.apache.lucene.search.Query findNodesWith(SelectorName selectorName, NodeDepth depthConstraint, Operator operator, Object value) throws IOException
IOException
protected Schemata schemata()
protected Schemata.Column getMetadataFor(SelectorName selectorName, String propertyName)
|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |