I am adding a custom field to my index, so I can search through tagged multi-node tree picker content. The below works fine, however it appears to be triggered before the content is published making the field content out of date.
public class AppEvents : IApplicationEventHandler
{
public void OnApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
var helper = new UmbracoHelper(UmbracoContext.Current);
ExamineManager.Instance.IndexProviderCollection[GlobalSettings.Indexer.MediaTileIndexer].GatheringNodeData
+= (sender, e) => ExamineEvents.GatheringContentData(sender, e, helper);
}
}
public static class ExamineEvents
{
public static void GatheringContentData(object sender, IndexingNodeDataEventArgs e, UmbracoHelper helper, List<string> docTypes)
{
var content = helper.TypedContent(e.NodeId);
if (content != null){
var text = content.GetPropertyValue<string>("text");
// content is not current.
}
}
}
As an aside, I've noticed there hasn't been much noise on google about this approach since 2015. Feeling like I'm missing a trick. I'm using 7.71
Adding custom field to index
I am adding a custom field to my index, so I can search through tagged multi-node tree picker content. The below works fine, however it appears to be triggered before the content is published making the field content out of date.
As an aside, I've noticed there hasn't been much noise on google about this approach since 2015. Feeling like I'm missing a trick. I'm using 7.71
is working on a reply...