xpath - 使用Querybuilder从结果中排除标签

标签 xpath aem jcr

AEM允许我针对REST API进行查询,如下所示:


搜索带有特定标签的页面

http://localhost:4502/bin/querybuilder.json?type=cq:Page&tagid=marketing:interest/product&tagid.property=jcr:content/cq:tags

1 type=cq:Page
2 tagid=marketing:interest/product
3 tagid.property=jcr:content/cq:tags



但是,如果我要所有不包含特定标签的页面怎么办?

 1 type=cq:Page
 2 tagid=marketing:interest/product
 3 tagid.property=jcr:content/cq:tags


在xPath中,我可以执行以下操作:

//jcr:content/cq:tags[not(@tagId = 'marketing:interest/product')]


是否可以通过REST API?

最佳答案

干得好:

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

什么对应于下一个xpath查询:
/jcr:root/content/some/path/you/need//element(*, cq:Page) [ not(jcr:contains (jcr:content/@cq:tags, 'marketing:interest/product')c) ]
您也可以添加p.limit=[some number]以获得10个以上的结果。
您可以找到一些有趣的信息theremore about available predicates(检查实现类)。

关于xpath - 使用Querybuilder从结果中排除标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34047045/

相关文章:

aem - 在 CQ5 中待激活

adobe - 从对话框中获取复选框的值

servlets - AEM Servlet 响应作者删除链接

Xpath,两个值之间的范围,如何?

c# - 抓取位于 div 正下方的 html

java - JCR按路径查询

java - Jackrabbit 更新或合并节点

jcr - 如何在jcr中获取节点属性的数组值

xml - 如何使用 XSLT 按属性过滤数据?

html - Xpath找不到元素