public class BasicLuceneQueryFactory extends LuceneQueryFactory
| Modifier and Type | Field and Description |
|---|---|
protected static int |
MAX_DEPTH |
protected static int |
MAX_SNS_INDEX |
protected static int |
MIN_DEPTH |
protected static int |
MIN_SNS_INDEX |
context, factories, nameFactory, pathFactory, searchFactory, stringFactory, version| Constructor and Description |
|---|
BasicLuceneQueryFactory(QueryContext context,
org.hibernate.search.SearchFactory searchFactory,
org.apache.lucene.util.Version version) |
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.lucene.search.Query |
createSnsIndexQuery(String likeExpression)
Utility method to generate a query against the SNS indexes.
|
protected 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 org.apache.lucene.search.Query |
findAllNodesBelow(Path ancestorPath)
Return a query that will find all documents representing nodes below the supplied path.
|
protected 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 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 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 org.apache.lucene.search.Query |
findNodesLike(String fieldName,
String likeExpression,
CaseOperations.CaseOperation caseOperation) |
protected 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 org.apache.lucene.search.Query |
findNodesWith(SelectorName selectorName,
NodeDepth depthConstraint,
Operator operator,
Object value) |
protected org.apache.lucene.search.Query |
findNodesWith(SelectorName selectorName,
NodeLocalName nodeName,
Operator operator,
Object value,
CaseOperations.CaseOperation caseOperation) |
protected org.apache.lucene.search.Query |
findNodesWith(SelectorName selectorName,
NodeName nodeName,
Operator operator,
Object value,
CaseOperations.CaseOperation caseOperation) |
protected org.apache.lucene.search.Query |
findNodesWith(SelectorName selectorName,
NodePath nodePath,
Operator operator,
Object value,
CaseOperations.CaseOperation caseOperation) |
protected 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 org.apache.lucene.search.Query |
findNodesWith(SelectorName selectorName,
PropertyValue propertyValue,
Operator operator,
Object value,
CaseOperations.CaseOperation caseOperation,
PropertyType valueType,
Schemata.Column metadata) |
protected 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 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 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 org.apache.lucene.search.Query |
findNodesWithNumericRange(SelectorName selectorName,
String field,
Object lowerValue,
Object upperValue,
boolean includesLower,
boolean includesUpper) |
protected String |
fullTextFieldName(String propertyName)
Create the field name that will be used to store the full-text searchable property values.
|
protected org.apache.lucene.analysis.Analyzer |
getFullTextSearchAnalyzer() |
protected String |
likeExpresionForWildcardPath(String path) |
protected String |
pathAsString(Path path) |
createOperand, createQuery, createQuery, createQuery, createQuery, createQuery, createQuery, fieldNameFor, getMetadataFor, not, schemata, stringValueFromprotected static final int MIN_DEPTH
protected static final int MAX_DEPTH
protected static final int MIN_SNS_INDEX
protected static final int MAX_SNS_INDEX
public BasicLuceneQueryFactory(QueryContext context, org.hibernate.search.SearchFactory searchFactory, org.apache.lucene.util.Version version)
context - searchFactory - version - the Lucene versionprotected org.apache.lucene.analysis.Analyzer getFullTextSearchAnalyzer()
getFullTextSearchAnalyzer in class LuceneQueryFactoryprotected String fullTextFieldName(String propertyName)
If a property name is provided, then the resulting field name is generated from the
full-text prefix and the property name. Otherwise, the result is the field
name where the full-text terms for the entire node are indexed.
fullTextFieldName in class LuceneQueryFactorypropertyName - the name of the property; may not nullprotected org.apache.lucene.search.Query findAllNodesBelow(Path ancestorPath)
LuceneQueryFactoryfindAllNodesBelow in class LuceneQueryFactoryancestorPath - the path of the ancestor node; never nullprotected org.apache.lucene.search.Query findAllNodesAtOrBelow(Path ancestorPath)
LuceneQueryFactoryfindAllNodesAtOrBelow in class LuceneQueryFactoryancestorPath - the path of the ancestor node; never nullprotected org.apache.lucene.search.Query findChildNodes(Path parentPath)
LuceneQueryFactoryfindChildNodes in class LuceneQueryFactoryparentPath - the path of the parent node.protected org.apache.lucene.search.Query findNodeAt(Path path)
LuceneQueryFactoryfindNodeAt in class LuceneQueryFactorypath - the path of the nodeprotected org.apache.lucene.search.Query findNodesLike(SelectorName selectorName, String fieldName, String likeExpression, CaseOperations.CaseOperation caseOperation)
LuceneQueryFactoryQuery 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 '?'.findNodesLike in class LuceneQueryFactoryselectorName - 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 nullprotected org.apache.lucene.search.Query findNodesLike(String fieldName, String likeExpression, CaseOperations.CaseOperation caseOperation)
protected org.apache.lucene.search.Query findNodesWith(SelectorName selectorName, Length propertyLength, Operator operator, Object value)
LuceneQueryFactoryfindNodesWith in class LuceneQueryFactoryselectorName - the name of the selector (or node type) being queried; may not be nullpropertyLength - the property specificationoperator - the comparison operatorvalue - the length valueprotected org.apache.lucene.search.Query findNodesWith(SelectorName selectorName, PropertyValue propertyValue, Operator operator, Object value, CaseOperations.CaseOperation caseOperation)
LuceneQueryFactoryfindNodesWith in class LuceneQueryFactoryselectorName - 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 knownprotected org.apache.lucene.search.Query findNodesWith(SelectorName selectorName, PropertyValue propertyValue, Operator operator, Object value, CaseOperations.CaseOperation caseOperation, PropertyType valueType, Schemata.Column metadata)
protected org.apache.lucene.search.Query findNodesWith(SelectorName selectorName, ReferenceValue referenceValue, Operator operator, Object value)
LuceneQueryFactoryfindNodesWith in class LuceneQueryFactoryselectorName - the name of the selector (or node type) being queried; may not be nullreferenceValue - the property specificationoperator - the comparison operatorvalue - the reference valueprotected org.apache.lucene.search.Query findNodesWithNumericRange(SelectorName selectorName, PropertyValue propertyValue, Object lowerValue, Object upperValue, boolean includesLower, boolean includesUpper)
LuceneQueryFactoryfindNodesWithNumericRange in class LuceneQueryFactoryselectorName - 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 excludedprotected org.apache.lucene.search.Query findNodesWithNumericRange(SelectorName selectorName, NodeDepth depth, Object lowerValue, Object upperValue, boolean includesLower, boolean includesUpper)
LuceneQueryFactoryfindNodesWithNumericRange in class LuceneQueryFactoryselectorName - 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 excludedprotected org.apache.lucene.search.Query findNodesWithNumericRange(SelectorName selectorName, String field, Object lowerValue, Object upperValue, boolean includesLower, boolean includesUpper)
protected org.apache.lucene.search.Query findNodesWith(SelectorName selectorName, NodePath nodePath, Operator operator, Object value, CaseOperations.CaseOperation caseOperation)
findNodesWith in class LuceneQueryFactoryprotected org.apache.lucene.search.Query findNodesWith(SelectorName selectorName, NodeName nodeName, Operator operator, Object value, CaseOperations.CaseOperation caseOperation)
findNodesWith in class LuceneQueryFactoryprotected org.apache.lucene.search.Query findNodesWith(SelectorName selectorName, NodeLocalName nodeName, Operator operator, Object value, CaseOperations.CaseOperation caseOperation)
findNodesWith in class LuceneQueryFactoryprotected org.apache.lucene.search.Query findNodesWith(SelectorName selectorName, NodeDepth depthConstraint, Operator operator, Object value)
findNodesWith in class LuceneQueryFactoryprotected org.apache.lucene.search.Query createSnsIndexQuery(String likeExpression)
likeExpression - the expression that uses the JCR 2.0 LIKE representation, and which includes the leading '[' and
trailing ']' charactersCopyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.