MapperParsingException during indexing when ContentAPI Search is installed

  • Updated
Description

The following exception can occur during indexing when Content API Search is installed.

      An exception occurred while indexing (Content): MapperParsingException[failed
      to parse [ContentApiModel.leftContent.expandedValue.content.value]];
      nested: ElasticsearchIllegalArgumentException[unknown property [displayOption]];
      
Steps
  1. Check to see if there is a model property with the name Content. For instance this property would cause that error during indexing. 
    virtual public ContentArea Content {get; set}
  2. If it does not need to be indexed add the [JsonIgnore] attribute to the property.
  3. If it needs to be indexed rename the property to something else and migrate the existing data to the new property. 
    https://www.gulla.net/en/blog/renaming-an-episerver-page-property-using-a-migration-step/

Note: EPiServer.ContentDeliveryApi.Search 3.6.0 (for CMS 12) has additional logging to catch when a property name matches a Content Delivery API property. 

  • CMS Core log warning if there are duplicate field name of 2 content types in a ContentArea even if Find throws an exception or not
  • The log content has the below format: [WRN] Duplicate property name 'content1' with different types in content 'MyBlock1'(ID: 116) and 'MyBlock2'(ID: 117). The property 'mainContentArea' of content 'Alloy Plan'(ID: 6) may not be indexed.