Hi All,
path=/content/www/xx/xx
type=nt:unstructured
1_property=abcd
1_property.operation=exists
2_property=efgh
2_property.operation=exists
3_property=ijkl
3_property.operation=exists
p.limit=-1
We want to retrieve pages, only when a specific component included in a page [there are multiple components having similar properties] has these properties(abcd,efgh & ijkl).
The above query when run in http://localhost:4502/libs/cq/search/content/querydebug.html is not working as per our requirement.
Can someone please tweak this query to meet our requirements.
Any thoughts will be really helpful.
Solved! Go to Solution.
Views
Replies
Total Likes
Read this article - there are different ways in which to query JCR. Also - use the AEM Query tool to experiment with different query searches: /crx/explorer/ui/search.jsp.
http://cq-ops.tumblr.com/post/23544023402/how-to-query-cqs-jcr-with-sql-or-xpath
I found this tool to be very useful
Views
Replies
Total Likes
Is there anything unique for this component?
if yes then use that property in your search query or you can use sling:resourceType property with the default value of your component i.e. /apps/abc/components/xyz. then it will return the result with all nodes having this property. ex -
Iterate this result set & split each URL on the basic of /jcr:content then first part will be the page URL.
Views
Replies
Total Likes
type=nt:unstructured
path=/content/xyz
1_property=cq:commerceType
1_property.operation=exists
2_property=productData
2_property.operation=exists
3_property=cq:isCancelledForChildren
3_property.operation=exists
I am using this query for finding all nt:unstructured node having properties "cq:commerceType, productData, cq:isCancelledForChildren". this query is working fine and returns expected result. If you are not able to find it working then do the debugging by using one by one condition & check results.
Views
Replies
Total Likes
Hi Ankur,
Thank you for your reply.
I added sling:resourceType property and the modified query as below, But still it doesnt seem to be working.
path=/content/xxx/xx/xx
type=nt:unstructured
1_property=sling:resourceType
1_property.value=x/x/x/x/x
2_property=abcd
2_property.operation=exists
3_property=efgh
3_property.operation=exists
4_property=ijkl
4_property.operation=exists
p.limit=-1
Your thoughts on this will be really helpful.
Views
Replies
Total Likes
Hi Ankur,
Thank you for your reply.
The query is working fine for me. But the problem is I want to find only pages which has a specific component which has these properties.
There are many components with same properties and I do not want those to come up in results.
Views
Replies
Total Likes
Read this article - there are different ways in which to query JCR. Also - use the AEM Query tool to experiment with different query searches: /crx/explorer/ui/search.jsp.
http://cq-ops.tumblr.com/post/23544023402/how-to-query-cqs-jcr-with-sql-or-xpath
I found this tool to be very useful
Views
Replies
Total Likes
Hi
Could you elaborate what sort of result you get? Too much? Not at all?
How much time does it take to the query to render the results?
Views
Replies
Total Likes
Hi Carlino,
Nope, It did not throw up any results.
Views
Replies
Total Likes