Expand my Community achievements bar.

SOLVED

Query Builder using p.hits=selective

Avatar

Level 1

I am using query builder to return some AEM data via the REST API.  I have the following query:

 

http://<server>:<port>/bin/querybuilder.json?type=cq:PageContent

&path=<contentpath>

&p.hits=selective

&p.properties=jcr:title cq:lastModified cq:tags /jcr:content/image/fileReference/

&p.limit=0

 

It appears that p.hits will not return values in nodes that are not at the top level.  For instance, first three properties in the p.properties list above are page level properties where the fourth property is the property of a child node.  According to the documentation you should be able to provide the path to the property relative to the page.  This is what I have done, but I am unable to get the query to return the value (even though I confirmed it exists in crx/de)

1 Accepted Solution

Avatar

Correct answer by
Level 3

In the above mentioned query you are getting the node of type cq:PageContent , which means the result path would contain jcr:content(searched for jcr:content path of a page) in it.

But to get the selective properties again u r adding the /jcr:content in the p.properties(=jcr:title cq:lastModified cq:tags /jcr:content/image/fileReference/) . You need to remove jcr:content and try.

Please refer the below query for example

http://localhost:4502/bin/querybuilder.json?type=cq:PageContent&path=/content/geometrixx&p.hits=sele...

Refer the below Doc for more information.

https://docs.adobe.com/docs/en/cq/5-6-1/dam/customizing_and_extendingcq5dam/query_builder.html#Refin... What Is Returned

View solution in original post

1 Reply

Avatar

Correct answer by
Level 3

In the above mentioned query you are getting the node of type cq:PageContent , which means the result path would contain jcr:content(searched for jcr:content path of a page) in it.

But to get the selective properties again u r adding the /jcr:content in the p.properties(=jcr:title cq:lastModified cq:tags /jcr:content/image/fileReference/) . You need to remove jcr:content and try.

Please refer the below query for example

http://localhost:4502/bin/querybuilder.json?type=cq:PageContent&path=/content/geometrixx&p.hits=sele...

Refer the below Doc for more information.

https://docs.adobe.com/docs/en/cq/5-6-1/dam/customizing_and_extendingcq5dam/query_builder.html#Refin... What Is Returned