Searching pages for more than one tag values | Community
Skip to main content
October 16, 2015
Solved

Searching pages for more than one tag values

  • October 16, 2015
  • 3 replies
  • 879 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by

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

Accepted solution
October 16, 2015

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

dnelson42
Level 2
October 16, 2015

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?

smacdonald2008
Level 10
October 16, 2015

Nice work