Query Builder API: How to fetch content fragment belonging to master variation only? | Community
Skip to main content
Level 4
Sep 16, 2022 4:22 AM UTC
Solved

Query Builder API: How to fetch content fragment belonging to master variation only?

I have a query for querybuilder API like this:

 

```

type=nt:unstructured
path=/content/dam/articles/
property=articleContent@ContentType
property.value=text/x-markdown
p.hits=selective
p.properties=featuredImage

```

 

However I would like to use it as:

 

```

type=nt:unstructured
path=/content/dam/articles/*.master
property=articleContent@ContentType
property.value=text/x-markdown
p.hits=selective
p.properties=featuredImage

```

 

as the results give me content fragment which are both master and other variations too. How can I achieve the same? Can I pass in some regex in path?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
lukasz-m
lukasz-mAccepted solution
New Participant
Sep 16, 2022 10:17 AM UTC

Hi @spidey1405,

If I good understand your case, you would like to get only master variation of content fragment. Assuming that master variation is stored under master node, you can consider to use nodename predicate:

So sample query could look like this:

type=nt:unstructured
path=/content/dam
nodename=master

 This gives me list of master variations of CF that are located under /content/dam

1 reply

lukasz-m
lukasz-mAccepted solution
New Participant
Sep 16, 2022 10:17 AM UTC

Hi @spidey1405,

If I good understand your case, you would like to get only master variation of content fragment. Assuming that master variation is stored under master node, you can consider to use nodename predicate:

So sample query could look like this:

type=nt:unstructured
path=/content/dam
nodename=master

 This gives me list of master variations of CF that are located under /content/dam

Translate