Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sitecore - Indexing data from presentation components with non-context datasources

I have a Sitecore site where many of the pages are assembled mainly from various sublayouts pointing at datasources elsewhere in the content tree.

Here's a basic example of the problem. Someone viewing a page about apples might see the word 'apple' 10 times. However, Lucene will not index the Apple page item for that word because it's stored in other items.

I'm sure this must be a common issue but I can't seem to find any advice on it.

like image 540
Martin Davies Avatar asked Jun 16 '13 10:06

Martin Davies


1 Answers

This is a common issue and there's a solution in this screencast at 38:29:

http://www.techphoria414.com/Blog/2012/May/Sitecore_Page_Editor_Unleashed

Grab the sample code on the page and look at the class PageEditor.Unleashed.Search.DynamicFields.VisualizationField which grabs all data sources and adds their content to the "_content" field in the config

<dynamicField type="PageEditor.Unleashed.Search.DynamicFields.VisualizationField, PageEditor.Unleashed.Classes" name="_content" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
like image 97
Mark Ursino Avatar answered Oct 23 '22 10:10

Mark Ursino