I have a requirement to search any content inside all the pages of a website. I have written a query like SELECT * FROM [cq:PageContent] AS content WHERE ISDESCENDANTNODE('/content/pathoftheproject') and contains(content.*, 'search_keyword') This query is searching for a keyword which is within the page content. But most of the page content is residing inside the content fragment which is referred in the page. The seach query is not performing search within the content of the page content. Is there any way that I can alter the query or write custom code to search inside the page content and the content fragment referred inside the page content?
Content Fragments authored in site pages are from common project specific path like - /content/dam/customproject/contentfragments
If this path varies, might need additional change in logic accordingly. This is because search param might be in image/video/doc/ any other related asset you have as part of project specific DAM folder
Page root is site specific content path - /content/customproject
Content fragment component used in site pages is project specific say -customproject/components/content/contentfragment (Used in second query. If it is not consistent across pages, can remove the respective predicate and fragmentPath property check alone should be fine)