Hi,
I'm getting invalide query exception for this
Solved! Go to Solution.
Views
Replies
Total Likes
Try this
String queryString = "SELECT * FROM [nt:unstructured] AS node WHERE ISDESCENDANTNODE(node,'"+path+"')"+"AND node.[sling:resourceType] = 'apps/components/componentName'";
Try this
String queryString = "SELECT * FROM [nt:unstructured] AS node WHERE ISDESCENDANTNODE(node,'"+path+"')"+"AND node.[sling:resourceType] = 'apps/components/componentName'";
Hi @Keerthi0555 , please use as @h_kataria mentioned i.e. path should be in single quote but give relative path.
Remove apps/
PFA,
SELECT * FROM [nt:unstructured] AS node WHERE ISDESCENDANTNODE(node,'/content/we-retail/us/en')AND node.[sling:resourceType] = 'weretail/components/content/breadcrumb'
OR
SELECT * FROM [nt:unstructured] AS node WHERE ISDESCENDANTNODE(node,'/content/we-retail/us/en')AND node.[sling:resourceType] LIKE 'weretail/components/content/breadcrumb'
So issue is with apps/ as well else it will return zero hit
Both query need minor correction also we can concatenate path as below
String queryString="SELECT * FROM [nt:unstructured] AS node WHERE ISDESCENDANTNODE(node,'"+path+"')AND node.[sling:resourceType] LIKE 'weretail/components/content/breadcrumb'";
Or
String queryString="SELECT * FROM [nt:unstructured] AS node WHERE ISDESCENDANTNODE(node,'"+path+"')AND node.[sling:resourceType] = 'weretail/components/content/breadcrumb'";
Thanks
You missed single quote at the end of component path.
String queryString = "SELECT * FROM [nt:unstructured] AS node WHERE ISDESCENDANTNODE(node," +path+")"+ "AND [sling:resourceType] = 'apps/components/componentName'"