Full Text Search to Content Fragment's Experience Fragment that is Linked by Page Properties | Community
Skip to main content
Level 6
June 22, 2023
Solved

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

  • June 22, 2023
  • 2 replies
  • 675 views

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?

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by aanchal-sikka

hello @supportmember 

 

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

2 replies

Tanika02
Level 7
June 23, 2023

Hello @supportmember  - 

 

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.

 

aanchal-sikka
Community Advisor
aanchal-sikkaCommunity AdvisorAccepted solution
Community Advisor
June 23, 2023

hello @supportmember 

 

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