Requirement on Query builder | Community
Skip to main content
Level 2
September 9, 2021
Solved

Requirement on Query builder

  • September 9, 2021
  • 3 replies
  • 1822 views

Hi Team,

 

I am fetching some DAM assets based on the below property (xyz:public).

1)    Below is the condition it should use to fetch the result.

 

     1. xyz:pubic --> property value can be 'yes'

                           or
       xyz:pubic --> property value is not defined means null.

 


    2.  xyz:pubic --> property not available/exist for DAM assets

 

above  2 conditions should match.

 

In simple terms, if  xyz:public property not available for assets need to fetch and if property available then value should  be 'yes/null' and value should not be 'no'

 

Thanks

Chandra

 

 

 

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 Fanindra_Surat

Hi @chandrareddy 

 

If I understand correctly, you want to fetch the assets that :

  • Don't have the xyz:pubic property.

+

  • Have the xyz:pubic property with value other than 'no'

 

If yes, please try this query:

 

path=/content/dam/we-retail
nodename=metadata
group.p.or=true
group.1_property=xyz:pubic
group.1_property.operation=unequals
group.1_property.1_value=no
group.2_property=xyz:pubic
group.2_property.operation=exists
group.2_property.value=false
p.limit=-1

 

Hope this helps.

 

Thanks,

Fani

3 replies

Kishore_Kumar_
Level 9
September 9, 2021

Hi @chandrareddy ,

 

Please try with this.

 

path=/content/dam
property=xyz:pubic
property.1_value=yes
property.2_value=<<if you have any other property. Works based on OR condition>>
p.limit=-1
Level 2
September 9, 2021

I think my question is not correct. Now I have updated.

Actually the given solution only works for point 1.

 

 1. xyz:pubic --> property value can be 'yes'

                           or
       xyz:pubic --> property value is not defined means null.

 


    2.  xyz:pubic --> property not available/exist for DAM assets

 

above  2 conditions should match.

if  xyz:public property not available for assets need to fetch those assets and,

if property available then value should  be 'yes/null'.

Kishore_Kumar_
Level 9
September 9, 2021

Hi @chandrareddy ,

 

Please check on this.

 

path=/content/dam
group.p.or=true
group.1_property=xyz:pubic
group.1_property.1_value=yes
group.2_property=xyz:pubic
group.2_property.operation=not
p.limit=-1
Level 2
September 9, 2021

Hi @chandrareddy ,
I have a question here if you don't define any value for the property is the property getting saved in JCR ?

Please check below documentation for grouping:
https://experienceleague.adobe.com/docs/experience-manager-64/developing/platform/query-builder/querybuilder-api.html?lang=en

Thank you

Fanindra_Surat
Community Advisor
Fanindra_SuratCommunity AdvisorAccepted solution
Community Advisor
September 9, 2021

Hi @chandrareddy 

 

If I understand correctly, you want to fetch the assets that :

  • Don't have the xyz:pubic property.

+

  • Have the xyz:pubic property with value other than 'no'

 

If yes, please try this query:

 

path=/content/dam/we-retail
nodename=metadata
group.p.or=true
group.1_property=xyz:pubic
group.1_property.operation=unequals
group.1_property.1_value=no
group.2_property=xyz:pubic
group.2_property.operation=exists
group.2_property.value=false
p.limit=-1

 

Hope this helps.

 

Thanks,

Fani

Level 2
September 9, 2021

Exactly, this is my requirement.

Let me check and confirm back. thanks a lot.