Search Results Problem

Topics: General, Troubleshooting
Nov 18, 2011 at 11:29 AM
Edited Nov 18, 2011 at 11:31 AM


I added my custom module to search index and I can search my content successfully. But the search results view displays the whole widget which contains the content. I want to show only the content in the search results.



   OnIndexing<NewsPart>((context, newsPart) => context.DocumentIndex
                                                   .Add("newsPart_title", newsPart.Title).Analyze().Store()
                                                   .Add("newsPart_summary", newsPart.Summary).Analyze().Store()
                                                   .Add("newsPart_description", newsPart.Description).Analyze().Store()

What is wrong with my code?

Nov 18, 2011 at 11:39 AM

Nothing's wrong with your indexing code. Search results just displays the content item in "Summary" display (nothing to do with your indexing). It sounds like you've added NewsPart to a widget and allowed that widget to be indexed? You can use to hide parts you don't need inside <Match DisplayType="Summary"></Match>