vinted / elasticsearch-dsl-rs

Strongly typed Elasticsearch DSL written in Rust
Apache License 2.0
198 stars 18 forks source link

Add support for custom fields #265

Closed DmitrySamoylov closed 5 months ago

DmitrySamoylov commented 5 months ago

Hello! Thanks for this crate!

What do you think about adding a catch-all field for unimplemented fields? Today I needed knn but it was missing.

So I took an approach similar to Query::json() but for top-level struct Search.

DmitrySamoylov commented 5 months ago

Hi, thanks for your contribution, I'm happy with your change but I can see myself implementing kNN support to provide type safety and autocomplete. If that's what you're after, this should be a relatively quick change and I could do that.

Yeah, would be nice to have it :+1:

There are 2 places where kNN is defined, and the types are slightly different: