Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
We used to do this (to add some extra data to Examine index for certain nodes)
ExamineManager.Instance..IndexProviderCollection[defaultIndexIndexer].GatheringNodeData += IndexHandler_GatheringNodeData;
Now this doesn't seem to work anymore. IndexProviderCollection isn't available.. Is there any other way to init this event ?
GatheringNodeData has been removed/consolidated in the version of Examine shipped with V8
The event you want to handle instead is 'TransformingIndexValues' event
you can see this in the source code:
/// Raised before the item is indexed allowing developers to customize the data that get's stored in the index
public event EventHandler<IndexingItemEventArgs> TransformingIndexValues;
/// Raises the <see cref="E:TransformingIndexValues"/> event.
/// <param name="e">The <see cref="IndexingItemEventArgs"/> instance containing the event data.</param>
protected virtual void OnTransformingIndexValues(IndexingItemEventArgs e)
which is available here:
Not seen any examples yet, but hopefully that's a good steer.
Ok, that makes sense, thank you.
Now I only need to know how to get the instance of the IndexProvider (for ExternalIndex) to attach the event... Since there isn't an IndexProviderCollection in ExamineManager.Instance, can you tell me where I can find it nowadays?
It's a bit of a guess, but essentially everything is injected via DI in Umbraco V8...
So to get a reference to the Examine Manager you need to add it to the constructor for your Component, and it will be magically injected in, the Examine Manager has a list of indexes, if you pull the one you want to handle the event for and cast it to a BaseIndexProvider then that should expose the TransformingIndexValues event...
but I'm only guessing from the source and intellisense!
[RuntimeLevel(MinLevel = RuntimeLevel.Run)]
public class RegisterExamineEventComposer : IUserComposer
public void Compose(Composition composition)
// Append our component to the collection of Components
// It will be the last one to be run
public class RegisterExamineEventsComponent : IComponent
private readonly IExamineManager _examineManager;
public RegisterExamineEventsComponent(IExamineManager examineManager)
_examineManager = examineManager;
public void Initialize()
var externalIndex = _examineManager.Indexes.Where(f => f.Name == "ExternalIndex");
((BaseIndexProvider)externalIndex).TransformingIndexValues += TreeNodesRenderingComponent_TransformingIndexValues;
private void UmbracoExamineIndex_TransformingIndexValues(IndexingItemEventArgs e)
// do stuff here with the index values like gathering nodedata did
Great! Still don't really understand how objects are magically injected in IComponents, but it seems to work :-)
it is dark magic I think...
It's a mess... As we can not change how your field will be indexed (Analyzed, not, stored, not stored ?) ... So now I index tags... and there is nothing I can do with it... I don't want half tags to be found !
Any updates on how to achieve this now? Looking at migrating a V7 site over that uses GatheringNodeData and came across this post.
Appears Nik has already answered this one so adding here for completeness :)
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted