문제

I am using CQ 5.6.1 and want to search pages that are tagged to more than one values of tags. For example: I want to search all the pages that are tagged to:

topicId=investment and language=english and type = something

I can do it for single value of tag like

    searchMap.put(tagid, topicId);
    searchMap.put(tagid.property, @jcr:content/cq:tags);

How can I implement it for more than one values of tags.

Thanks

Ankit

올바른 솔루션이 없습니다

다른 팁

You can add as many tagid's you want by specifying number prefixes like the one's shown below

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");

The above query is similar to the following XPath query

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

For more details on queries, refer this

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top