Umbraco Examine GatheringNodeData Event Never Fires
I am subscribing to the GatheringNodeData event, I can confirm that the event subscription is successful when the application starts up yet my handler is never called - anyone else had this in 4.9.0?
public class EventHandlers : ApplicationStartupHandler
{
public EventHandlers()
{
var searchIndexer = ExamineManager.Instance.IndexProviderCollection["SiteSearchSearcher"];
searchIndexer.GatheringNodeData += this.SearchIndexerGatheringNodeData;
}
private void SearchIndexerGatheringNodeData(object sender, IndexingNodeDataEventArgs e)
{
if (e.IndexType == IndexTypes.Content)
{
// Extract root node ID from path:
try
{
string rootNodeId = e.Fields["path"].Split(',')[1];
e.Fields.Add("siteId", rootNodeId);
}
catch (Exception ex)
{
Log.Add(LogTypes.Error, -1, string.Concat("Failed to add rootNodeId to index: ", ex));
}
}
}
Umbraco Examine GatheringNodeData Event Never Fires
I am subscribing to the GatheringNodeData event, I can confirm that the event subscription is successful when the application starts up yet my handler is never called - anyone else had this in 4.9.0?
Aha, you need your indexer instead of searcher, so should be
var searchIndexer =ExamineManager.Instance.IndexProviderCollection["SiteSearchIndexer"];
Cheers,
/Dirk
Well spotted! Thanks mate, 12 hours in front of my computer is obviously not helping my productivity now and still got more to do this evening :(
is working on a reply...