How to combine two queries in AEM?
I am trying to get a node based on 2 conditions,
Condition number 1 - It should be /apps/myproject/templates/full-content-page template
Conditionnumber 2 - It should have property as cq:headerVal and value should be "col3"
I have created a query for these 2 conditions. Below query will be meet 1st condition
path=/content/myproject/sites/en-us
1_property=jcr:primaryType
1_property.value=cq:PageContent
2_property=cq:template
2_property.value=/apps/myproject/templates/full-content-page
This query is working for second condition
path=/content/myproject/sites/en-us
1_property=jcr:primaryType
1_property.value=nt:unstructured
2_property=cq:headerVal
2_property.value=col3
But it is not working when i combine these 2 queries and run
path=/content/myproject/sites/en-us
1_property=jcr:primaryType
1_property.value=cq:PageContent
2_property=cq:template
2_property.value=/apps/myproject/templates/full-content-page
3_property=jcr:primaryType
3_property.value=nt:unstructured
4_property=cq:headerVal
5_property.value=col3
I can understand why it is not working. it is trying to find both cq:template and cq:headerVal on same node but it is actually two different type of node. Is there any way we can merge these two queries ?