}
}
public Object visit(TextsearchQueryNode node, Object data) {
try {
Path relPath = node.getRelativePath();
String fieldname;
if (relPath == null || !node.getReferencesProperty()) {
// fulltext on node
fieldname = FieldNames.FULLTEXT;
} else {
// final path element is a property name
Name propName = relPath.getName();
StringBuffer tmp = new StringBuffer();
tmp.append(nsMappings.getPrefix(propName.getNamespaceURI()));
tmp.append(":").append(FieldNames.FULLTEXT_PREFIX);
tmp.append(propName.getLocalName());
fieldname = tmp.toString();
}
QueryParser parser = new JackrabbitQueryParser(
fieldname, analyzer, synonymProvider, cache);
Query context = parser.parse(node.getQuery());
if (relPath != null && (!node.getReferencesProperty() || relPath.getLength() > 1)) {
// text search on some child axis
Path.Element[] elements = relPath.getElements();
for (int i = elements.length - 1; i >= 0; i--) {
Name name = null;
if (!elements[i].getName().equals(RelationQueryNode.STAR_NAME_TEST)) {
name = elements[i].getName();
}