Expand my Community achievements bar.

SOLVED

Query Builder Help

Avatar

Level 3

Hi,

 

I'm new to writing queries and I'm having trouble with a particular use case. Our DAM has a section organized in projects. Each project follows this same path: /content/dam/marketing-assets/<Region Name>/<Year>/<Project Name>/source-files/<File>

 

I want to run a query that identifies all files that are in folders with the name "source-files". I've experimented with the "path" predicate and wildcards ( * ) with no luck. Any advice on how to do this? I'm open to alternatives that would get the same results.

 

Thank you,

Morgan

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @MorganMeik 

 

You can try the below query - 

path=/content/dam
type=dam:Asset
group.1_property.value=%source-files%
group.1_property=jcr:path
group.1_property.operation=like
p.limit=10

View solution in original post

3 Replies

Avatar

Community Advisor

Hi,

I believe what you are looking for is to use a "regex" in the path property, which, unfortunately, is not supported. According to the documentation, the usage of a wildcard is reserved for searches that use the "exact" property (meaning no descendants).

So, you may have two options:

  1. Perform an initial query to get a list of all the paths that have a folder named "source-files". Then, use the result of this first query to append each path as part of your second query.

 

 

group.1_path=/content/my/folder/result/1
group.2_path=/content/my/folder/result/2

 

2. Consider using a leveled path approach to include all folders. Just keep in mind that this might lead to performance issues, which you can address by implementing indexes.


Hope this helps 



Esteban Bustamante

Avatar

Correct answer by
Community Advisor

Hi @MorganMeik 

 

You can try the below query - 

path=/content/dam
type=dam:Asset
group.1_property.value=%source-files%
group.1_property=jcr:path
group.1_property.operation=like
p.limit=10

Avatar

Community Advisor

@MorganMeik Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.