Does AEM Query builder API allow searching the Content Fragment Core component's content included within a Page? | Community
Skip to main content
Level 2
September 23, 2019

Does AEM Query builder API allow searching the Content Fragment Core component's content included within a Page?

  • September 23, 2019
  • 1 reply
  • 15666 views

Hi All,

Please advise if AEM Query builder API supports searching of Content Fragment's (Adobe's Core component) content included within a Page.

I have added a Content Fragment core component on an empty content page (newly created) and authored all the required values for the component including fragmentPath. The component renders as expected and displays the Content Fragment data. However, when I tried searching for the data within content fragment using the following sample queries through Query Builder Debugger, it did not return any results. I am not sure if any new predicates are needed to enable the search functionality for content fragments.

Query Builder query 1:

type=cq:Page

path=<search path>(e.g., /content/we-retail/us/en)

fulltext=<searchterm> (e.g., winter)

Query Builder query 2:

type=cq:Page

path=<search path>(e.g., /content/we-retail/us/en)

fulltext=<searchterm> (e.g., winter)

contentfragment

AEM Version: 6.3.3.0

AEM Core Components Version: 2.5.0

Any advise or guidance would be greatly appreciated. Thank you in advance.

kautuk sahni  smacdonald2008

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Adobe Employee
September 23, 2019

You can try a query similar to:

type=nt:unstructure

path=/content/we-retail/us

1_group.1_property=sling:resourceType

1_group.1_property.value=weretail/components/content/contentfragment

fulltext=winter

Level 2
September 23, 2019

berliant​ Thanks for your prompt reply!

However, the provided query does not seem to work (no search results) for the specified scenario (Trying to search content fragment component data included within page).

type=nt:unstructured

path=/content/we-retail/us/en

1_group.1_property=sling:resourceType

1_group.1_property.value=weretail/components/content/contentfragment

fulltext=winter

Please note that the actual content fragment data is not being saved within page node structure as it is only being referenced through the "fragmentPath" property. Also, the core content fragment component has already been proxied under we-retail directory/project - "/apps/weretail/components/content/contentfragment". Let me know if you have any questions.

Level 2
February 17, 2021

@pravinb2619228 Find below the recommended solution or workaround provided by Adobe Support for the full text search to work with content fragment component


After installing the AEM core wcm components package of version 2.4.0 or later (e.g., core.wcm.components.all-2.4.0.zip), install the AEM core wcm components extension package containing required content fragment component (e.g., core.wcm.components.extension-1.0.12.zip)

 

After installing the packages as specified, the AEM instance would contain both:
* /apps/core/wcm/extension/components/contentfragment/v1/contentfragment
* /apps/core/wcm/components/contentfragment/v1/contentfragment


Adobe support team recommended to use the contentfragment component under wcm extension directory (/apps/core/wcm/extension/components/contentfragment/v1/contentfragment) and also confirmed that the specified workaround can be used within production implementations. Also as long as you have core.wcm.components.extension-1.0.12.zip package installed, upgrading to newer core component versions in the future should not impact the contentfragment functionality, as long as the wcm core component package(s) (core.wcm.components.all-*.zip & core.wcm.components.examples-*.zip) are compatible with your AEM instance.


Please feel free to reach out to me if you have any additional questions.

 

@leoberliant FYI


Thanks @nagarjunav!! Really appreciate your response 🙂
I installed the core.wcm.components.extension-1.0.12.zip on my local (in addition to Core component 2.12.0) & full-text search works!.
I see that it now adds a "text" property to the CF content node. Were you able to figure out how this text property is added ?

I'd rather add the fix than use the CF component from extensions package because we have overlaid/extended the core CF component  & updated contentfragment.html as per project requirements.

FYI These files are not the same:
/apps/core/wcm/extension/components/contentfragment/v1/contentfragment/contentfragment.html

/apps/core/wcm/components/contentfragment/v1/contentfragment/contentfragment.html