Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list
SOLVED

Searching pages for more than one tag values

Avatar

Level 3

Hi,

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

1 Accepted Solution

Avatar

Correct answer by
Level 3

This issue has resolved by using:

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

 

Ankit

3 Replies

Avatar

Correct answer by
Level 3

This issue has resolved by using:

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

 

Ankit

Avatar

Level 2

I was also looking this, but I also want to control logical and/or for the multiple tag values. Also the normal tagid property takes into account merged tags, this one does not appear to do that. Any ideas?