Search code examples
aemquery-builderjcr

AEM CQ5 Query Builder: How to get result by searching for 2 different values in same property?


I want to get result matches with all nodes contains property 'abc' value as 'xyz' or 'pqr'.

I am trying in below ways:

  1. http://localhost:4502/bin/querybuilder.json?path=/content/campaigns/asd&property=abc&property.1_value=/%xyz/%&property.2_value=/%pqr/%property.operation=like&p.limit=-1&orderby:path

  2. http://localhost:4502/bin/querybuilder.json?path=/content/campaigns/asd&property=abc&property.1_value=/%xyz/%&property.2_value=/%pqr/%&property.1_operation=like&property.2_operation=like&p.limit=-1&orderby:path

  3. http://localhost:4502/bin/querybuilder.json?path=/content/campaigns/asd&1_property=abc&1_property.1_value=/%xyz/%&1_property.1_operation=like&2_property=abc&1_property.1_value=/%xyz/%&2_property.1_operation=like&p.limit=-1&orderby:path

But none of them served my purpose. Any thing that I am missing in this?


Solution

  • It worked with below query:

    http://localhost:4502/bin/querybuilder.json?orderby=path
    &p.limit=-1
    &path=/content/campaigns
    &property=jcr:content/par/nodeName/xyz
    &property.1_value=pqr
    &property.2_value=%abc%
    &property.operation=like
    &type=cq:Page
    

    Note: property name should be fully specified form the type of node we are expecting.

    Ex: jcr:content/par/nodeName/xyz above instead of just xyz