Fulltext query on subnodes doesn't work- XPath & Query Builder

paolog15468718 11-06-2019

I'm trying to perform a query on the CRX of a 6.2 Adobe AEM version.

I have to execute a fulltext query on all subnodes of /content/connect/it/supplier/<aNode>/jcr:content/service/legal where <aNode> is a generic node1, node2, node3 (and so on) as you can see in the following picture:


To achive my target I tried using this XPath query (generated using the query builder):

/jcr:root/content/connect/it/supplier//*[jcr:contains(jcr:content/service/legal, "helloWorld")]

but it does not work, it does not retrieve anything. In fact, I have just realized that with the previous query I am able to search for the properties of jcr:content/service/legal node.

Then I tried using somethig like:


but this time my query was not right.

Accepted Solutions (1)

Accepted Solutions (1)



Can you try like below:

/jcr:root/content/connect/it/supplier//element(*, nt:unstructured)[(jcr:contains(., 'helloWorld')) ]

/jcr:root/content/connect/it/supplier//element(*, nt:unstructured)[(jcr:contains(service/legal/@attributeName, 'helloWorld')) ]

Example from we retail

/jcr:root/content/we-retail/language-masters//element(*, nt:unstructured)


(jcr:contains(., 'Men'))


/jcr:root/content/we-retail/language-masters//element(*, nt:unstructured)


(jcr:contains(button/@label, 'Men'))


Answers (0)