Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events
SOLVED

Need More fields in Query

Avatar

Level 3

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/communi...

 

http://localhost:4502/bin/querybuilder.json?path=/content/dam/projects/we-retail/communities/communi...

 

subnaik_0-1680104656460.png

 

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

 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

you can use group predicate to combine queries

https://experienceleague.adobe.com/docs/experience-manager-64/developing/platform/query-builder/quer... 

 

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

View solution in original post

5 Replies

Avatar

Correct answer by
Community Advisor

Hi,

you can use group predicate to combine queries

https://experienceleague.adobe.com/docs/experience-manager-64/developing/platform/query-builder/quer... 

 

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

Avatar

Level 3

@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/communi...
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

Avatar

Community Advisor

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

 

Thanks,

Bilal

Avatar

Community Advisor

try something like below

 

path=/content/dam/weretail
type=nt:unstructured
group.1_nodename=master
group.2_nodename=mkg-data
p.limit:-1
p.hits=full
group.p.or=true


Arun Patidar