Query Builder API: How to fetch content fragment belonging to master variation only? | Community
Skip to main content
New Participant
September 16, 2022
Solved

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

  • September 16, 2022
  • 1 reply
  • 1049 views

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.
Best answer by lukasz-m

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
September 16, 2022

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