Sunday, 6 December 2015

Query Builder samples

AEM comes with a Query Debugger tool at:
/libs/cq/search/content/querydebug.html
You can execute search queries on the JCR (Java Content Repository) using this tool.  For example, to search for all DAM assets in /content/dam/geometrixx, execute the following query:
type=dam:Asset
path=/content/dam/geometrixx
See screenshot below:
image
Running this search query should produce a result such as follows:
image
You can execute more complicated search queries as well.  For example, to search for all DAM assets in /content/dam/geometrixx with the string “.png” in the node name and to to sort the results in the descending order of when the node was last modified, execute the following query:
type=dam:Asset
path=/content/dam/geometrixx
nodename=*.png
[email protected]:content/jcr:lastModified
orderby.sort=desc
More information here.  Excellent blog entry by Thomas Joseph on Oak indexes here.
Other examples:
How many audit events have accumulated:
type=cq:AuditEvent
path=/var/audit
How many unique users have logged in to AEM in the past 12 hours?
A user who has logged in from three different IP addresses (home office, work, mobile phone) will be counted three times.
type=rep:Token
path=/home/users
How many web pages are in the AEM system?
type=cq:Page
path=/content
How many tags have been defined?
type=cq:Tag
path=/etc/tags
How many total users are defined in the AEM system?
type=rep:User
path=/home/users
How many user groups are defined?
type=rep:Group
path=/home/groups
How many Client Libraries?
type=type=cq:ClientLibraryFolder
path=/etc

Read More 

No comments :

Post a comment