Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.

path.exact , path.self does not work

Avatar

Level 7

I am trying below query 

 

type=dam:Asset
path=/content/dam/iinvestor/qa
path.self=true

 

returning two results, why?

sreenu539_0-1664310962742.png

when I try below query

 

type=dam:Asset
path=/content/dam/iinvestor/qa
path.exact=true

 

 

 No results at all 

sreenu539_1-1664311040094.png

 

I am trying to get a dam:Asset by providing exact path in path value.

 

I am in need of writing multiple groups for each path, as path could be a parent dam folder or exact content fragment path.

 

8 Replies

Avatar

Level 7

There is a change in requirement , so this would be different. I would like to get node by itself when path is dam:Asset and in another scenario path would be parent folder path. I am trying the first part where path is dam:Asset not a folder.

Avatar

Level 5

@sreenu539 

path.self=true : If true searches the subtree including the main node given in path, if false searches the subtree only

 

You see two results because those exist as a subtree of it.

 

Now when you do path.exact=true, that looks for the exact path however since you have another condition i.e. type=dam:Asset hence no result is returned.

 

The exact path that you have put doesn't have type as dam:Asset.

 

For multiple group, can you elaborate your problem better with example so that I could help you out accordingly?

Avatar

Level 7

This is not correct. node structure does not have any nodes below /qa

 

sreenu539_1-1664371883186.png

 

Avatar

Level 5

@sreenu539 

The path does relative matching, check for:

/content/dam/iinvestor/qa2

 

and you will see the difference. qa is present in both of your nodes, see the xpath it puts a * at end meaning wildcard match.

 

 

Can you tell me exactly which data you want to fetch out of all those and also please share the snapshot of their schema.

Avatar

Level 4

HI @sreenu539 ,

 

Can you share the node structure for 

/content/dam/iinvestor/qa

 

'path.self=true' includes the subtree including the node given in the path value.

 

SwetaB_1-1664342776416.png

 

 

'path.exact=true' does not include the subtree.

 

SwetaB_0-1664342697262.png

 

 

 

Thanks,
Sweta

Avatar

Level 1

 'path.self=true' gets the path itself, its children and grandchildren nodes in the result. (Not the siblings).

Try testing the first query for different node structure.

 

While 'path.exact=true' gets the direct child only (Not the path in the path value nor the grandchildren). 

Since there are no assets as child, under the 'qa' node there is no results.

 

So for your requirement to get the node by itself, you need to use 'path.self=true'.