We are following a common design pattern in Umbraco whereby we have a section (document types / nodes) defined to provide re-useable content which is embedded in a given page as required. Stuff like accordions, additional marketing info. the usual stuff you often see in side panels.
My question is, is it possible to add these extra nodes to the examine index as if they are part of the main page. So that when someone does a site search, the returned results includes the data from the other nodes, but is considered part of the main page result?
You can add whatever fields you need to the indexset you are using, and then populate them by hooking up to the GatheringNodeData event of your index provider:
using Examine;
using Umbraco.Core;
namespace App
{
public class ExamineHandler : IApplicationEventHandler
{
const string INDEX_PROVIDER = "ExternalIndexer";
public void OnApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
ExamineManager.Instance.IndexProviderCollection[INDEX_PROVIDER].GatheringNodeData += (sender, e) =>
{
// get data from other content...
// add field key and data
e.Fields.Add("KEY", "VALUE");
};
}
public void OnApplicationInitialized(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
}
public void OnApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
}
}
}
What you need is a way for Examine to cache the html output of your web pages. Shannon from Umbraco HQ discussed this on his blog some time ago, but I'm not sure if anything came of it. He laid out the concepts here.
A common umbraco design pattern and examine
We are following a common design pattern in Umbraco whereby we have a section (document types / nodes) defined to provide re-useable content which is embedded in a given page as required. Stuff like accordions, additional marketing info. the usual stuff you often see in side panels.
My question is, is it possible to add these extra nodes to the examine index as if they are part of the main page. So that when someone does a site search, the returned results includes the data from the other nodes, but is considered part of the main page result?
I hope that makes sense!
Martin
Hi,
You can add whatever fields you need to the indexset you are using, and then populate them by hooking up to the
GatheringNodeData
event of your index provider:What you need is a way for Examine to cache the html output of your web pages. Shannon from Umbraco HQ discussed this on his blog some time ago, but I'm not sure if anything came of it. He laid out the concepts here.
is working on a reply...