elastic-rs / elastic

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

Generate field metadata on ElasticType #259

Open KodrAus opened 7 years ago

KodrAus commented 7 years ago

For supporting a strongly-typed Query DSL, we should generate some runtime-queryable metadata for each field when deriving ElasticType.

That way we can capture properties of each field that might affect generated queries as types. Things like date formats for example.

I don't have a clear picture of what this should look like yet, I think we'll end up with some strongly-typed structure implementing traits for each field, one per type, but it needs some proper design.

KodrAus commented 7 years ago

We don't want to lose the ability to manually construct queries ergonomically or deserialise them from files.

Making queries generic and composable will be quite tricky.