AdvantageCMS.Core.Common.BaseClasses Namespace
Build With Advantage

SearchIndexer..::..Dispatcher_NeedObject Method

Supplies the collaborator objects the crawler asks for. Only ParserProvider is answered; every other request is left untouched so Keyoti falls back to its default.

Namespace:  AdvantageCSP.Keyoti.SiteIndexer
Assembly:  AdvantageCSP.Keyoti.SiteIndexer (in AdvantageCSP.Keyoti.SiteIndexer.dll)

Syntax


public void Dispatcher_NeedObject(
	Object sender,
	NeedObjectEventArgs e
)

Parameters

sender
Type: Object
The dispatcher raising the event.
e
Type: NeedObjectEventArgs
The NeedObjectEventArgs instance containing the event data.

Remarks


This event fires independently of the crawl lifecycle, whenever Keyoti needs a replaceable collaborator. e.RequiredObject arrives holding the default instance, which is why the test is a type check rather than a name check — assigning over it substitutes the implementation, leaving it alone accepts the default. Never null it out.

Returning ExtendedParserProvider here is what gives the crawl a browser session capable of rendering pages, and is the reason the provider must be disposed when the plug-in is disposed. A custom indexer that only needs the shipped parsing behaviour can hand back the same type; one that needs bespoke parsing derives from ParserProvider and returns that instead.