Covariant search results

edit

NEST used to have a feature that allowed you to map multiple types in an index back into a covariant list.

Since types are removed in Elasticsearch 6.0 this feature is no longer supported. Because you can now explicitly inject a serializer for user types only (_source, fields etcetera) please rely on a JsonConverter that can do this out of the box e.g TypeNameHandling.All from Json.NET

https://www.newtonsoft.com/json/help/html/SerializeTypeNameHandling.htm

public class C
{
    public int Id { get; set; }
    public string Name { get; set; }
}