Expand my Community achievements bar.

SOLVED

Requirement on Query builder

Avatar

Level 2

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

 

 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

View solution in original post

6 Replies

Avatar

Community Advisor

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

Avatar

Level 2

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'.

Avatar

Community Advisor

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

Avatar

Level 2

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

Thank you

Avatar

Correct answer by
Community Advisor

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

Avatar

Level 2

Exactly, this is my requirement.

Let me check and confirm back. thanks a lot.