Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add #[elastic(ignore)] attribute to derive DocumentType #83

Open
KodrAus opened this issue Jul 4, 2017 · 0 comments
Open

Add #[elastic(ignore)] attribute to derive DocumentType #83

KodrAus opened this issue Jul 4, 2017 · 0 comments

Comments

@KodrAus
Copy link
Member

KodrAus commented Jul 4, 2017

When deriving a document type, it should be possible to exclude fields from the PropertiesMapping implementation without ignoring them in serialisation:

#[derive(ElasticType)]
struct MyType {
    id: i32,
    title: String,
    #[elastic(ignore)]
    tags: BTreeMap<String, Value>,
}

// Manual serialisation where `tags` are flattened onto the parent object, instead of being nested

One usecase for this would be having fields that are serialised differently by some manual serde implementation, and shouldn't be included in the mapping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant