I have to search for the value of jcr:lastModifiedBy in AEM
I have to search under page which has a jcr:content under which we have components which have a property jcr:lastModifiedBy. Please help
Probably this should do the job:
path=/content//jcr:content
type=nt:unstructured
property=jcr:lastModifiedBy
property.value=admin
You can test also your query builder queries also here.
Related
I need to do a search for all nodes that contain a specific piece of text. I know I can use the LIKE operation for this, but the issue is how to search for the string when you are not specifying any properties? Basically if any property on any node on any page contains the string, I wwant to return those results?
Can anyone help?
G
You can use this to search for any substring inside any properties under any path using AEM Query Builder. You can use asterisk or * If you do not want a substring and just the full text then remove the "*" and give the search text;
path=/content
fulltext=*anyTextToSearch*
OR IN XPATH Query
/jcr:root/content/path/to/page//*[jcr:contains(., '(*anyTextToSearch*')]
OR IN SQL2
SELECT * FROM [nt:unstructured] AS node
WHERE ISDESCENDANTNODE(node, "/search/in/path")
AND CONTAINS([propertyName], "*anyTextToSearch*")
I think you can try 'fulltext' search,
path=/content
fulltext=searchtext
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:
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.
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:
https://helpx.adobe.com/experience-manager/6-2/sites/developing/using/querybuilder-api.html
http://www.aemcq5tutorials.com/tutorials/adobe-aem-cq5-tutorials/aem-query-builder/
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.
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
In order to get pages tagged with a certain tag in AEM query builder, we will do as this doc (https://helpx.adobe.com/experience-manager/6-2/sites/developing/using/querybuilder-api.html)
path=/content/...
type=cq:Page
tagid=marketing:interest/product
tagid.property=jcr:content/cq:tags
But how do we get pages that have the same tag title without using the whole tag's ID or full path above ?
For example
path=/content/...
type=cq:Page
tagtitle=product
tagid.property=jcr:content/cq:tags
You could use something like that:
JCR like:
path=/content/..
type=cq:Page
property=jcr:content/#cq:tags
property.value=%tagname
property.operation=like
This would search for cq:tags property with value that ends with "product".
See more about jcr:like function.
Another possible solution:
Full text search:
path=/content/somesite
type=cq:Page
fulltext.relPath=jcr:content/#cq:tags
fulltext=tagname
See more about jcr:contains function
Is there any way through which we get the path of our custom xtype js if we know the value of js. Suppose my xtype is urlwithlinkand i want to know where its js resides. just like if we know the client library name we get its path using this link http://localhost:4504/libs/granite/ui/content/dumplibs.html is there any similar way to find out the path of custom xtype js ?
Widgets are registered with their xtype using ExtJS API, eg.:
CQ.Ext.reg("richtext", CQ.form.RichText);
The only way to find out the mapping between a JS file in the JCR repository and its xtype is to perform a full-text search. I don't think it's possible to define a precise XPath/SQL2 query that finds something in the binary resources.
If you have the source code of the custom widgets, just use your IDE to find the appropriate CQ.Ext.reg invocation.
If you don't have the source code and the widget is available only on the instance, create a CQ package including the ExtJS source (for the standard CQ widgets it's /libs/cq/ui), unzip it and browse the contents, looking for the aforementioned CQ.Ext.reg("your_xtype" string.
using a SQL2 query we can find the file. Example if my xtype name is urlwithlabel then the SQL2 query will be SELECT * FROM [nt:base] AS s WHERE CONTAINS(s.*, 'urlwithlabel').
I am querying the cq pages and assets based on the last modified date.
Here is the the text that has to be put in query builder debugger:
fulltext=geometrix
1_group.p.or=true
1_group.1_group.p.and=true
1_group.1_group.path=/content
1_group.1_group.type=cq:Page
1_group.1_group.relativedaterange.property=jcr:content/cq:lastModified
1_group.1_group.relativedaterange.lowerBound=-1M
1_group.2_group.p.and=true
1_group.2_group.path=/content/dam
1_group.2_group.type=dam:Asset
1_group.2_group.relativedaterange.property=jcr:content/cq:lastModified
1_group.2_group.relativedaterange.lowerBound=-1M
It doesn't work.
Here I have to apply lowerbound on both cq:pages and dam assets.
Where am I going wrong?
Your query is full right except the thing that dam:asset don't have cq:lastModified property but it has jcr:lastModified.
So instead of using:
1_group.2_group.relativedaterange.property=jcr:content/cq:lastModified
you can use:
1_group.2_group.relativedaterange.property=jcr:content/jcr:lastModified
and it will start working.