elastic-rs / elastic

An Elasticsearch REST API client for Rust
Apache License 2.0
253 stars 40 forks source link

The mapping definition cannot be nested under a type [_doc] unless include_type_name is set to true. #374

Open MirrorBytes opened 5 years ago

MirrorBytes commented 5 years ago

With the latest pre-release, I'm getting an issue revolving around the document type. If I build out the mappings without Struct::static_ty(): Struct::index_mapping(), it's fine. Removing the wrapping "_doc": {} corrected the issue for me.

This is related to the removal of mapping types in version 7.x.

MirrorBytes commented 5 years ago

Oh man, I jumped the gun a bit. So the issue is actually using Struct::static_ty() in conjunction with Struct::index_mapping(). If I use "mappings": Struct::index_mapping(), it works fine.

That will have to be changed in the example I suppose.