2014-03-02 24 views
0

我正在使用CQ 5.6.1並希望搜索標籤爲多個標籤值的頁面。例如:我想搜索所有被標記到網頁:在多個標籤值中搜索頁面

topicId =投資和語言=英語和類型=東西

我能做到這一點的標籤的單個值一樣

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

如何爲一個以上的標籤值實現它。

感謝

ANKIT

回答

1

你可以像一個人的圖所示

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' 
] 

有關查詢的更多詳細信息,請參閱this

+0

嘿非常感謝你的回答..這個工作!!!! – user972418

+0

歡迎。如果它有幫助。考慮[accpeting the answer](http://stackoverflow.com/help/someone-answers) – rakhi4110