Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Smart search - exclude a phrase View modes: 
User avatar
Greg - 1/30/2014 4:31:29 AM
Smart search - exclude a phrase
Hello again,

The final problem shown up and the site is ready. Thanks for all your help.
I've added a smart search mechanism- everything works pretty well but when I browse the results I see that always the right hand side column or breadcrumb has been indexed (pulled) as a first which does not look good.

Example result:
Keyword: Travel

Related content Our people Where we've come from Awards We know we're doing something right, we're winning awards for it. Award Awarding body Date Travel Team of th...

and each results starts a similar way.

Is there a way to ignore specifically some strings to not display? Our company has "Travel" in name and we would like to exclude company name from the internal search as makes it impossible to find e.g. details about travelling. (this is a generic example).

The index is: standard
I've tried "keyword" and everything stopped working. Simple didn't help as well...

User avatar
Kentico Consulting
Kentico Consulting
Kentico_RichardS - 2/4/2014 1:55:02 AM
RE:Smart search - exclude a phrase

Thank you for your message.

You can manually remove some phrases to be searched in the first place.

You can quite easily edit the search box webpart in file -> CMSWebParts/Search/cmssearchbox.ascx.cs

In Search() method please edit it following way:

 string searchWord = txtWord.Text;
searchWord = searchWord.Replace("travel", "");
// Log "internal search" activity
Activity internalSearch = new ActivityInternalSearch(searchWord, CMSContext.CurrentDocument, CMSContext.ActivityEnvironmentVariables);

Now the world travel will not be search at all.

Hope this will help.

Kind regards,
Richard Sustek