Expand my Community achievements bar.

SOLVED

Full Text Search to Content Fragment's Experience Fragment that is Linked by Page Properties

Avatar

Level 6

Hi there,

I have a list of pages which that uses a relative path to connect to an content fragment. The content fragment now then now has a property the points it to a Experience Fragment. I would like to perform full text search on:

The Page, and all it's page properties

The Content Fragment, and all it's page properties

And also the Experience Fragment, and all it's body text.

 

How would I perform a full text search like this, can someone please explain?

AEMWizard_0-1687478380020.png

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

hello @AEMWizard 

 

In your case, the primary type of the content is different

 

Page: cq:Page

XF: cq:Page

CF: dam:Asset

 

I would suggest to break the Query into 2 pieces.

 

1. Pages + XF: Here you can use the path predicate to specifically query these Page and XF 

 

1_group.1_path=/content/site/<path of the page>

1_group.2_path=/content/<path of XF>

1_group.p.or=true

fulltext=abc

type=cq:Page

 

2. If the text is not found above, check in CF

path=/content/<path of CF>

fulltext=abc

type=dam:Asset

 

This would assure that the queries perform well and use the correct indexes


Aanchal Sikka

View solution in original post

2 Replies

Avatar

Community Advisor

Hello @AEMWizard  - 

 

Please try below query : 

 

path:/content(/.*)?
group.p.or=true
group.1_fulltext={searchTerm}
group.1_fulltext.relPath=jcr:content/@*
group.2_fulltext={searchTerm}
group.2_fulltext.relPath=jcr:content/renditions/@*
group.3_fulltext={searchTerm}
group.3_fulltext.relPath=jcr:content/experiencefragment/@*
p.limit=-1

 

This query performs a full-text search on page properties, content fragment properties, and experience fragment body text.

 

Avatar

Correct answer by
Community Advisor

hello @AEMWizard 

 

In your case, the primary type of the content is different

 

Page: cq:Page

XF: cq:Page

CF: dam:Asset

 

I would suggest to break the Query into 2 pieces.

 

1. Pages + XF: Here you can use the path predicate to specifically query these Page and XF 

 

1_group.1_path=/content/site/<path of the page>

1_group.2_path=/content/<path of XF>

1_group.p.or=true

fulltext=abc

type=cq:Page

 

2. If the text is not found above, check in CF

path=/content/<path of CF>

fulltext=abc

type=dam:Asset

 

This would assure that the queries perform well and use the correct indexes


Aanchal Sikka