Need More fields in Query | Community
Skip to main content
Level 3
March 29, 2023
Solved

Need More fields in Query

  • March 29, 2023
  • 1 reply
  • 1111 views

Hi Team,

 

I have requirement to fetch both master and mkg-data node value for the path /content/dam/projects/we-retail/communities/community1 . But here I am getting this by using below 2 query parameter. But I want to get all master and mkg-data node values in one query.

 

http://localhost:4502/bin/querybuilder.json?path=/content/dam/projects/we-retail/communities/community1&1_property=uuid&nodename=mkg-data&p.limit:-1&p.hits=full

 

http://localhost:4502/bin/querybuilder.json?path=/content/dam/projects/we-retail/communities/community1&1_property=jcr:primaryType&1_property.value=nt:unstructured&nodename=master&p.limit:-1&p.hits=full

 

 

Can anyone please help me to club above 2 query and to one query ?

 

 

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 arunpatidar

Hi,

you can use group predicate to combine queries

https://experienceleague.adobe.com/docs/experience-manager-64/developing/platform/query-builder/querybuilder-api.html?lang=en#search-under-multiple-paths-using-groups 

 

Some sample queries

--------------- Type=cq:Page group.1_path=/content/we-retail/us/en/experience group.1_path.self=true group.2_path=/content/we-retail/us/en/men group.2_path.self=true group.3_path=/content/we-retail/us/en/women group.3_path.self=true group.4_path=/content/we-retail/us/en/equipment group.4_path.self=true group.p.or=true orderby=@jcr:created p.limit=-1 -------------- group.1_property=color group.1_property.operation= exists group.1_property=font group.1_property.operation= exists group.1_property.or=true group.2_property=jcr:primaryType group.2_property.value=cq:Page group.2_property=jcr:primaryType group.2_property.value=dam:Asset group.2_property.or=true group.3_group.path=/content/geometrixx/en group.3_group.path=/content/dam/geometrixx group.3_property.or=true group.p.or=false ------------------

 

 

1 reply

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
March 29, 2023

Hi,

you can use group predicate to combine queries

https://experienceleague.adobe.com/docs/experience-manager-64/developing/platform/query-builder/querybuilder-api.html?lang=en#search-under-multiple-paths-using-groups 

 

Some sample queries

--------------- Type=cq:Page group.1_path=/content/we-retail/us/en/experience group.1_path.self=true group.2_path=/content/we-retail/us/en/men group.2_path.self=true group.3_path=/content/we-retail/us/en/women group.3_path.self=true group.4_path=/content/we-retail/us/en/equipment group.4_path.self=true group.p.or=true orderby=@jcr:created p.limit=-1 -------------- group.1_property=color group.1_property.operation= exists group.1_property=font group.1_property.operation= exists group.1_property.or=true group.2_property=jcr:primaryType group.2_property.value=cq:Page group.2_property=jcr:primaryType group.2_property.value=dam:Asset group.2_property.or=true group.3_group.path=/content/geometrixx/en group.3_group.path=/content/dam/geometrixx group.3_property.or=true group.p.or=false ------------------

 

 

Arun Patidar
subnaikAuthor
Level 3
March 30, 2023

@arunpatidar  thanks for your reply.

 

I tried below query using group , but still my value is not coming.

 

Here I need JCR data from one path , but two different nodes.

 

http://localhost:4502/bin/querybuilder.json?path=/content/dam/projects/we-retail/communities/community1&
group.1_nodename=master&
group.1_property=jcr:primaryType&
group.1_property.value=nt:unstructured&
group.2_nodename=mkg-data&
group.2_property=uuid&
p.limit:-1&
p.hits=full

bilal_ahmad
Level 5
March 30, 2023

Hi! add group.p.or=true to your query

 

Thanks,

Bilal