7.0.0 ElasticsearchTypeAttribute should continue to support Name property
See original GitHub issueNEST/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.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Removal of mapping types | Elasticsearch Guide [8.9]
Elasticsearch 8.0.0 no longer supports mapping types. For details on how to migrate your clusters away from mapping types, see the removal of...
Read more >Could not load file or assembly 'Elasticsearch.Net' or one of ...
In case it helps anyone, the solution is to edit Web.config and change <assemblyIdentity name="Elasticsearch.
Read more >Using Elasticsearch with ASP.NET Core and Docker
Recently, I got an assignment for my employer's internal project to investigate Elasticsearch and its usage from within ASP.NET Core 2.1 app ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you a ton for reporting this @nenadvicentic
ElasticsearchTypeAttribute.RelationName
now controls this.Since this obscure I think it be best if we ship
.Name
and mark it obsolete instead, @codebrain @russcam thoughts?Closing this as #3702 has been merged. Will be in the next release