-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
NEST/Elasticsearch.Net version:
7.0.0-alpha1
Elasticsearch version:
7.0.0
Description of the problem including expected versus actual behavior:
Actual
Even though mapping types have been removed in Elasticsearch 7.x, option to set name of the class for serialization is still useful when using fluent/strongly-type interfaces.
- When defining
Join
in index mapping:
_client.CreateIndexAsync(IndexName,
index => index.Map<MyDocument>(
tmd => tmd.AutoMap()
.Properties(
props => props.Join(
j => j.Name(p => p.Relationship)
.Relations(
r => r.Join<ParentType, ChildType>()
)
)
)
)
);
- When linking instances of child types to parent types:
var parent = new ParentType { Id = 1 };
var parentDoc = new MyDocument
{
Parent = parent,
Relationship = JoinField.Root<ParentType>()
}
var childDoc = new MyDocument
{
Child = new ChildType(),
Relationship = JoinField.Link<ChildType>(new Id(parent.Id))
}
- When using
JoinAttribute
onJoinField
property:
public class MyDocument
{
public ParentType Parent { get; set; }
public ChildType Child { get; set; }
[Join(typeof(ParentType), typeof(ChildType))]
public JoinField Relationship { get; set; }
}
Expected
Therefore, possibility to override class name for serialization should still be supported. In the past ElasticsearchTypeAttribute
's Name
property was used for this.
Metadata
Metadata
Assignees
Labels
No labels