How to remove web parts from being smart searched

Kayla Johnson asked on October 27, 2017 18:28

I'm setting up the search on our client site and the results it pulls back in the Content is kind of strange. For example. One Content for a Page is :

"This page is about travel docs and stuff ~/Files/assets/header.aspx?width=896&height=535&ext=.jpg Our Company Travel Policies & Forms"

Where the first part is an editable text web part. Next it is pulling an editable image. Followed by another editable text, which oddly comes before the other editable text web part in the layout.

Another search result is this:

"~/Files/assets/header.aspx?ext=. Our Company Leading Performance We work to give you greater choices outside of work when it comes to your health and wellness. To learn more about these benefits and resources, please explore the links within this section. From in..."

This time the editable image is first, then the first editable text, then the last editable text.

1) It seems there is no pattern for how this content is pulled. Is there a way to organize how parts gets pulled.

2) How can I remove editable image web parts from being pulled in these results?

I should state that I don't have access to the file system. I'm working just on the web.

Correct Answer

Rui Wang answered on October 27, 2017 19:15

Is this "This page is about travel docs and stuff ~/Files/assets/header.aspx?width=896&height=535&ext=.jpg Our Company Travel Policies & Forms" showing up as the teaser for the search result?

I think for the Page page type, the content data entered via Editable text and image would be combined to generate the summary and it would look random depend on the order those web parts are added to the template.

You have two options. 1. is not to display the teaser for Page page type. 2. is to create a more meaningful teaser. to do that, you can add a filed call "teaser" as a text filed to the Page page type. Then in the search tab of that page type, map the "teaser" field to the "Content" for search result. This way, you can manage a more meaningful teaser instead of the first X characters of the page data combined.

0 votesVote for this answer Unmark Correct answer

Recent Answers

Brenden Kehren answered on October 27, 2017 18:34 (last edited on October 27, 2017 18:34)

How is your smart search index setup?

What index type are you using?

What content have you included or excluded?

Check out the documentation on setting up a smart search index and what each of the properties means.

0 votesVote for this answer Mark as a Correct answer

Rui Wang answered on October 27, 2017 18:34

Can you check the search result page, find out what index is it using, then go to Smart Search application and find out what kind of configuration does that index use, e.g. index type, analyzer type, type of content it indexed.

Also, what does the search result display look like? can you post a screenshot here? can you look into the transformation for search result and see what value does it display.

0 votesVote for this answer Mark as a Correct answer

Kayla Johnson answered on October 27, 2017 18:56

Index type is Pages Analyzer type is Standard

This is the transformation

<div class="post-preview search-result">
    <%# IfImage("Image", "<img src='"+GetSearchImageUrl("",90)+"'>", "") %>
    <div class="paragraph short search-result-content">
        <a class="underline" href="<%# SearchResultUrl(true) %>">
        <%# SearchHighlight(HTMLHelper.HTMLEncode(CMS.ExtendedControls.ControlsHelper.RemoveDynamicControls(DataHelper.GetNotEmpty(Eval("Title"), "/"))),"<span style=\"font-weight:bold;\">","</span>") %>
    <h6 class="darker-blue"><%# FormatDateTime(Eval("Created"), "MMMM dd, yyyy ") %></h6>
    <p><%# SearchHighlight(HTMLHelper.HTMLEncode(TextHelper.LimitLength(HttpUtility.HtmlDecode(HTMLHelper.StripTags(CMS.ExtendedControls.ControlsHelper.RemoveDynamicControls(GetSearchedContent(DataHelper.GetNotEmpty(Eval("Content"), ""))), false, " ")), 280, "...")),"<strong>","</strong>") %></p>
0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.