Query Builder using p.hits=selective | Community
Skip to main content
New Participant
April 20, 2016
Solved

Query Builder using p.hits=selective

  • April 20, 2016
  • 1 reply
  • 4072 views

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)

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by mkumar

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=selective&p.properties=sling:resourceType%20jcr:primaryType%20jcr:title%20jcr:path%20/image/fileReference/&property=jcr:title&property.value=Triangle

Refer the below Doc for more information.

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

1 reply

mkumar
mkumarAccepted solution
New Participant
April 21, 2016

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=selective&p.properties=sling:resourceType%20jcr:primaryType%20jcr:title%20jcr:path%20/image/fileReference/&property=jcr:title&property.value=Triangle

Refer the below Doc for more information.

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