Ok. The problem is with the smart search box webpart i.e. ~/CMSWebParts/SmartSearch/SearchBox.ascx.
PredictiveSearchCondition property does not resolve macro . It is missing ContextResolver.ResolveMacroExpression(...)
or LocalResolver.ResolveMacros(..)
or similar.
The current code is:
public string PredictiveSearchCondition
{
get
{
return ValidationHelper.GetString(GetValue("PredictiveSearchCondition"), null);
}
set
{
SetValue("PredictiveSearchCondition", value);
}
}
It should be for example:
get
{
return LocalResolver.ResolveMacros(ValidationHelper.GetString(GetValue("PredictiveSearchCondition"), null));
}
So you can clone this control and create SearchBoxCustom which would be a copy of existing one but you add macro resolver yourself. Or you can do it in pure ASP way if you are not planning not to use macros:
PredictiveSearchCondition='<%# String.IsNullOrEmpty(Request.QueryString["searchtext"])? "": "herotitle:(Request.QueryString[\"searchtext\"])" %>