AEM allows me to query against a REST API like so:
Search for pages tagged with a certain tag
1 type=cq:Page 2 tagid=marketing:interest/product 3 tagid.property=jcr:content/cq:tags
However what if I want all pages that don't include a certain tag?
1 type=cq:Page
2 tagid=marketing:interest/product
3 tagid.property=jcr:content/cq:tags
In xPath I can do something like:
//jcr:content/cq:tags[not(@tagId = 'marketing:interest/product')]
Is this possible through the REST API?
Here you go:
path=/content/some/path/you/need
type=cq:Page
group.1_fulltext=marketing:interest/product
group.1_fulltext.relPath=jcr:content/@cq:tags
group.p.not=true
what correpsonds to next xpath query:
/jcr:root/content/some/path/you/need//element(*, cq:Page) [ not(jcr:contains (jcr:content/@cq:tags, 'marketing:interest/product')c) ]
.
Also you can add p.limit=[some number]
to get more than 10 results.
Some interesting info you can find there and more about available predicates (check implementing classes).