hi @neha_jadhav,
IMHO the recommended solution is to implement the search using either QueryBuilder or JCR-SQL2, and to expose it via a servlet. It's important to keep the scopes and indexes lean to maintain optimal performance. On the other hand, it's advisable to reserve AEM’s CF GraphQL endpoints for structured headless content modelled as Content Fragments, rather than for site page discovery.
JCR‑SQL2 query:
SELECT page.*
FROM [cq:Page] AS page
INNER JOIN [nt:base] AS component ON ISDESCENDANTNODE(component, page)
WHERE ISDESCENDANTNODE(page, '/content/site')
AND component.[sling:resourceType] = 'apps/xyz/components/comp'QueryBuilder predicate:
path=/content/site
type=cq:PageContent
property=sling:resourceType
property.value=apps/xyz/components/comp
p.limit=-1