2

In our SXA site, we make use of the OOTB-rich text renderings. I was hoping the content of these would be available in the search results - pointing to the containing page as the result. I notice though that the template does not seem to be inheriting _searchable.

enter image description here

Is this the reason why I can use the search interface in azure to query the sitecore-web-index and see a matching document that has a property of:

searchable: false

I'm a bit hesitant to change the inheritance of the standard template that was provided as part of SXA for upgradeability as the content seems like something that should be searchable? Unless the search results don't handle out of the box pointing the result to the containing page (rather than to the rich text data source URL)? Or I've missed something else obvious that will fix my issue.

1 Answer 1

2

That is actually the first time I hear that someone would like to search for Rich Text data source items. On the other hand - why not!

As you noticed, by default, those items are not searchable. You need to inherit from _Searchable template. But this will only allow you to search for Rich Text data source items located in local data folders. If you would like to also search for items located under Data (/sitecore/content/TENANT/SITE/Data/Texts) you need to mark that folder as associated content explicitly:

enter image description here

After that, you will be able to search for Rich Text items:

enter image description here

Keep in mind (as you noticed) that if you change SXA item (assigning _Searchable base template), it will be overridden while upgrading SXA. A workaround for it would to clone the Rich Text and use your own data source items (which inherits from SXA ones). But to be honest, I would probably update SXA item if you have a requirement to search for Rich Text data sources.

3
  • 1
    Would this then bring back the pages that the DataSource items are on? Or just link through to the datasource items tho?\
    – Richard Seal
    May 30, 2019 at 12:33
  • Above example shows only the Rich Text data source items (Search Results are using scope which only has Rich Text data source template). May 30, 2019 at 13:27
  • Thanks @DawidRutkowski - the client wanted flexibility to add whatever content modules they liked to the page, so we're not strictly using the page content field. So even if I make the SXA items inherit _searchable it appears I would then need to do custom work with the search results to ensure the item being linked actually pointed/referred to its containing page.
    – Jen
    May 31, 2019 at 1:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.