Martin Davies
Martin Davies

Reputation: 4456

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.

Upvotes: 5

Views: 1068

Answers (1)

Mark Ursino
Mark Ursino

Reputation: 31435

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" />

Upvotes: 10

Related Questions