Episerver Search error

Vote:
 

Getting this error when searching from edit mode.

Content with id 'xyz' is of type 'Castle.Proxies.ImageFileProxy' which does not inherit required type 'EPiServer.Core.PageData'.

Please help

#132739
Aug 18, 2015 14:55
Vote:
 

Do you have Media descriptor attribute in your Image model class? 
[MediaDescriptor(ExtensionString = "jpg,jpeg,jpe,ico,gif,bmp,png")]
public class ImageFile : ImageData

Regards
/K

#132743
Edited, Aug 18, 2015 15:12
Vote:
 

Hi K Khan,

Thanks for your quick response. Yes I have MediaDescriptor defined. Have it on ImageFile and VideoFile, GenericMedia does not have any.

Thanks,

Karan

#132830
Aug 19, 2015 10:14
Vote:
 

What class does ImageFile inherit from?

#132834
Aug 19, 2015 10:33
Vote:
 

Hi Mari,

Code is like

[ContentType(GUID = "0A89E464-56D4-449F-AEA8-2BF774AB8730")]
    [MediaDescriptor(ExtensionString = "jpg,jpeg,jpe,ico,gif,bmp,png")]
    public class ImageFile : ImageData


Thanks,
Karan
#132836
Aug 19, 2015 10:58
Vote:
 

Hi Karan,

Declaration looks correct to me, another possible reason can be in code some where  you are trying to load Image and converting it to PageDat e.g.

contenLoader.Get<PageData>(ContentReference) as PageData
where ContentReference is a reference of image 

Regards
/k

#132838
Aug 19, 2015 11:23
Vote:
 

Hi,

Any maybe the index contains obsolete data. 

You could try to reindex it manually using: http://[Site address]/EPiServer/CMS/Admin/IndexContent.aspx

#132844
Aug 19, 2015 12:21
Vote:
 

Hi Grzegorz,

Thanks for your reply, I shall check that.

Thanks,

Karan

#132851
Aug 19, 2015 13:26
Vote:
 

Hi Guys,

Thank you all for your help. Figured out what the actual problem was, we had installed Find and Search both on our site. So after I disabled Find as the search provider. Search started working in edit mode. Hence it seems find was causing this conversion problem.

Thanks a lot for your response and time. God Bless You

Thanks,

Karan

#132868
Edited, Aug 19, 2015 16:49
Vote:
 

I meet this error message, too, and in my situation @K Khan is correct:

contenLoader.Get<PageData>(ContentReference) as PageData where ContentReference is a reference of image 

#174243
Jan 23, 2017 9:30
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.