elastic-rs / elastic

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

Change Elastic mapping type of serde_json::Value #411

Open lfdominguez opened 4 years ago

lfdominguez commented 4 years ago

The default mapping type for serde_json::Value is "nested" and that not allow make normal queries on ElasticSearch for dynamics data. How i can change the type to "object". Already i changed the code on file "src/elastic/src/types/document/mapping.rs" on trait ObjectMapping from NESTED_DATATYPE to OBJECT_DATATYPE and now my elastic queries are responding with results.

mwilliammyers commented 4 years ago

You can also do it though Elasticsearch directly, I use dynamic mappings personally...

lfdominguez commented 4 years ago

You can also do it though Elasticsearch directly, I use dynamic mappings personally...

Yes of course, i can use curl directly to put data on ElasticSearch too. The main question is why use "nested" for object types and not "object"