Impossible to add more than one mapping for nested

Fixed in

EPiServer.Find 13.2.6

Created

Sep 18, 2019

Updated

Mar 20, 2020

State

Closed, Fixed and tested


Description

Steps to reproduce

  1. Create a new index.
  2. Create a console app and use the attached files Program.cs and Author.cs
  3. Run
  4. Browse https://<PROXY_URL>/<PRIVATE_KEY>/<INDEX_NAME>/NestedDummyObject$$nested/_mapping

The expected result would be to have Books$$nested and Books2$$nested in all listed indices.
The actual result is that only Books$$nested exist.

The bug
We are only checking if any mapping exists in any index for the document type NestedDummyObject$$nested, whereas we need to check if the named object field has a mapping in the document type NestedDummyObject$$nested.

To be a bit more specific: the if clause in EPiServer.Find.ClientConventions.NestedConventions.AddNestedType() on line 155 does not check what we would expect it to.

Customer impact
Any customer that runs Find API 13.2.X with a clean index gets incomplete mappings for nested objects. This affects all customers being migrated to V3.

I am not sure about the ramifications of the missing mappings, but we may get shard failures when using nested facets and sorting.