2015-02-23 32 views

回答

6

您可以使用JcrPropertyPredicateEvaluator來實現相同。

假設您正在搜索的所有dam:Asset的,其dam:MIMEtype開始與image/路徑/content/dam查詢將

path=/content/dam 
type=dam:Asset 
property=jcr:content/metadata/dam:MIMEtype 
property.value=image/% 
property.operation=like 
p.limit=-1 

相應的XPath查詢是

/jcr:root/content/dam//element(*, dam:Asset) 
[ 
jcr:like(jcr:content/metadata/@dam:MIMEtype, 'image/%') 
] 

您可以嘗試執行在實例的查詢調試器(/libs/cq/search/content/querydebug.html)中查詢上述查詢並驗證結果是否正確。

PredicateEvaluator DocsQueryBuilder API可能會提供關於編寫查詢的更多見解。

相關問題