0
votes

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 (aNode is a generic subnode of /content/connect/it/supplier/):

1) all properties of /content/connect/it/supplier/aNode/jcr:content

2) all subnodes of /content/connect/it/supplier/aNode/jcr:content/service/legal

as you can see, highlighted in red, in the following picture of the JCR OAK:

enter image description here

To achive my target I've used the following query using AEM query builder debugger:

path:/content/connect/it/supplier
orderBy:@jcr:score
p.limit:-1

group.p.or:true
group.1_fulltext:*something to search*
group.1_fulltext.relPath:jcr:content
group.2_fulltext:*something to search*
group.2_fulltext.relPath:jcr:content/service/legal

Searching for 'something to search' on the properties of jcr:content works properly.

I'm not able to search on the subnodes of 'jcr:content/service/legal'. It does not retrieve anything.

3

3 Answers

0
votes

Try:

path:/content/connect/it/supplier
orderBy:@jcr:score
p.limit:-1

fulltext=*something to search*
group.p.or:true
group.1_relPath:jcr:content
group.2_relPath:jcr:content/service/legal

That should work. See the following links:

  1. https://helpx.adobe.com/experience-manager/6-2/sites/developing/using/querybuilder-api.html
  2. http://www.aemcq5tutorials.com/tutorials/adobe-aem-cq5-tutorials/aem-query-builder/
0
votes

relPath is always limiting the search to the element specified. With that approach you will not reach your goal. You could remove the relPath for group.2 which might give you too many results.

0
votes
fulltext=something to search
group.p.or=true
group.1_path=/content/connect/it/supplier

This automatically searches the fulltext in jcr:content and the subnode below it. This will server your purpose of searching in jcr:content properties and subnodes of jcr:content

If you want to search the fulltext of multiple paths

fulltext=something to search
group.p.or=true
group.1_path=/content/connect/it/supplier
group.2_path=/content/connect/it/xyz