Expand my Community achievements bar.

SOLVED

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

Avatar

Level 5

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?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

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