Class TextsearchQueryNode
java.lang.Object
org.apache.jackrabbit.spi.commons.query.QueryNode
org.apache.jackrabbit.spi.commons.query.TextsearchQueryNode
Implements a query node that defines a textsearch clause.
-
Field Summary
Fields inherited from class org.apache.jackrabbit.spi.commons.query.QueryNode
TYPE_AND, TYPE_DEREF, TYPE_EXACT, TYPE_LOCATION, TYPE_NODETYPE, TYPE_NOT, TYPE_OR, TYPE_ORDER, TYPE_PATH, TYPE_PROP_FUNCTION, TYPE_RELATION, TYPE_ROOT, TYPE_TEXTSEARCH
-
Method Summary
Modifier and TypeMethodDescriptionaccept
(QueryNodeVisitor visitor, Object data) Accepts aQueryNodeVisitor
and calls the appropriatevisit
method on the visitor depending on the concrete implementation of thisQueryNode
.void
addPathElement
(Path.Element element) Adds a path element to the existing relative path.boolean
Returnstrue
ifobj
is the same type ofQueryNode
asthis
node and is equal tothis
node.Deprecated.getQuery()
Returns the textsearch statement.boolean
int
getType()
Returns the type of this node.boolean
Returnstrue
if this query node needs items under /jcr:system to be queried.void
setPropertyName
(Name property) Deprecated.UsesetRelativePath(Path)
instead.void
setReferencesProperty
(boolean b) Is set totrue
, indicates thatgetRelativePath()
references a property, if set tofalse
indicates that it references a node.void
setRelativePath
(Path relPath) Sets the relative path to the item where the textsearch is performed.
-
Method Details
-
accept
Accepts aQueryNodeVisitor
and calls the appropriatevisit
method on the visitor depending on the concrete implementation of thisQueryNode
.- Specified by:
accept
in classQueryNode
- Parameters:
visitor
- the visitor to call back.data
- arbitrary data for the visitor.- Returns:
- the return value of the
visitor.visit()
call. - Throws:
RepositoryException
-
getType
public int getType()Returns the type of this node. -
getQuery
Returns the textsearch statement.- Returns:
- the textsearch statement.
-
getPropertyName
Deprecated.UsegetRelativePath()
instead.Returns a property name if the scope is limited to just a single property ornull
if the scope is spawned across all properties of a node. Please note that this method does not return the full relative path that reference the item to match, but only the name of the final name element of the path returned bygetRelativePath()
.- Returns:
- property name or
null
.
-
setPropertyName
Deprecated.UsesetRelativePath(Path)
instead.Sets a new name as the search scope for this fulltext query.- Parameters:
property
- the name of the property.
-
getRelativePath
- Returns:
- the relative path that references the item where the textsearch
is performed. Returns
null
if the textsearch is performed on the context node.
-
setRelativePath
Sets the relative path to the item where the textsearch is performed. IfrelPath
isnull
the textsearch is performed on the context node.- Parameters:
relPath
- the relative path to an item.- Throws:
IllegalArgumentException
- ifrelPath
is absolute.
-
addPathElement
Adds a path element to the existing relative path. To add a path element which matches all node names useRelationQueryNode.STAR_NAME_TEST
.- Parameters:
element
- the path element to append.
-
getReferencesProperty
public boolean getReferencesProperty()- Returns:
true
ifgetRelativePath()
references a property, returnsfalse
if it references a node.
-
setReferencesProperty
public void setReferencesProperty(boolean b) Is set totrue
, indicates thatgetRelativePath()
references a property, if set tofalse
indicates that it references a node.- Parameters:
b
- flag whether a property is referenced.
-
equals
Returnstrue
ifobj
is the same type ofQueryNode
asthis
node and is equal tothis
node. -
needsSystemTree
public boolean needsSystemTree()Returnstrue
if this query node needs items under /jcr:system to be queried.- Specified by:
needsSystemTree
in classQueryNode
- Returns:
true
if this query node needs content under /jcr:system to be queried;false
otherwise.
-
getRelativePath()
instead.