I have an EPiServer 7.5+ CMS site with EPiServer Find installed. I also have a custom database containing some relevant metadata, and I would really like some of this metadata to be indexed with the pages. How can I accomplish this?
This old(?) documentation http://find.episerver.com/Documentation/dotnet-api-including-fields describes something that would work just fine, but I can not find any such thing as IncludeField. Is there any way to include extra fields before indexing a page object? Or, is there an event I could hook up to, making me add relevant data before the page object is indexed?
I found the solution myself, and blogged about it:
If your additional content is IContent you could use:
Yes, but in my case the whole point was that it was NOT an IContent, but something living in a totally different kind of database.
You could also just do the following on application startup, should work for any type:
var findClient = ServiceLocator.Current.GetInstance();
findClient.Conventions.ForInstancesOf().IncludeField(a => a.AnExtensionMethodThatReturnsSomeContent());
@Arve: No, you can not. There is no InludeField method any more.
IncludeField(...) is still available in EPiServer.Find.ClientConventions.TypeConventionBuilder
Don't seem to be able to insert a screenshot here, but take a look at this:
Absolutely NO sign of the IncludeField method...
It is on IClient and not the ContentIndexer. See Arves answer.
My reploy above went to the wrong thread; correct thread is here: http://world.episerver.com/Modules/Forum/Pages/thread.aspx?id=85490&pageIndex=1#reply