Skip to content

Inheritance from abstract type not working #1682

Closed
@bytenik

Description

@bytenik

I've got an abstract base class of type Activity and subtypes of a variety of types, including Searched.

For mappings, I fluent-mapped Activity but was forced when fluent-mapping Searched to remap everything mapped on Activity.

On the storage side, I do for example client.Index<Activity>(instanceOfSearched, x => x.Index("Activities").Type(typeof(Searched))).

When I search, using client.Search<Activity>(x => x.Indices("Activity").AllTypes().MatchAll()), I get JsonSerializationExceptions based around an inability to instantiate Activity because it is abstract. It doesn't seem to notice that the stored type is actually a Searched.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions