Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

AEM QueryBuilder: How to use contentfragment property?

Avatar

Level 3

I was going through the documentation of predicates supported in querybuilder API: https://experienceleague.adobe.com/docs/experience-manager-65/developing/platform/query-builder/quer...

 

Where I see:

spidey1405_0-1663304030891.png

 

But I am not sure how to use it?

I tried keeping it as is:

```

type=nt:unstructured
path=/content/dam/rallyhealth/ichabod/articles
p.hits=selective
nodename=master
p.properties=author featuredImage

contentfragment

```

 

I also tried:

```

type=nt:unstructured
path=/content/dam/rallyhealth/ichabod/articles
p.hits=selective
nodename=master
p.properties=author featuredImage

contentfragment=article

```

But all of this return no response. Can someone help me understand how can one use it?

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @spidey1405,

In general contentFragment predicate checks, if there is a contentFragment property with true value, located under jcr:content node. Base on that contentFragment predicate decides if given resource is recognized as content fragment or not and if it should be included in the results.

cf-crx.jpg

How to use it? Here is an example of predicate - it worked correct, and I get CF only as a result.

type=dam:Asset
path=/content/dam
contentfragment

contentFragment predicate does not require any additional value if you want to use it. Using contentFragment keyword in query will be enough. However I believe it will only return proper results if you will use it with dam:Asset type. At least it was working for me with dam:Asset type, which make sens because this will allow to use dedicated index related to dam:Asset type.

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi @spidey1405,

In general contentFragment predicate checks, if there is a contentFragment property with true value, located under jcr:content node. Base on that contentFragment predicate decides if given resource is recognized as content fragment or not and if it should be included in the results.

cf-crx.jpg

How to use it? Here is an example of predicate - it worked correct, and I get CF only as a result.

type=dam:Asset
path=/content/dam
contentfragment

contentFragment predicate does not require any additional value if you want to use it. Using contentFragment keyword in query will be enough. However I believe it will only return proper results if you will use it with dam:Asset type. At least it was working for me with dam:Asset type, which make sens because this will allow to use dedicated index related to dam:Asset type.