Adding bool to indexed content using projection cause exception

Fixed in

EPiServer.Find 13.2.8

Created

May 29, 2020

Updated

Jul 23, 2020

State

Closed, Fixed and tested


Description

Adding a bool to an existing class that already have been indexed by content, and using the new property in projection will cause an exception

Steps to reproduce:
1. Index the Alloy site
2. Add the following search query in StartPageController:
SearchClient.Instance.Search<StandardPage>()
.Select(x => new

{ x.MainBody }

)
.GetResult();
3. Add a new property of typ bool in StartPage class
public class StandardPage : SitePageData
{
...
public virtual bool Testing

{ get; set; }

...
}
4. Add the new property to our projection in (2)
SearchClient.Instance.Search<StandardPage>()
.Select(x => new

{ x.MainBody, x.Testing }

)
.GetResult();
5. Start the site and go to the start page

Expected: No exception
Actually: Exception is thrown