Skip to content

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

@KodrAus

Description

@KodrAus

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions