Developer forum

Forum » Development » IIndexBuilderExtender not working in 9.5.1

IIndexBuilderExtender not working in 9.5.1

Anders Ebdrup
Anders Ebdrup
Reply

Hi Dynamicweb,

 

After upgrading a solution from 9.4 to 9.5 we are not able to build our index. This is the problem:

System.InvalidCastException: Unable to cast object of type 'Smartpage.Tiger.Products.Indexing.IndexBuilderExtender' to type 'Dynamicweb.Indexing.IndexBuilderExtenderBase`1[Dynamicweb.Ecommerce.Indexing.ProductIndexBuilder]'.    at Dynamicweb.Ecommerce.Indexing.ProductIndexBuilder.WriteDocument(IndexDocument document, Int64 currentAutoId) in C:\Dynamicweb\Dynamicweb9\05 - Modules\Dynamicweb.Ecommerce\Dynamicweb.Ecommerce-1.5\Dynamicweb.Ecommerce\Indexing\ProductIndexBuilder.vb:line 1580    at Dynamicweb.Ecommerce.Indexing.ProductIndexBuilder.ProcessProducts() in C:\Dynamicweb\Dynamicweb9\05 - Modules\Dynamicweb.Ecommerce\Dynamicweb.Ecommerce-1.5\Dynamicweb.Ecommerce\Indexing\ProductIndexBuilder.vb:line 1118    at Dynamicweb.Ecommerce.Indexing.ProductIndexBuilder.Build(IIndexWriter writer, Tracker tracker) in C:\Dynamicweb\Dynamicweb9\05 - Modules\Dynamicweb.Ecommerce\Dynamicweb.Ecommerce-1.5\Dynamicweb.Ecommerce\Indexing\ProductIndexBuilder.vb:line 241

We have extended the product index with: IIndexBuilderExtender<ProductIndexBuilder>, and I can see that this is changed in the core code:

            If Not SkipExtenders Then
                For Each extender In Extenders
                    extender.ExtendDocument(document)
                Next
            End If

Is changed to:

            If Not SkipExtenders Then
                For Each extender As IndexBuilderExtenderBase(Of ProductIndexBuilder) In Extenders
                    extender.ExtendDocument(document)
                    extender.IndexBuilder = Me
                Next
            End If

 

Should the code be fixed or should our IndexBuilderExtender be changed?

Best regards, Anders


Replies

 
Nicolai Pedersen
Reply

Hi Anders

A quick fix is to change to the base class implementation - but i will also change the code to take care of this situation - it is of course a mistake...

BR Nicolai

 
Nicolai Pedersen
Reply

TFS#55454 should fix this, in testing, and will be out with the next update of Ecommerce package.

 
Kristian Kirkholt Dynamicweb Employee
Kristian Kirkholt
Reply
This post has been marked as an answer

Hi Anders

The problem TFS#55454 "Extend index with either IIndexBuilderExtender interface and  IndexBuilderExtenderBase" has now been fixed in Package "Dynamicweb.Ecommerce" version 1.5.10

You are able to find this update in the backend Package update section.

Also the correction are part of the 9.5.3 release 

You are able to find this build in the download section:

http://doc.dynamicweb.com/releases-and-downloads/releases

Please contact Dynamicweb Support if you need any additional help regarding this.

Kind Regards
Dynamicweb Support
Kristian Kirkholt

Votes for this answer: 1

 

You must be logged in to post in the forum