Class AlfrescoFunctionEvaluationContext
java.lang.Object
org.alfresco.repo.search.impl.parsers.AlfrescoFunctionEvaluationContext
- All Implemented Interfaces:
FunctionEvaluationContext
Alfrecso function evaluation context for evaluating FTS expressions against lucene.
- Author:
- andyh
-
Constructor Summary
ConstructorsConstructorDescriptionAlfrescoFunctionEvaluationContext
(NamespacePrefixResolver namespacePrefixResolver, DictionaryService dictionaryService, String defaultNamespace) -
Method Summary
Modifier and TypeMethodDescription<Q,
S, E extends Throwable>
QbuildLuceneEquality
(QueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) <Q,
S, E extends Throwable>
QbuildLuceneExists
(QueryParserAdaptor<Q, S, E> lqpa, String propertyName, Boolean not) Note: null and not null are not required to support functions from the spec<Q,
S, E extends Throwable>
QbuildLuceneGreaterThan
(QueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) <Q,
S, E extends Throwable>
QbuildLuceneGreaterThanOrEquals
(QueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) <Q,
S, E extends Throwable>
QbuildLuceneIn
(QueryParserAdaptor<Q, S, E> lqpa, String propertyName, Collection<Serializable> values, Boolean not, PredicateMode mode) Note: In is not required to support functions from the spec<Q,
S, E extends Throwable>
QbuildLuceneInequality
(QueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) <Q,
S, E extends Throwable>
QbuildLuceneLessThan
(QueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) <Q,
S, E extends Throwable>
QbuildLuceneLessThanOrEquals
(QueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) <Q,
S, E extends Throwable>
QbuildLuceneLike
(QueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, Boolean not) Note: Like is not required to support functions from the specvoid
checkFieldApplies
(Selector selector, String propertyName) getAlfrescoPropertyName
(String propertyName) getAlfrescoTypeName
(String typeName) getLuceneFieldName
(String propertyName) getLuceneFunction
(FunctionArgument functionArgument) getLuceneSortField
(QueryParserAdaptor<Q, S, E> lqpa, String propertyName) getProperty
(NodeRef nodeRef, String propertyName) Get a propertygetScore()
boolean
isMultiValued
(String propertyName) Is this a multi-valued property?boolean
isObjectId
(String propertyName) boolean
isOrderable
(String fieldName) boolean
isQueryable
(String fieldName) stripSuffixes
(QName qname)
-
Constructor Details
-
AlfrescoFunctionEvaluationContext
public AlfrescoFunctionEvaluationContext(NamespacePrefixResolver namespacePrefixResolver, DictionaryService dictionaryService, String defaultNamespace) - Parameters:
namespacePrefixResolver
- NamespacePrefixResolverdictionaryService
- DictionaryServicedefaultNamespace
- String
-
-
Method Details
-
buildLuceneEquality
public <Q,S, Q buildLuceneEqualityE extends Throwable> (QueryParserAdaptor<Q, S, throws EE> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) - Specified by:
buildLuceneEquality
in interfaceFunctionEvaluationContext
propertyName
- Stringvalue
- Serializablemode
- PredicateModeluceneFunction
- LuceneFunction- Returns:
- the query
- Throws:
E
-
buildLuceneExists
public <Q,S, Q buildLuceneExistsE extends Throwable> (QueryParserAdaptor<Q, S, throws EE> lqpa, String propertyName, Boolean not) Description copied from interface:FunctionEvaluationContext
Note: null and not null are not required to support functions from the spec- Specified by:
buildLuceneExists
in interfaceFunctionEvaluationContext
propertyName
- Stringnot
- Boolean- Returns:
- the query
- Throws:
E
-
buildLuceneGreaterThan
public <Q,S, Q buildLuceneGreaterThanE extends Throwable> (QueryParserAdaptor<Q, S, throws EE> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) - Specified by:
buildLuceneGreaterThan
in interfaceFunctionEvaluationContext
propertyName
- Stringvalue
- Serializablemode
- PredicateModeluceneFunction
- LuceneFunction- Returns:
- the query
- Throws:
E
-
buildLuceneGreaterThanOrEquals
public <Q,S, Q buildLuceneGreaterThanOrEqualsE extends Throwable> (QueryParserAdaptor<Q, S, throws EE> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) - Specified by:
buildLuceneGreaterThanOrEquals
in interfaceFunctionEvaluationContext
propertyName
- Stringvalue
- Serializablemode
- PredicateModeluceneFunction
- LuceneFunction- Returns:
- the query
- Throws:
E
-
buildLuceneIn
public <Q,S, Q buildLuceneInE extends Throwable> (QueryParserAdaptor<Q, S, throws EE> lqpa, String propertyName, Collection<Serializable> values, Boolean not, PredicateMode mode) Description copied from interface:FunctionEvaluationContext
Note: In is not required to support functions from the spec- Specified by:
buildLuceneIn
in interfaceFunctionEvaluationContext
propertyName
- Stringnot
- Booleanmode
- PredicateMode- Returns:
- the query
- Throws:
E
-
buildLuceneInequality
public <Q,S, Q buildLuceneInequalityE extends Throwable> (QueryParserAdaptor<Q, S, throws EE> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) - Specified by:
buildLuceneInequality
in interfaceFunctionEvaluationContext
propertyName
- Stringvalue
- Serializablemode
- PredicateModeluceneFunction
- LuceneFunction- Returns:
- the query
- Throws:
E
-
buildLuceneLessThan
public <Q,S, Q buildLuceneLessThanE extends Throwable> (QueryParserAdaptor<Q, S, throws EE> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) - Specified by:
buildLuceneLessThan
in interfaceFunctionEvaluationContext
propertyName
- Stringvalue
- Serializablemode
- PredicateModeluceneFunction
- LuceneFunction- Returns:
- the query
- Throws:
E
-
buildLuceneLessThanOrEquals
public <Q,S, Q buildLuceneLessThanOrEqualsE extends Throwable> (QueryParserAdaptor<Q, S, throws EE> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) - Specified by:
buildLuceneLessThanOrEquals
in interfaceFunctionEvaluationContext
propertyName
- Stringvalue
- Serializablemode
- PredicateModeluceneFunction
- LuceneFunction- Returns:
- the query
- Throws:
E
-
buildLuceneLike
public <Q,S, Q buildLuceneLikeE extends Throwable> (QueryParserAdaptor<Q, S, throws EE> lqpa, String propertyName, Serializable value, Boolean not) Description copied from interface:FunctionEvaluationContext
Note: Like is not required to support functions from the spec- Specified by:
buildLuceneLike
in interfaceFunctionEvaluationContext
propertyName
- Stringvalue
- Serializablenot
- Boolean- Returns:
- the query
- Throws:
E
-
getLuceneSortField
public <Q,S, String getLuceneSortFieldE extends Throwable> (QueryParserAdaptor<Q, S, throws EE> lqpa, String propertyName) - Specified by:
getLuceneSortField
in interfaceFunctionEvaluationContext
propertyName
- String- Returns:
- the field used for sorting the given property
- Throws:
E
-
getNodeRefs
- Specified by:
getNodeRefs
in interfaceFunctionEvaluationContext
- Returns:
- the matching nodes by selector (at navigation time)
-
getNodeService
- Specified by:
getNodeService
in interfaceFunctionEvaluationContext
- Returns:
- the node service
-
getProperty
Description copied from interface:FunctionEvaluationContext
Get a property- Specified by:
getProperty
in interfaceFunctionEvaluationContext
- Parameters:
nodeRef
- NodeRefpropertyName
- String- Returns:
- the property (at navigation time)
-
getScore
- Specified by:
getScore
in interfaceFunctionEvaluationContext
- Returns:
- the score (at navigation time)
-
getScores
- Specified by:
getScores
in interfaceFunctionEvaluationContext
- Returns:
- the scores by selector (at navigation time)
-
isObjectId
- Specified by:
isObjectId
in interfaceFunctionEvaluationContext
- Parameters:
propertyName
- String- Returns:
- - is this an object id
-
isOrderable
- Specified by:
isOrderable
in interfaceFunctionEvaluationContext
- Parameters:
fieldName
- String- Returns:
- Is this property orderable
-
isQueryable
- Specified by:
isQueryable
in interfaceFunctionEvaluationContext
- Parameters:
fieldName
- String- Returns:
- is this property queryable
-
getLuceneFieldName
- Specified by:
getLuceneFieldName
in interfaceFunctionEvaluationContext
- Parameters:
propertyName
- String- Returns:
- the lucene field name for the property
-
stripSuffixes
-
getLuceneFunction
- Specified by:
getLuceneFunction
in interfaceFunctionEvaluationContext
- Parameters:
functionArgument
- FunctionArgument- Returns:
- the lucene function appropriate to a function argument
-
checkFieldApplies
- Specified by:
checkFieldApplies
in interfaceFunctionEvaluationContext
- Parameters:
selector
- SelectorpropertyName
- String
-
isMultiValued
Description copied from interface:FunctionEvaluationContext
Is this a multi-valued property?- Specified by:
isMultiValued
in interfaceFunctionEvaluationContext
- Parameters:
propertyName
- String- Returns:
- boolean
-
getAlfrescoPropertyName
- Specified by:
getAlfrescoPropertyName
in interfaceFunctionEvaluationContext
-
getAlfrescoTypeName
- Specified by:
getAlfrescoTypeName
in interfaceFunctionEvaluationContext
- Parameters:
typeName
- String- Returns:
- String
-