Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events
SOLVED

AEM search

Avatar

Level 1

I am executing below mentioned query  on my project content but getting searched term on experience fragments also in the results which is not expected can someone provide a solution  ?

 

path=/content/test/us/en/test-folder
type=cq:Page
fulltext=circuits
1_property.value=/conf/test/settings/wcm/templates/mvp-content-page
1_property=jcr:content/cq:template
1_property.operation=like

 

 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @mayuri261191 ,

 

This is because jcr:primaryType of Experience Fragments are also cq:Page only. And, also the EF and content pages are created with same template (/conf/test/settings/wcm/templates/mvp-content-page or since you have used like keyword so may be EF template also has the same sub name).

 

Ideally, we should create separate content hierarchy for Experience Fragment and content pages, something like below-

 

/content/my-project-experience-fragment/....

/content/my-project-pages/..

 

Reason is, because EF you are going to include on the content pages, and in  case of any search implementation than we just want to search content under content pages. 

 

Now for your case, if you can not have separate paths for content and EF, try finding some unique property on the content pages, which are not there on EF and then add that property check i the query.

 

Hope it helps!

 

Thanks,

Ritesh Mittal

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi @mayuri261191 ,

 

This is because jcr:primaryType of Experience Fragments are also cq:Page only. And, also the EF and content pages are created with same template (/conf/test/settings/wcm/templates/mvp-content-page or since you have used like keyword so may be EF template also has the same sub name).

 

Ideally, we should create separate content hierarchy for Experience Fragment and content pages, something like below-

 

/content/my-project-experience-fragment/....

/content/my-project-pages/..

 

Reason is, because EF you are going to include on the content pages, and in  case of any search implementation than we just want to search content under content pages. 

 

Now for your case, if you can not have separate paths for content and EF, try finding some unique property on the content pages, which are not there on EF and then add that property check i the query.

 

Hope it helps!

 

Thanks,

Ritesh Mittal