Hi, look at this query: SELECT component.[jcr:path] as [jcr:path], component.[jcr:score]…
- User
Hi, look at this query: SELECT component.[jcr:path] as [jcr:path], component.[jcr:score] as [jcr:score], component.* from [nt:base] as page inner join [nt:base] as component on isdescendantnode(component, page) where page.[macrocategory] = 'test' and name(page) = 'jcr:content' and isdescendantnode(page, '/content/alfa/beta') and component.[sling:resourceType] = 'alfa/beta/gamma/teta'
- Assistant
This query retrieves the properties and content of nodes of type [nt:base] that meet certain conditions.
Here's a breakdown of the query:
codeSELECT component.[jcr:path] as [jcr:path], component.[jcr:score] as [jcr:score], component.*This line specifies the properties to select from the result. It includes the [jcr:path] and [jcr:score] properties, as well as all other properties of the 'component' node.
codefrom [nt:base] as page inner join [nt:base] as component on isdescendantnode(component, page)This part of the query performs an inner join between two [nt:base] nodes, 'page' and 'component'. The 'component' node must be a descendant of the 'page' node.