Search Results Problem

Topics: General, Troubleshooting
Nov 18, 2011 at 12:29 PM
Edited Nov 18, 2011 at 12:31 PM

Hello,

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.

Code:

 

   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?

Thanks.
Nov 18, 2011 at 12:39 PM

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 Placement.info to hide parts you don't need inside <Match DisplayType="Summary"></Match>