Class TextsearchQueryNode
- java.lang.Object
-
- org.apache.jackrabbit.spi.commons.query.QueryNode
-
- org.apache.jackrabbit.spi.commons.query.TextsearchQueryNode
-
public class TextsearchQueryNode extends QueryNode
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
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedTextsearchQueryNode(QueryNode parent, String query)Creates a newTextsearchQueryNodewith aparentand a textsearchquerystatement.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Objectaccept(QueryNodeVisitor visitor, Object data)Accepts aQueryNodeVisitorand calls the appropriatevisitmethod on the visitor depending on the concrete implementation of thisQueryNode.voidaddPathElement(Path.Element element)Adds a path element to the existing relative path.booleanequals(Object obj)Returnstrueifobjis the same type ofQueryNodeasthisnode and is equal tothisnode.NamegetPropertyName()Deprecated.UsegetRelativePath()instead.StringgetQuery()Returns the textsearch statement.booleangetReferencesProperty()PathgetRelativePath()intgetType()Returns the type of this node.booleanneedsSystemTree()Returnstrueif this query node needs items under /jcr:system to be queried.voidsetPropertyName(Name property)Deprecated.UsesetRelativePath(Path)instead.voidsetReferencesProperty(boolean b)Is set totrue, indicates thatgetRelativePath()references a property, if set tofalseindicates that it references a node.voidsetRelativePath(Path relPath)Sets the relative path to the item where the textsearch is performed.
-
-
-
Constructor Detail
-
TextsearchQueryNode
protected TextsearchQueryNode(QueryNode parent, String query)
Creates a newTextsearchQueryNodewith aparentand a textsearchquerystatement. The scope of the query is the fulltext index of the node, that contains all properties.- Parameters:
parent- the parent node of this query node.query- the textsearch statement.
-
-
Method Detail
-
accept
public Object accept(QueryNodeVisitor visitor, Object data) throws RepositoryException
Accepts aQueryNodeVisitorand calls the appropriatevisitmethod on the visitor depending on the concrete implementation of thisQueryNode.- Specified by:
acceptin 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
public String getQuery()
Returns the textsearch statement.- Returns:
- the textsearch statement.
-
getPropertyName
@Deprecated public Name getPropertyName()
Deprecated.UsegetRelativePath()instead.Returns a property name if the scope is limited to just a single property ornullif 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 public void setPropertyName(Name property)
Deprecated.UsesetRelativePath(Path)instead.Sets a new name as the search scope for this fulltext query.- Parameters:
property- the name of the property.
-
getRelativePath
public Path getRelativePath()
- Returns:
- the relative path that references the item where the textsearch
is performed. Returns
nullif the textsearch is performed on the context node.
-
setRelativePath
public void setRelativePath(Path relPath)
Sets the relative path to the item where the textsearch is performed. IfrelPathisnullthe textsearch is performed on the context node.- Parameters:
relPath- the relative path to an item.- Throws:
IllegalArgumentException- ifrelPathis absolute.
-
addPathElement
public void addPathElement(Path.Element element)
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:
trueifgetRelativePath()references a property, returnsfalseif it references a node.
-
setReferencesProperty
public void setReferencesProperty(boolean b)
Is set totrue, indicates thatgetRelativePath()references a property, if set tofalseindicates that it references a node.- Parameters:
b- flag whether a property is referenced.
-
equals
public boolean equals(Object obj)
Returnstrueifobjis the same type ofQueryNodeasthisnode and is equal tothisnode.
-
needsSystemTree
public boolean needsSystemTree()
Returnstrueif this query node needs items under /jcr:system to be queried.- Specified by:
needsSystemTreein classQueryNode- Returns:
trueif this query node needs content under /jcr:system to be queried;falseotherwise.
-
-