Tags 在页面中搜索多个标记值

Tags 在页面中搜索多个标记值,tags,aem,Tags,Aem,我正在使用CQ 5.6.1,希望搜索标记为多个标记值的页面。例如:我要搜索标记为以下内容的所有页面: topicId=投资和语言=英语和类型=某物 我可以为标签的单个值这样做 searchMap.put(tagid, topicId); searchMap.put(tagid.property, @jcr:content/cq:tags); 如何为多个标记值实现它 谢谢 Ankit通过指定如下所示的数字前缀,您可以添加任意数量的tagid searchMap.put("type

我正在使用CQ 5.6.1,希望搜索标记为多个标记值的页面。例如:我要搜索标记为以下内容的所有页面:

topicId=投资和语言=英语和类型=某物

我可以为标签的单个值这样做

    searchMap.put(tagid, topicId);
    searchMap.put(tagid.property, @jcr:content/cq:tags);
如何为多个标记值实现它

谢谢


Ankit

通过指定如下所示的数字前缀,您可以添加任意数量的tagid

searchMap.put("type", "cq:Page");
searchMap.put("1_tagid", topicId);
searchMap.put("1_tagid.property", "jcr:content/cq:tags");
searchMap.put("2_tagid", anothertopicId);
searchMap.put("2_tagid.property", "jcr:content/cq:tags");
上面的查询类似于下面的XPath查询

//element(*, cq:Page) [
jcr:content/@cq:tags = 'marketing:interest/business' and jcr:content/@cq:tags = 'marketing:interest/product' 
]

有关查询的更多详细信息,请参阅

Welcome。以防有帮助。考虑