Expand my Community achievements bar.

SOLVED

Searching pages for more than one tag values

Avatar

Former Community Member

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
Former Community Member

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

View solution in original post

3 Replies

Avatar

Correct answer by
Former Community Member

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?

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----