@ThreadSafe @Immutable public class LuceneQueryFactory extends Object
Query
object from a Query Object Model Constraint
object.Modifier and Type | Class and Description |
---|---|
protected static class |
LuceneQueryFactory.SingleColumnQueryFactory |
protected static class |
LuceneQueryFactory.TextQueryFactory |
Modifier and Type | Field and Description |
---|---|
protected ValueFactories |
factories |
protected NameFactory |
nameFactory |
protected PathFactory |
pathFactory |
protected Map<String,PropertyType> |
propertyTypesByName |
protected StringFactory |
stringFactory |
protected Map<String,Object> |
variables |
Modifier and Type | Method and Description |
---|---|
protected org.apache.lucene.search.Query |
booleanFieldQuery(String field,
Operator operator,
Object value) |
protected org.apache.lucene.search.BooleanQuery |
booleanQuery(org.apache.lucene.search.Query leftQuery,
org.apache.lucene.search.BooleanClause.Occur leftOccur,
org.apache.lucene.search.Query rightQuery,
org.apache.lucene.search.BooleanClause.Occur rightOccur) |
protected List<String> |
collectReferenceFieldNames(ReferenceValue referenceValue) |
protected org.apache.lucene.search.Query |
createLengthQuery(Length propertyLength,
Operator operator,
Object value) |
protected org.apache.lucene.search.Query |
createPropertyValueQuery(PropertyValue propertyValue,
Operator operator,
Object value,
CaseOperations.CaseOperation caseOperation) |
protected org.apache.lucene.search.Query |
createQuery(And and) |
protected org.apache.lucene.search.Query |
createQuery(Between between) |
protected org.apache.lucene.search.Query |
createQuery(Comparison comparison) |
org.apache.lucene.search.Query |
createQuery(Constraint constraint)
Create a Lucene
Query that represents the supplied Query Object Model Constraint . |
protected org.apache.lucene.search.Query |
createQuery(DynamicOperand left,
Operator operator,
StaticOperand right,
CaseOperations.CaseOperation caseOperation) |
protected org.apache.lucene.search.Query |
createQuery(FullTextSearch constraint) |
protected org.apache.lucene.search.Query |
createQuery(Not not) |
protected org.apache.lucene.search.Query |
createQuery(PropertyExistence propertyExistence) |
protected org.apache.lucene.search.Query |
createQuery(Relike relike) |
protected org.apache.lucene.search.Query |
createQuery(SetCriteria setCriteria) |
protected org.apache.lucene.search.Query |
createRangeQuery(String field,
Object lowerValue,
Object upperValue,
boolean includesLower,
boolean includesUpper) |
protected org.apache.lucene.search.Query |
createReferenceValueQuery(ReferenceValue referenceValue,
Operator operator,
Object value) |
protected org.apache.lucene.search.Query |
dateFieldQuery(String field,
Operator operator,
Object value) |
protected org.apache.lucene.search.Query |
decimalFieldQuery(String field,
Operator operator,
Object value,
CaseOperations.CaseOperation caseOperation) |
protected org.apache.lucene.search.Query |
doubleFieldQuery(String field,
Operator operator,
Object value) |
static LuceneQueryFactory |
forMultiColumnIndex(ValueFactories factories,
Map<String,Object> variables,
Map<String,PropertyType> propertyTypesByName)
Creates a new query factory which can be used to produce Lucene queries for
MultiColumnIndex
indexes. |
static LuceneQueryFactory |
forSingleColumnIndex(ValueFactories factories,
Map<String,Object> variables,
Map<String,PropertyType> propertyTypesByName)
Creates a new query factory which can be used to produce Lucene queries for
SingleColumnIndex
indexes. |
static LuceneQueryFactory |
forTextIndex(ValueFactories factories,
Map<String,Object> variables,
Map<String,PropertyType> propertyTypesByName,
LuceneConfig config)
Creates a new query factory which can be used to produce Lucene queries for
TextIndex
indexes. |
protected Object |
getSingleValueFromStaticOperand(StaticOperand operand) |
protected org.apache.lucene.search.Query |
longFieldQuery(String field,
Operator operator,
Object value) |
protected org.apache.lucene.search.Query |
nameFieldQuery(String field,
Operator operator,
Object value,
CaseOperations.CaseOperation caseOperation) |
protected org.apache.lucene.search.BooleanQuery |
not(org.apache.lucene.search.Query notted) |
protected org.apache.lucene.search.Query |
pathFieldQuery(String field,
Operator operator,
Object value,
CaseOperations.CaseOperation caseOperation) |
boolean |
scoreDocuments()
Checks if for the query produced by this factory scores are expected or not for matching documents.
|
protected org.apache.lucene.search.Query |
stringFieldQuery(String field,
Operator operator,
Object value,
CaseOperations.CaseOperation caseOperation) |
protected final PathFactory pathFactory
protected final NameFactory nameFactory
protected final StringFactory stringFactory
protected final ValueFactories factories
protected final Map<String,PropertyType> propertyTypesByName
public static LuceneQueryFactory forMultiColumnIndex(ValueFactories factories, Map<String,Object> variables, Map<String,PropertyType> propertyTypesByName)
MultiColumnIndex
indexes.factories
- a ValueFactories
instance; may not be nullvariables
- a Map
instance which contains the query variables for a particular query; may be null
propertyTypesByName
- a Map
representing the columns and their types for the index definition
for which the query should be created; may not be null.LuceneQueryFactory
instance, never null
public static LuceneQueryFactory forSingleColumnIndex(ValueFactories factories, Map<String,Object> variables, Map<String,PropertyType> propertyTypesByName)
SingleColumnIndex
indexes.factories
- a ValueFactories
instance; may not be nullvariables
- a Map
instance which contains the query variables for a particular query; may be null
propertyTypesByName
- a Map
representing the columns and their types for the index definition
for which the query should be created; may not be null.LuceneQueryFactory
instance, never null
public static LuceneQueryFactory forTextIndex(ValueFactories factories, Map<String,Object> variables, Map<String,PropertyType> propertyTypesByName, LuceneConfig config)
TextIndex
indexes.factories
- a ValueFactories
instance; may not be nullvariables
- a Map
instance which contains the query variables for a particular query; may be null
propertyTypesByName
- a Map
representing the columns and their types for the index definition
for which the query should be created; may not be null.config
- a LuceneConfig
instance required to get various information for FTS (e.g. configured analyzer); may
not be nullLuceneQueryFactory
instance, never null
public org.apache.lucene.search.Query createQuery(Constraint constraint)
Query
that represents the supplied Query Object Model Constraint
.constraint
- the QOM constraint; never nullpublic boolean scoreDocuments()
true
if scores are expected to matching documents, false
otherwiseprotected org.apache.lucene.search.Query createQuery(FullTextSearch constraint)
protected org.apache.lucene.search.Query createQuery(Comparison comparison)
protected org.apache.lucene.search.Query createQuery(Not not)
protected org.apache.lucene.search.Query createQuery(Relike relike)
protected org.apache.lucene.search.Query createQuery(Between between)
protected org.apache.lucene.search.Query createRangeQuery(String field, Object lowerValue, Object upperValue, boolean includesLower, boolean includesUpper)
protected org.apache.lucene.search.Query createQuery(SetCriteria setCriteria)
protected org.apache.lucene.search.Query createQuery(And and)
protected org.apache.lucene.search.Query createQuery(PropertyExistence propertyExistence)
protected org.apache.lucene.search.Query createQuery(DynamicOperand left, Operator operator, StaticOperand right, CaseOperations.CaseOperation caseOperation)
protected Object getSingleValueFromStaticOperand(StaticOperand operand)
protected org.apache.lucene.search.BooleanQuery not(org.apache.lucene.search.Query notted)
protected org.apache.lucene.search.Query createPropertyValueQuery(PropertyValue propertyValue, Operator operator, Object value, CaseOperations.CaseOperation caseOperation)
protected org.apache.lucene.search.Query stringFieldQuery(String field, Operator operator, Object value, CaseOperations.CaseOperation caseOperation)
protected org.apache.lucene.search.Query decimalFieldQuery(String field, Operator operator, Object value, CaseOperations.CaseOperation caseOperation)
protected org.apache.lucene.search.Query booleanFieldQuery(String field, Operator operator, Object value)
protected org.apache.lucene.search.Query longFieldQuery(String field, Operator operator, Object value)
protected org.apache.lucene.search.Query doubleFieldQuery(String field, Operator operator, Object value)
protected org.apache.lucene.search.Query dateFieldQuery(String field, Operator operator, Object value)
protected org.apache.lucene.search.Query createReferenceValueQuery(ReferenceValue referenceValue, Operator operator, Object value)
protected List<String> collectReferenceFieldNames(ReferenceValue referenceValue)
protected org.apache.lucene.search.Query createLengthQuery(Length propertyLength, Operator operator, Object value)
protected org.apache.lucene.search.Query pathFieldQuery(String field, Operator operator, Object value, CaseOperations.CaseOperation caseOperation)
protected org.apache.lucene.search.Query nameFieldQuery(String field, Operator operator, Object value, CaseOperations.CaseOperation caseOperation)
protected org.apache.lucene.search.BooleanQuery booleanQuery(org.apache.lucene.search.Query leftQuery, org.apache.lucene.search.BooleanClause.Occur leftOccur, org.apache.lucene.search.Query rightQuery, org.apache.lucene.search.BooleanClause.Occur rightOccur)
Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.