Solved
Get SearchResult list using SQL2
I have a SQL2 query that returns the pages that include content matching my search terms. I'm using
javax.jcr.query.QueryResult to get the results. I'd like to use
com.day.cq.search.result.SearchResult so I have excerpts to use. How can I convert this SQL2 query to predicates? Or is there a better way to go about this?
SELECT DISTINCT page.*
FROM [cq:Page] AS page
INNER JOIN [cq:PageContent] AS content
ON ISCHILDNODE(content, page)
INNER JOIN [nt:base] AS node
ON ISDESCENDANTNODE(node, content)
WHERE ISDESCENDANTNODE(page, [/content/mysite/en])
AND CONTAINS(node.*, 'mysearchterm')";